Pull back scan

1sandeepgupta

Well-Known Member
#1
Please suggest the pullback scan afl where after the pullback in the up trend the last candle is reversal candle like doji, hammer, piercing, morning/evening star, engulfing. Regards.
 
#6
HI,check this formula

Code:
// Moving Average Pullback system
RisingCloses = LLV( Close, 5) > Ref( HHV( Close, 20), -20);
PMA = MA( Close, 30);
NotBelowPullbackMA = Sum( Close < PMA, 30) == 0;
CloseToPullbackMA = ( Close - PMA ) < 0.015* Close;
// setup conditions for next day buy stop order
Setup = RisingCloses AND NotBelowPullbackMA AND
CloseToPullbackMA;
TriggerPrice = Ref( High, -1);
// buy only if stock opens higher than yesterdays high
Buy = Ref( Setup, -1) AND High > TriggerPrice;
BuyPrice = Max( Open, TriggerPrice );
Sell = False; // sell only via N-bar stop
// time-based stop (for backtesting)
ApplyStop( stopTypeNBar, stopModeBars, 5);
SetTradeDelays( 0, 0, 0, 0);
// no more than 3 simultaneous positions open
SetOption("MaxOpenPositions", 3);
PositionSize = -33; // 3% of capital in single security

_SECTION_BEGIN("Price1");
SetChartOptions(0,chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); 
_SECTION_END();
 

Similar threads