Page 1 of 7

NEW INDICATOR - TRO EVALUATOR - YOU'RE GOING TO LOVE THIS!!

Posted: Thu Jun 29, 2006 4:58 pm
by TheRumpledOne
The TRO EVALUATOR works in charts and radar... iRadar user inputs controls the setting (= true for radar, = false for chart).

I gave you 8 input triggers for long/short entry/exits. But if you use that many, I am going to wonder about your trading method.

The TRO EVALUATOR tests each trigger. If the trigger is TRUE then it adds 1 to a counter. If the counter meets/exceed the signal threshold then the value is display. In other words, it tells you how many of your triggers are true.

In the example I have the entry signal set to 2 and the exit signal set to 1.

If 2 or more of my entry triggers are true, the result will be displayed.

If 1 or more of my exit triggers are true, the result will be displayed.

If the bar before my triggers were true had a signal count of 0 then the background will be WHITE to alert me that this is the first time my signal threshold was met.



Why didn't I think of this sooner?



Code: Select all

// _TRO_EVALUATOR  - evaluates user input trade triggers
   

{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 2006 Avery T. Horton, Jr.}

inputs:

iRadar(true),       // true = radar, false = Chart

iLgEntryColor ( blue ),
iLgExitColor ( red ),

iShEntryColor ( darkmagenta ),
iShExitColor ( darkcyan ),

iLgEntrySignal( 2 ) ,
iLgExitSignal( 1 ) ,

iShEntrySignal( 2 ) ,
iShExitSignal( 1 ) ,

iLgEntryTrigger1( close crosses above xavg(close,5) and xavg(close,5) > xavg(close[1],5) ),   
iShEntryTrigger1( close crosses below xavg(close,5) and xavg(close,5) < xavg(close[1],5) ),

iLgExitTrigger1(c < c[1] and c[1] < c[2]),
iShExitTrigger1(c > c[1] and c[1] > c[2]),


iLgEntryTrigger2( close crosses above ( h[1] + l[1] ) *.5  ),   
iShEntryTrigger2( close crosses below ( h[1] + l[1] ) *.5  ),

iLgExitTrigger2(c < ( h + l ) *.5 ),
iShExitTrigger2(c > ( h + l ) *.5 ),
 
iLgEntryTrigger3( close crosses above xavg(close,21) and xavg(close,21) > xavg(close[1],21) ),   
iShEntryTrigger3( close crosses below xavg(close,21) and xavg(close,21) < xavg(close[1],21) ),

iLgExitTrigger3(false),
iShExitTrigger3(false),


iLgEntryTrigger4( close crosses above ( h + l ) *.5  ),   
iShEntryTrigger4( close crosses below ( h + l ) *.5  ),

iLgExitTrigger4(false),
iShExitTrigger4(false ),
 


iLgEntryTrigger5(false),
iShEntryTrigger5(false),

iLgExitTrigger5(false),
iShExitTrigger5(false),


iLgEntryTrigger6(false),   
iShEntryTrigger6(false),

iLgExitTrigger6(false),
iShExitTrigger6(false),
 
iLgEntryTrigger7(false),   
iShEntryTrigger7(false),

iLgExitTrigger7(false),
iShExitTrigger7(false),


iLgEntryTrigger8(false),
iShEntryTrigger8(false),

iLgExitTrigger8(false),
iShExitTrigger8(false );


variables:
 

sFirstPass(true),
 
xPlot1( 00 ),
xPlot2( 00 ),
xPlot3( 00 ),
xPlot4( 00 );

variables:
 
FG1(white),
BG1(black),

fg2(white),
bg2(black),

fg3(white),
bg3(black),

fg4(white),
bg4(black);



{ INITIALIZE }

if iRadar
then begin

FG1 = BLACK;
BG1 = BLACK;

fg2 = BLACK;
bg2 = BLACK;

fg3 = BLACK;
bg3 = BLACK;

fg4 = BLACK;
bg4 = BLACK;
end
else begin
FG1 = white;
BG1 = darkgray;

fg2 = white;
bg2 = darkgray;

fg3 = darkgray;
bg3 = darkgray;

fg4 = darkgray;
bg4 = darkgray;
end; // if iRadar


xPlot1 = 0 ;
xPlot2 = 0 ;
xPlot3 = 0 ;
xPlot4 = 0 ;



{ Alert criteria }


If iLgEntryTrigger1
then begin
   xPlot1 = xPlot1 + 1 ;
