TRO BUY ZONE DAILY, WEEKLY, MONTHLY

post your indicators here

Moderator: moderators

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15558
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

TRO BUY ZONE DAILY, WEEKLY, MONTHLY

Postby TheRumpledOne » Tue May 29, 2007 3:12 pm

TRO BUY ZONE DAILY, WEEKLY, MONTHLY



TRO BUYZONE DWM - buy zone for daily, weekly and monthly open price.

RADAR ONLY! Use TRO PLOT to plot daily, weekly and monthly open price on charts.


ELD attached.
Attachments
BUYZONE_DWM.ELD
(16.49 KiB) Downloaded 294 times
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!

Please do NOT PM me with trading or coding questions, post them in a thread.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

cvax
rank: 50+ posts
rank: 50+ posts
Posts: 83
Joined: Sun May 13, 2007 12:45 am
Reputation: 0
Gender: None specified

Postby cvax » Wed May 30, 2007 4:54 am

Could I please get the code for this one? Sorry I can't view ELDs :(. Thanks a lot TRO.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15558
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Wed May 30, 2007 12:39 pm

Code: Select all

[LegacyColorValue = true];

{ _TRO_BuyZone_DWM }
   

{Attn: TradeStation
if this indicator is posted on the TradeStation Forum, I, TheRumpledOne, did NOT post it there,
so I can't be blamed for this indicator having my contact info.}


{Programmer:  Avery T. Horton, Jr.  aka TheRumpledOne,
gifts and donations accepted, PO Box 43575, Tucson, AZ 85733 }

{ ? Copyright 2007 Avery T. Horton, Jr.}


// Value1 = GetAppInfo(aiApplicationType);        // returns a value that identifies the calling window type

// cUnknown = 0 cChart = 1  cRadarScreen = 2 cOptionStation = 3


inputs:
iDecimals(4),
iStartDate(currentdate),   


iDailyOpen(dailyopen),

iWeeklyOpen(openw(0)),

iMonthlyOpen(openm(0)),


iOpenBuyZone(.0003),
   
iBuyZoneHI(.0004),           {inside ask must be <= (OPEN + iBuyZoneHI) to place buy order}
iBuyZoneLO(.0004),          {inside bid must be >= (OPEN - iBuyZoneLO) to place buy order}

   

//iCode("114401258"),
 
   
//iAlertMessage("LD Session"),

   LongTopColor( blue),
   LongBotColor( blue) ,

   OpenColor( white),

   ShortTopColor( red),
   ShortBotColor( red);
   
variables:

FG1(white),
BG1(black),

FG2(white),
BG2(black),

FG3(white),
BG3(black),

FG4(white),
BG4(black),
      

   ClOp( 0 ),
   OpCl( 0 ),

tMsg(""),
tAlert(""),
Candle(0),
CandleDaily(0),
BuyZone( 0 ),
xBuyZone(0),
tBuyZone(""),

sFirstPass(true),
xAppType(0),

xBuyZoneHI(0),           {inside ask must be <= (OPEN + iBuyZoneHI) to place buy order}
xBuyZoneLO(0),          {inside bid must be >= (OPEN - iBuyZoneLO) to place buy order}

ShortDiff( 0 ),
LongDiff( 0 ),
tShortDiff( "" ),
tLongDiff( "" ),

xDailyOpen( 0 ),
   ShortBot( 0 ),
   ShortTop( 0 ),
   LongTop( 0 ),
   LongBot( 0 ) ;
variables:

xMonthlyOpen( 0 ),   

wShortDiff( 0 ),
wLongDiff( 0 ),
twShortDiff( "" ),
twLongDiff( "" ),

xWeeklyOpen( 0 ),
   wShortBot( 0 ),
   wShortTop( 0 ),
   wLongTop( 0 ),
   wLongBot( 0 ) ;

variables:
   
//xCode(iCode),

float ErrorCode( -1 ),

float zDailyOpen( 0 ),
 
int RtnVal( 0 ) ;

{commentary variables}
      
variables:
         
xcomm(0),
oComm1( "" ),    
oComm2( "" ),    
oComm3( "" ),    
oComm4( "" ),    
oComm5( "" ),
oComm6( "" ),
oComm7( "" ),
oComm8( "" ),
oComm9( "" ),    
oComm10( "" );
   
 

{first time through}

if sFirstPass
then begin
   
sFirstPass = false;

//if xCode = ""
//   then xCode = NumToStr(BarType,0) + NumToStr(BarInterval,0) + NumToStr(SessionStartTime(0,1),0) ;

xAppType = GetAppInfo(aiApplicationType);        // cUnknown = 0 cChart = 1  cRadarScreen = 2 cOptionStation = 3

end; {if sFirstPass}


{ INITIALIZE }

tAlert = "";

FG1 = WHITE;
BG1 = BLACK;

fg2 = WHITE;
bg2 = BLACK;

fg3 = WHITE;
bg3 = BLACK;

fg4 = WHITE;
bg4 = BLACK;

//tAlert  = iAlertMessage;

{*************************************************}
{    C A L C U L A T I O N S                      }
{*************************************************}
 
if lastbaronchart
or date >= iStartDate
then begin

//zDailyOpen = GVGetNamedFloat( GetSymbolName + xCode + "_DailyOpen" , ErrorCode ) ;


{*************************************************}
{    C A L C U L A T I O N S                      }
{*************************************************}

xdailyopen = iDailyOpen ;

LongTop    = xdailyopen + iBuyZoneHI;
LongBot    = xdailyopen + iOpenBuyZone;

ShortTop   = xdailyopen - iOpenBuyZone;
ShortBot   = xdailyopen - iBuyZoneLO;

ShortDiff   = ShortTop - close  ;

LongDiff   = close - LongBot  ;

tShortDiff = numtostr( ShortDiff , iDecimals ) ;

tLongDiff  = numtostr( LongDiff , iDecimals ) ;


{*************************************************}
{  weekly  C A L C U L A T I O N S                      }
{*************************************************}

xWeeklyOpen = iWeeklyOpen ;
xMonthlyOpen = iMonthlyOpen ;

wLongTop    = xWeeklyOpen + iBuyZoneHI;
wLongBot    = xWeeklyOpen + iOpenBuyZone;

wShortTop   = xWeeklyOpen - iOpenBuyZone;
wShortBot   = xWeeklyOpen - iBuyZoneLO;

wShortDiff   = ShortTop - close  ;

wLongDiff   = close - LongBot  ;

twShortDiff = numtostr( ShortDiff , iDecimals ) ;

twLongDiff  = numtostr( LongDiff , iDecimals ) ;

{ Alert criteria }



If close < xdailyopen
and close > ShortTop
then begin
   tBuyZone = "Wait " + tShortDiff ;
   FG1 = RED;
   BG1 = YELLOW;
end
else
If close > xdailyopen
and close < LongBot
then begin
   tBuyZone = "Wait " + tLongDiff ;
   FG1 = BLACK;
   BG1 = YELLOW;
end;

If close crosses below xdailyopen
then begin
   tBuyZone = "X Open " + tShortDiff ;
   FG1 = RED;
   BG1 = YELLOW;
end
else
   
If close crosses above xdailyopen
then begin
   tBuyZone = "X Open " + tLongDiff ;
   FG1 = BLACK;
   BG1 = YELLOW;
end
else

If close crosses below LongTop
then begin
   tBuyZone = "X LgTOP " + tLongDiff ;
   FG1 = RED;
   BG1 = YELLOW;
end
else

If close crosses above LongBot
then begin
   tBuyZone = "X LgBOT " + tLongDiff ;
   FG1 = BLACK;
   BG1 = YELLOW;
end
else
   
If close > LongTop
then begin
   tBuyZone = "ABOVE " + tLongDiff ;
   FG1 = GREEN;
   BG1 = BLACK;
end
else

If close crosses below ShortTop
then begin
   tBuyZone = "X ShTOP " + tShortDiff ;
   FG1 = red;
   BG1 = YELLOW;
end
else

If close crosses above ShortBot
then begin
   tBuyZone = "X ShBOT " + tShortDiff ;
   FG1 = black;
   BG1 = YELLOW;
end
else
   
If close < ShortBot
then begin
   tBuyZone = "BELOW " + tShortDiff ;
   FG1 = RED;
   BG1 = BLACK;
end
else
   
If close > LongBot
and close <= LongTop
then begin
   tBuyZone = "BUY " + tLongDiff ;
   FG1 = BLACK;
   BG1 = green;
end
else
   
If close >= ShortBot
and close < ShortTop
then begin
   tBuyZone = "SHORT " + tShortDiff ;
   FG1 = BLACK;
   BG1 = red;
end;


if close = xdailyopen
then begin
   tAlert = "At Daily Open" ;
   FG2 = BLACK;
   BG2 = white;
end
else

if close > xdailyopen
then begin
   FG2 = green;
   BG2 = BLACK;
end
else
if close < xdailyopen
then begin
   FG2 = red;
   BG2 = BLACK;
end;




if close = xWeeklyOpen
then begin
   tAlert = "At Weekly Open" ;
   FG3 = BLACK;
   BG3 = white;
end
else
if close > xWeeklyOpen
then begin
   FG3 = green;
   BG3 = BLACK;
end
else
if close < xWeeklyOpen
then begin
   FG3 = red;
   BG3 = BLACK;
end;


if close = xMonthlyOpen
then begin
   tAlert = "At Monthly Open" ;
   FG4 = BLACK;
   BG4 = white;
end
else
if close > xMonthlyOpen
then begin
   FG4 = green;
   BG4 = BLACK;
end
else
if close < xMonthlyOpen
then begin
   FG4 = red;
   BG4 = BLACK;
end;

{ Alert }

//if tAlert <> iAlertMessage
if tAlert <> ""
   then Alert( tAlert ) ;

{ PLOTS }

Plot1( tBuyZone, "BuyZone", fg1 ) ;
SetPlotBGColor( 1, bg1);

Plot2( xdailyopen, "dailyopen", FG2 ) ;
SetPlotBGColor( 2, BG2);


Plot3( xWeeklyopen, "weeklyopen", FG3 ) ;
SetPlotBGColor( 3, BG3);


Plot4( xMonthlyOpen, "monthlyOpen", FG4 ) ;
SetPlotBGColor( 4, BG4);

end; //  if lastbaronchart


if xAppType = 2
then begin
   
if close > xDailyOpen
   then tMsg = tAlert + " +" + numtostr( ClOp, iDecimals )
   else tMsg = tAlert + " -" + numtostr( OpCl, iDecimals ) ;

//   Plot6( tMsg, "Message", FG1 ) ;
   
end; // if xAppType = 2

xComm = _fCommentary(oComm1, oComm2, oComm3, oComm4, oComm5, oComm6, oComm7, oComm8, oComm9, oComm10);

CommentaryCl(oComm1 );

CommentaryCl(oComm2 );
CommentaryCl(oComm3 );
CommentaryCl(oComm4 );
CommentaryCl(oComm5 );
CommentaryCl(oComm6 );
CommentaryCl(oComm7 );
CommentaryCl(oComm8 );
CommentaryCl(oComm9 );
CommentaryCl(oComm10 );


Commentary(" ");

Commentary("Open   = ", numtostr( Open,iDecimals) , NewLine);
Commentary("Opend(0)  = ", numtostr( Opend(0),iDecimals) , NewLine);
Commentary("xdailyopen  = ", numtostr( xdailyopen ,iDecimals) , NewLine);

Commentary(" ");

Commentary("LongTop   = ", numtostr( LongTop,iDecimals) , NewLine);
Commentary("LongBot   = ", numtostr( LongBot,iDecimals) , NewLine);
Commentary("ShortTop   = ", numtostr( ShortTop,iDecimals) , NewLine);
Commentary("ShortBot   = ", numtostr( ShortBot,iDecimals) , NewLine);


Commentary("iOpenBuyZone   = ", numtostr( iOpenBuyZone,iDecimals) , NewLine);
Commentary("iBuyZoneHI   = ", numtostr( iBuyZoneHI,iDecimals) , NewLine);
Commentary("iBuyZoneLO   = ", numtostr( iBuyZoneLO,iDecimals) , NewLine);



Commentary(" ");

Commentary("ErrorCode   = ", numtostr( ErrorCode , 0 ) , NewLine);
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!



Please do NOT PM me with trading or coding questions, post them in a thread.

User avatar
jana
rank: <50 posts
rank: <50 posts
Posts: 28
Joined: Sun May 20, 2007 6:36 pm
Reputation: 0
Location: Dallas, Texas
Gender: None specified

Postby jana » Sun Jun 03, 2007 5:33 pm

"RADAR ONLY! Use TRO PLOT to plot daily, weekly and monthly open price on charts. "

Does this plot on charts also? I see your 'Radar Only", but I do not see it on any time frame chart.

Now I can vent! :lol:

:shock: OMG !!!!

I have lerked for a while and just this last week used only, By/Sell and Gridiron. All I can say is, simply awesome TRO!!!

Raped, Robbed & Pillaged all week!!! :twisted:

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15558
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Sun Jun 03, 2007 9:54 pm

jana:

TRO BUYZONE DWM - is for RADAR SCREEN.

I didn't code it to work on charts because I can use TRO PLOT to do that.
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!



Please do NOT PM me with trading or coding questions, post them in a thread.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.

C-Trader
rank: <50 posts
rank: <50 posts
Posts: 18
Joined: Tue Aug 14, 2007 8:34 pm
Reputation: 0
Location: Lafayette, CA
Gender: Male

Postby C-Trader » Fri Sep 21, 2007 11:15 pm

Does TRO BuyZone DWM work for stocks if you change the inputs? If so what area is the "buy/short zone" Like for the regular buy zone there is a Long bottom and Long Top and a short bottom and short top.

User avatar
TheRumpledOne
rank: 10000+ posts
rank: 10000+ posts
Posts: 15558
Joined: Sun May 14, 2006 9:31 pm
Reputation: 3035
Location: Oregon
Real name: Avery T. Horton, Jr.
Gender: None specified
Contact:

Postby TheRumpledOne » Sat Sep 22, 2007 8:02 pm

I think it should work for stocks.

The buy zone is the area around the open price for the interval.
IT'S NOT WHAT YOU TRADE, IT'S HOW YOU TRADE IT!



Please do NOT PM me with trading or coding questions, post them in a thread.

Please add www.kreslik.com to your ad blocker white list.
Thank you for your support.


Return to “Tradestation indicators”