[description = This BUY/SELL strategy ENTERS on a NEW HIGH (5 period default, user selectable) and also 3 on 12 EMA. EXIT is when there is a confirmed close below 1.3 (user selectable) x ATR. This quick version of the indicator displays the following information: Entry and exits - UP & DOWN arrows Right pointing arrow at last bar if we in a continuing trade Orange line is rising stop (1.3 x ATR) - can be adjusted EXIT needs two closes below the rising stop, with the second lower than the first ADVICE - BUY, SELL, HOLD, STAY OUT determined by strategy.; author=Bleakley, Des;target=price;] printposn := input("Print Position ", 9, 1, 20); lookback := input(" Lookback Period ", 5, 1, 100); startdate := inputdate("Start Analysis From ",date(2013,1,1) ); red_atrnum := input("Exit ATR factor ", 1.3, 0.1, 10); red_ATR := C-red_atrnum*ATR(21); earlybar := barnumber < 30 OR startdate > now; lastbar := barnumber=lastvalue(barnumber); printposition:= CLOSE; [color=orange]; { **** ENTRY CONDITIONS **** } highpoint := HHV( CLOSE, lookback ); entercondition := (CLOSE >= highpoint) AND (ma(C,3,E) > ma(C,12,E)) ; ts := if( earlybar, -CLOSE, if( close < prev AND hist(close,1) < prev AND close0 AND entercondition, max( red_ATR, prev), { IN and enter condition } if( prev<0 AND entercondition, red_ATR, { NOT INMKT & enter condition } if( prev>0 ,max(red_ATR,prev), prev))))); { No enter or exit } exitcondition := close < hist(ts,1) AND hist(close,1) < hist(ts,1) AND close0; { **** DECIDE & DISPLAY RECOMMENDATION ***** } bars_buy_ago := if (entercondition AND NOT hist(INMKT,1), 0, barssince(buysignal)); ss_buy := if(bars_buy_ago = 0 AND INMKT," BUY NOW &", if(bars_buy_ago<6 AND INMKT, " BUY "+bars_buy_ago+" &","")); ss_sell := if( exitcondition AND hist(INMKT,1), " SELL &",""); ss_wait := if( NOT INMKT OR sellsignal, " STAY OUT", ""); ss_hold := if (( INMKT{ exitcondition}) OR (hist(INMKT,1) AND CLOSE >=abs(hist(ts,1))), " HOLD", ""); ss_watch := if( hist(INMKT,1) AND CLOSE