end;


If iLgEntryTrigger2
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgEntryTrigger3
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgEntryTrigger4
then begin
   xPlot1 = xPlot1 + 1 ;
end;


If iLgEntryTrigger5
then begin
   xPlot1 = xPlot1 + 1 ;
end;


If iLgEntryTrigger6
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgEntryTrigger7
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgEntryTrigger8
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgExitTrigger1
then begin
   xPlot2 = xPlot2 + 1 ;
end;


If iLgExitTrigger2
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger3
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger4
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger5
then begin
   xPlot2 = xPlot2 + 1 ;
end;


If iLgExitTrigger6
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger7
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger8
then begin
   xPlot2 = xPlot2 + 1 ;
end;








If iShEntryTrigger1
then begin
   xPlot3 = xPlot3 + 1 ;
end;


If iShEntryTrigger2
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShEntryTrigger3
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShEntryTrigger4
then begin
   xPlot3 = xPlot3 + 1 ;
end;




If iShEntryTrigger5
then begin
   xPlot3 = xPlot3 + 1 ;
end;


If iShEntryTrigger6
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShEntryTrigger7
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShEntryTrigger8
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShExitTrigger1
then begin
   xPlot4 = xPlot4 + 1 ;
end;


If iShExitTrigger2
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger3
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger4
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger5
then begin
   xPlot4 = xPlot4 + 1 ;
end;


If iShExitTrigger6
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger7
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger8
then begin
   xPlot4 = xPlot4 + 1 ;
end;


If xPlot1 >= iLgEntrySignal
then begin
   Fg1 = iLgEntryColor ;
end;

If  xPlot1 >  0
and xPlot1[1] = 0
then begin
   Fg1 = iLgEntryColor ;
   Bg1 = white ;
end;




If xPlot2 >= iLgExitSignal
then begin
   Fg2 = iLgExitColor ;
end;

If  xPlot2 >  0
and xPlot2[1] = 0
then begin
   Fg2 = iLgExitColor ;
   Bg2 = white ;
end;


If xPlot3 >= iShEntrySignal
then begin
   Fg3 = iShEntryColor ;
end;

If  xPlot3 >  0
and xPlot3[1] = 0
then begin
   Fg3 = iShEntryColor ;
   Bg3 = white ;
end;

 
If xPlot4 >= iShExitSignal
then begin
   Fg4 = iShExitColor ;
end;

If  xPlot4 >  0
and xPlot4[1] = 0
then begin
   Fg4 = iShExitColor ;
   Bg4 = white ;
end;


{ PLOT }


if iRadar
then begin

Plot1( xPlot1 , "LgEntry", fg1 ) ;
SetPlotBGColor( 1, bg1);

Plot2( xPlot2 , "LgExit", fg2 ) ;
SetPlotBGColor( 2, bg2);

Plot3( xPlot3 , "ShEntry", fg3 ) ;
SetPlotBGColor( 3, bg3);

Plot4( xPlot4 , "ShExit", fg4 ) ;
SetPlotBGColor( 4, bg4);
end
else begin

Plot1( xPlot1 , "LgEntry", fg1 ) ;

Plot2( xPlot2 , "LgExit", fg2 ) ;

Plot3( 0 - xPlot3 , "ShEntry", fg3 ) ;

Plot4( 0 - xPlot4 , "ShExit", fg4 ) ;
end; // if iRadar

Posted: Thu Jun 29, 2006 11:58 pm
by TheRumpledOne
I created functions so you can use my Dynamic Support and Resistance in the EVALUATOR.

I also attached a workspace so you can get up and running.

Posted: Fri Jun 30, 2006 12:44 am
by TheRumpledOne
Here's an alternate version that you can use for debugging or trading:




The triggers are placed left to right.. 12345678

So 10010000 means triggers 1 and 4 are TRUE, the rest false.

I also included a revision of _TRO_EVALUATOR in the ELD.


Code: Select all

// _TRO_EVALUATOR_ALT  - evaluates user input trade triggers
   

{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 2006 Avery T. Horton, Jr.}

inputs:

iRadar(true),       // true = radar, false = Chart

iLgEntryColor ( blue ),
iLgExitColor ( red ),

iShEntryColor ( darkmagenta ),
iShExitColor ( darkcyan ),

iLgEntrySignal( 2 ) ,
iLgExitSignal( 1 ) ,

