MetaStock -> Tools -> Indicator Builder -> New -> copy & paste complete formulae below. ================================== Drop/Bounce - Volatility - signals ================================== ---8<------------------------------------ { ATR volatility Drop/Bounce signals v2.0 Do not trade without adequate exits and capital protection! ©Copyright 2006 Jose Silva. The grant of this license is for personal use only - no resale or repackaging allowed. All code remains the property of Jose Silva. http://www.metastocktools.com } { User inputs } multi1:=Input("Long initial drop ATR multiplier",0,20,4); multi2:=Input("Long subsequent bounce ATR multiplier",.0001,10,.2); multi3:=Input("Short initial drop ATR multiplier",0,20,5); multi4:=Input("Short subsequent bounce ATR multiplier",.0001,10,.1); plot:=Input("Signals: [1]Clean, [2]All, [3]Trade binary",1,3,1); delay:=Input("Entry and Exit signals delay",0,5,0); pds1:=21; { ATR periods } pds2:=21; { HHV/LLV periods } { *** Long section *** } { Hi/Lo drop/rise thresholds } hiDrop:=HHV(H,pds2) -ValueWhen(1,H=HHV(H,pds2),ATR(pds1))*multi1; loRise:=LLV(L,pds2) +ValueWhen(1,L=LLV(L,pds2),ATR(pds1))*multi2; { Setup - drop from high } setup:=CloDrop; { Bounce - drop from high } bounce:=Cross(hiRise,C); { Signal Short } exit:=setup AND bounce; { Clean signals } bin:=ValueWhen(1,entry-exit<>0 OR (Cum(IsDefined(entry+exit))=1),entry); long:=bin*(Alert(bin=0,2) OR entry*Cum(entry)=1); short:=(bin=0)*(Alert(bin,2) OR exit*Cum(exit)=1); { Plot in own window } 0; Ref(If(plot=2,entry,0),-delay); Ref(If(plot=1,long-short, If(plot=2,-exit,bin)),-delay) ---8<------------------------------------ The ATR-based signals indicator above is similar to the original % drop/rise method below. Smallish ATR rise parameters were chosen to try and capitalize on early gains in the price bounce. The (Long with Short exits) signals seem to be profitable when backtested on the ASX All Ords stocks over the past 5 years, albeit with the occasional large drawdown. It is left up to the user to add suitable exit signals. ========================= Drop/Bounce - % - signals ========================= ---8<------------------------------------ { Hi/Lo % Drop/Bounce signals v2.0 Do not trade without adequate exits and capital protection! ©Copyright 2006 Jose Silva. The grant of this license is for personal use only - no resale or repackaging allowed. All code remains the property of Jose Silva. http://www.metastocktools.com } { User inputs } per1:=Input("% initial drop",0,100,10)/100; per2:=Input("% subsequent bounce", .0001,100,5)/100; bounce:=Input("Bounce: [1]LLV/HHV(pds), [2]Low/High since setup",1,2,1); pds:=Input("HHV/LLV lookback periods",1,252,50); plot:=Input("Signals: [1]Clean, [2]All, [3]Trade binary",1,3,1); delay:=Input("Entry and Exit signals delay",0,5,0); { *** Long section *** } { Hi/Lo drop/rise thresholds } hiDrop:=HHV(H,pds)*(1-per1); loRise1:=LLV(L,pds)*(1+per2); loRise2:= LowestSince(1,Cross(hiDrop,C),L)*(1+per2); loRise:=If(bounce=1,loRise1,loRise2); { Setup - drop from high } setup:=CloDrop; { Bounce - drop from high } bounce:=Cross(hiRise,C); { Signal Short } exit:=setup AND bounce; { Clean signals } bin:=ValueWhen(1,entry-exit<>0 OR (Cum(IsDefined(entry+exit))=1),entry); long:=bin*(Alert(bin=0,2) OR entry*Cum(entry)=1); short:=(bin=0)*(Alert(bin,2) OR exit*Cum(exit)=1); { Plot in own window } 0; Ref(If(plot=2,entry,0),-delay); Ref(If(plot=1,long-short, If(plot=2,-exit,bin)),-delay) ---8<------------------------------------ http://www.metastocktools.com