NEW INDICATOR - TRO EVALUATOR - YOU'RE GOING TO LOVE THIS!!
Posted: Thu Jun 29, 2006 4:58 pm
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?
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