iShEntrySignal( 2 ) ,
iShExitSignal( 1 ) ,

iLgEntryTrigger1( close crosses above xavg(close,5) and xavg(close,5) > xavg(close[1],5) ),   
iShEntryTrigger1( close crosses below xavg(close,5) and xavg(close,5) < xavg(close[1],5) ),

iLgExitTrigger1(c < c[1] and c[1] < c[2]),
iShExitTrigger1(c > c[1] and c[1] > c[2]),


iLgEntryTrigger2( close crosses above ( h[1] + l[1] ) *.5  ),   
iShEntryTrigger2( close crosses below ( h[1] + l[1] ) *.5  ),

iLgExitTrigger2(c < ( h + l ) *.5 ),
iShExitTrigger2(c > ( h + l ) *.5 ),
 
iLgEntryTrigger3( close crosses above xavg(close,21) and xavg(close,21) > xavg(close[1],21) ),   
iShEntryTrigger3( close crosses below xavg(close,21) and xavg(close,21) < xavg(close[1],21) ),

iLgExitTrigger3(false),
iShExitTrigger3(false),


iLgEntryTrigger4( l > l[1] and l[1] > l[2]  ),   
iShEntryTrigger4( l < l[1] and l[1] < l[2]  ),

iLgExitTrigger4( h < h[2] ),
iShExitTrigger4( L > L[2] ),
 


iLgEntryTrigger5(false),
iShEntryTrigger5(false),

iLgExitTrigger5(false),
iShExitTrigger5(false),


iLgEntryTrigger6(false),   
iShEntryTrigger6(false),

iLgExitTrigger6(false),
iShExitTrigger6(false),
 
iLgEntryTrigger7(false),   
iShEntryTrigger7(false),

iLgExitTrigger7(false),
iShExitTrigger7(false),


iLgEntryTrigger8(false),
iShEntryTrigger8(false),

iLgExitTrigger8(false),
iShExitTrigger8(false );


variables:
 
xPlot1a( "" ),
xPlot2a( "" ),
xPlot3a( "" ),
xPlot4a( "" ),


sFirstPass(true),
 
xPlot1( 00 ),
xPlot2( 00 ),
xPlot3( 00 ),
xPlot4( 00 );

variables:
 
FG1(white),
BG1(black),

fg2(white),
bg2(black),

fg3(white),
bg3(black),

fg4(white),
bg4(black);



{ INITIALIZE }

if iRadar
then begin
{
FG1 = BLACK;
BG1 = BLACK;

fg2 = BLACK;
bg2 = BLACK;

fg3 = BLACK;
bg3 = BLACK;

fg4 = BLACK;
bg4 = BLACK;
}
FG1 = white;
BG1 = BLACK;

fg2 = white;
bg2 = BLACK;

fg3 = white;
bg3 = BLACK;

fg4 = white;
bg4 = BLACK;
end
else begin
FG1 = white;
BG1 = darkgray;

fg2 = white;
bg2 = darkgray;

fg3 = darkgray;
bg3 = darkgray;

fg4 = darkgray;
bg4 = darkgray;
end; // if iRadar


xPlot1 = 0 ;
xPlot2 = 0 ;
xPlot3 = 0 ;
xPlot4 = 0 ;



{ Alert criteria }


If iLgEntryTrigger1
then begin
   xPlot1 = xPlot1 + 1 ;
end;


If iLgEntryTrigger2
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgEntryTrigger3
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgEntryTrigger4
then begin
   xPlot1 = xPlot1 + 1 ;
end;


If iLgEntryTrigger5
then begin
   xPlot1 = xPlot1 + 1 ;
end;


If iLgEntryTrigger6
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgEntryTrigger7
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgEntryTrigger8
then begin
   xPlot1 = xPlot1 + 1 ;
end;

If iLgExitTrigger1
then begin
   xPlot2 = xPlot2 + 1 ;
end;


If iLgExitTrigger2
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger3
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger4
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger5
then begin
   xPlot2 = xPlot2 + 1 ;
end;


If iLgExitTrigger6
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger7
then begin
   xPlot2 = xPlot2 + 1 ;
end;

If iLgExitTrigger8
then begin
   xPlot2 = xPlot2 + 1 ;
end;








If iShEntryTrigger1
then begin
   xPlot3 = xPlot3 + 1 ;
end;


If iShEntryTrigger2
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShEntryTrigger3
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShEntryTrigger4
then begin
   xPlot3 = xPlot3 + 1 ;
