Thursday, 26 February 2015

Simple Trading Signal

 Simple Trading Signal


_SECTION_BEGIN("Simple Trading Signal");
range = Param("Periods", 2, 2, 50, 1 );
p=PDI(range);
pbuy  = Param("Buy if +DI <", 15, 5, 25, 1 );
psell = Param("Sell if +DI >", 45, 25, 75, 1 );

Buy     = p > Ref(p,-1) AND Ref(p,-1) < Ref(p,-2) AND Ref(p,-1) < pbuy ;
Sell     = p < Ref(p,-1) AND Ref(p,-1) > Ref(p,-2) AND Ref(p,-1) > psell ;
Buy     = ExRem(Buy,Sell);
Sell     = ExRem(Sell,Buy);
Plot(C,"",colorWhite,64);

PlotShapes(Buy*shapeUpArrow,colorBrightGreen,0,Low,Offset=-20);
PlotShapes(Sell*shapeDownArrow,colorRed,0,High,Offset=-20);
_SECTION_END();

No comments:

Post a Comment

Thanks