end;




If iShEntryTrigger5
then begin
   xPlot3 = xPlot3 + 1 ;
end;


If iShEntryTrigger6
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShEntryTrigger7
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShEntryTrigger8
then begin
   xPlot3 = xPlot3 + 1 ;
end;

If iShExitTrigger1
then begin
   xPlot4 = xPlot4 + 1 ;
end;


If iShExitTrigger2
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger3
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger4
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger5
then begin
   xPlot4 = xPlot4 + 1 ;
end;


If iShExitTrigger6
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger7
then begin
   xPlot4 = xPlot4 + 1 ;
end;

If iShExitTrigger8
then begin
   xPlot4 = xPlot4 + 1 ;
end;


If xPlot1 >= iLgEntrySignal
then begin
   Fg1 = iLgEntryColor ;
end;

If  xPlot1 >  0
and xPlot1[1] = 0
then begin
   Fg1 = iLgEntryColor ;
   Bg1 = white ;
end;




If xPlot2 >= iLgExitSignal
then begin
   Fg2 = iLgExitColor ;
end;

If  xPlot2 >  0
and xPlot2[1] = 0
then begin
   Fg2 = iLgExitColor ;
   Bg2 = white ;
end;


If xPlot3 >= iShEntrySignal
then begin
   Fg3 = iShEntryColor ;
end;

If  xPlot3 >  0
and xPlot3[1] = 0
then begin
   Fg3 = iShEntryColor ;
   Bg3 = white ;
end;

 
If xPlot4 >= iShExitSignal
then begin
   Fg4 = iShExitColor ;
end;

If  xPlot4 >  0
and xPlot4[1] = 0
then begin
   Fg4 = iShExitColor ;
   Bg4 = white ;
end;


{ PLOT }


if iRadar
then begin

If iLgEntryTrigger1
   then xPlot1a = "1" 
   else xPlot1a = "0" ;

If iLgEntryTrigger2
   then xPlot1a = xPlot1a + "1" 
   else xPlot1a = xPlot1a + "0" ;

If iLgEntryTrigger3
   then xPlot1a = xPlot1a + "1" 
   else xPlot1a = xPlot1a + "0" ;

If iLgEntryTrigger4
   then xPlot1a = xPlot1a + "1" 
   else xPlot1a = xPlot1a + "0" ;

If iLgEntryTrigger5
   then xPlot1a = xPlot1a + "1" 
   else xPlot1a = xPlot1a + "0" ;

If iLgEntryTrigger6
   then xPlot1a = xPlot1a + "1" 
   else xPlot1a = xPlot1a + "0" ;

If iLgEntryTrigger7
   then xPlot1a = xPlot1a + "1" 
   else xPlot1a = xPlot1a + "0" ;

If iLgEntryTrigger8
   then xPlot1a = xPlot1a + "1" 
   else xPlot1a = xPlot1a + "0" ;




If iLgExitTrigger1
   then xPlot2a = "1" 
   else xPlot2a = "0" ;

If iLgExitTrigger2
   then xPlot2a = xPlot2a + "1" 
   else xPlot2a = xPlot2a + "0" ;

If iLgExitTrigger3
   then xPlot2a = xPlot2a + "1" 
   else xPlot2a = xPlot2a + "0" ;

If iLgExitTrigger4
   then xPlot2a = xPlot2a + "1" 
   else xPlot2a = xPlot2a + "0" ;

If iLgExitTrigger5
   then xPlot2a = xPlot2a + "1" 
   else xPlot2a = xPlot2a + "0" ;

If iLgExitTrigger6
   then xPlot2a = xPlot2a + "1" 
   else xPlot2a = xPlot2a + "0" ;

If iLgExitTrigger7
   then xPlot2a = xPlot2a + "1" 
   else xPlot2a = xPlot2a + "0" ;

If iLgExitTrigger8
   then xPlot2a = xPlot2a + "1" 
   else xPlot2a = xPlot2a + "0" ;



If iShEntryTrigger1
   then xPlot3a = "1" 
   else xPlot3a = "0" ;

If iShEntryTrigger2
   then xPlot3a = xPlot3a + "1" 
   else xPlot3a = xPlot3a + "0" ;

If iShEntryTrigger3
   then xPlot3a = xPlot3a + "1" 
   else xPlot3a = xPlot3a + "0" ;

If iShEntryTrigger4
   then xPlot3a = xPlot3a + "1" 
   else xPlot3a = xPlot3a + "0" ;

If iShEntryTrigger5
   then xPlot3a = xPlot3a + "1" 
   else xPlot3a = xPlot3a + "0" ;

If iShEntryTrigger6
   then xPlot3a = xPlot3a + "1" 
   else xPlot3a = xPlot3a + "0" ;

If iShEntryTrigger7
   then xPlot3a = xPlot3a + "1" 
   else xPlot3a = xPlot3a + "0" ;

If iShEntryTrigger8
   then xPlot3a = xPlot3a + "1" 
   else xPlot3a = xPlot3a + "0" ;




If iShExitTrigger1
   then xPlot4a = "1" 
   else xPlot4a = "0" ;

If iShExitTrigger2
   then xPlot4a = xPlot4a + "1" 
   else xPlot4a = xPlot4a + "0" ;

If iShExitTrigger3
   then xPlot4a = xPlot4a + "1" 
   else xPlot4a = xPlot4a + "0" ;

If iShExitTrigger4
   then xPlot4a = xPlot4a + "1" 
   else xPlot4a = xPlot4a + "0" ;

If iShExitTrigger5
   then xPlot4a = xPlot4a + "1" 
   else xPlot4a = xPlot4a + "0" ;

If iShExitTrigger6
   then xPlot4a = xPlot4a + "1" 
   else xPlot4a = xPlot4a + "0" ;

If iShExitTrigger7
   then xPlot4a = xPlot4a + "1" 
   else xPlot4a = xPlot4a + "0" ;

If iShExitTrigger8
   then xPlot4a = xPlot4a + "1" 
   else xPlot4a = xPlot4a + "0" ;

Plot1( xPlot1a , "LgEntry", fg1 ) ;
SetPlotBGColor( 1, bg1);

Plot2( xPlot2a , "LgExit", fg2 ) ;
SetPlotBGColor( 2, bg2);

Plot3( xPlot3a , "ShEntry", fg3 ) ;
SetPlotBGColor( 3, bg3);

Plot4( xPlot4a , "ShExit", fg4 ) ;
SetPlotBGColor( 4, bg4);
{
end

else begin

Plot1( xPlot1 , "LgEntry", fg1 ) ;

Plot2( xPlot2 , "LgExit", fg2 ) ;

Plot3( 0 - xPlot3 , "ShEntry", fg3 ) ;

Plot4( 0 - xPlot4 , "ShExit", fg4 ) ;
}
end; // if iRadar

Posted: Fri Jun 30, 2006 6:55 am
by TheRumpledOne
I see some of you traders download the indicator...

Any comments?

Having fun with it?

Posted: Fri Jun 30, 2006 6:13 pm
by rrobin
This one is $fun.

I changed the colors and the style weight so my old eyes could function.

Played with AAPL on a 10 minute chart with a 60 minute compass.

When you get 3 or 4 signal good things happen.

Thank for all your ideas and help.

rr

Posted: Fri Jun 30, 2006 7:18 pm
by TheRumpledOne
rrobin, what triggers did you use?

Posted: Mon Jul 03, 2006 4:53 pm
by TheRumpledOne
OPINION'S WANTED





I changed the exits from histograms to lines because sometimes you can't see the exit AND entry.

Which way do you prefer?

Just curious.

Posted: Mon Jul 03, 2006 5:20 pm
by eudamonia
TRO,

Yes this looks cleaner. Please post the revised version if you would. Thanks.

Edward

Posted: Mon Jul 03, 2006 6:48 pm
by TheRumpledOne
lol.. no revision... just right click on the indicator and format the style from histogram to lines for the exit triggers.

Posted: Mon Jul 03, 2006 7:00 pm
by aracari
Great work on this. I have not used this yet, but the concept seems similar to the Data Mining Indicators and ShowMe that I got on the TS website. The indicator does what you have coded and the Showme prints a signal on the chart and then the commentary window will show the average win rate, average percentage win and summary percentage win for up to 15 bars. I have used this quite a bit in looking for setups. I'll work on a screen shot and post it.

Sorry for the delay. My Office cable connection died. Did this from home.

This image shows a Showme on the chart that labels every time the condition is correct.

The commentary window is to the left and shows the average % change, summary % change and win %. These figures are based on the number of bars out from the condition.

In this case the condition is : Close Crosses Above PrevDayMid and close > jtHMA(close, 21); It uses the middle code written by TRO.