How do I stop repeat signals
Forums › ProRealTime English forum › ProBuilder support › How do I stop repeat signals
- This topic has 12 replies, 3 voices, and was last updated 7 years ago by margincallcat.
-
-
06/29/2017 at 4:42 PM #3942306/29/2017 at 6:33 PM #3943606/30/2017 at 9:17 AM #3946606/30/2017 at 4:21 PM #3951710/30/2017 at 5:56 PM #50953
I bump this thread since i want the same thing. For this current easy command i dont want it to give repeated signals when Lower Low and Lower Close repeats.
12345678910111213141516171819202122232425262728//defparam CALCULATEONLASTBARS=20if on=1 thenstoch=Stochastic[12,3](close)ema=average[10,1](close)//ll=low[1]<low[2]lc=close[1]<close[2]if ll and lc and stoch[2]>80 and close[2]>ema thendrawtext("LL LC",barindex[1],high[1]+range[1],SansSerif,standard,12)coloured(255,50,50)drawarrowdown(barindex[1],high[1])endif//hh=high[1]>high[2]//hc=close[1]>close[2]//hc2=high>high[1]////if hh and hc and hc2 then//drawtext("HH HC",barindex[1],low[1]-range[1],SansSerif,standard,12)coloured(50,255,50)//drawarrowup(barindex[1],low[1])//endifendifreturnThankful for help!
//Viktor
10/30/2017 at 6:02 PM #50955I tried this
12345678910111213141516171819202122232425262728293031//defparam CALCULATEONLASTBARS=20if on=1 thenstoch=Stochastic[12,3](close)ema=average[10,1](close)//ll=low[1]<low[2]lc=close[1]<close[2]if signal=0 and ll and lc and stoch[2]>80 and close[2]>ema thendrawtext("LL LC",barindex[1],high[1]+range[1],SansSerif,standard,12)coloured(255,50,50)drawarrowdown(barindex[1],high[1])signal=1elsesignal=0endif//hh=high[1]>high[2]//hc=close[1]>close[2]//hc2=high>high[1]////if hh and hc and hc2 then//drawtext("HH HC",barindex[1],low[1]-range[1],SansSerif,standard,12)coloured(50,255,50)//drawarrowup(barindex[1],low[1])//endifendifreturnand it gets rid of one repetition. How do i keep it/determine length?
10/30/2017 at 6:24 PM #50956i did this now and it works OK but if anyone has a better suggestion i all ears 🙂
12345678910111213141516171819202122232425262728293031//defparam CALCULATEONLASTBARS=20if on=1 thenstoch=Stochastic[12,3](close)ema=average[10,1](close)atr=AverageTrueRange[10](close)//ll=low[1]<low[2]lc=close[1]<close[2]if signal=0 and signal[1]=0 and signal[2]=0 and signal[3]=0 and ll and lc and stoch[2]>80 and close[2]>ema thendrawtext("LL LC",barindex[1],high[1]+atr,SansSerif,standard,12)coloured(255,50,50)drawarrowdown(barindex[1],high[1])signal=1elsesignal=0endif//hh=high[1]>high[2]//hc=close[1]>close[2]//hc2=high>high[1]////if hh and hc and hc2 then//drawtext("HH HC",barindex[1],low[1]-range[1],SansSerif,standard,12)coloured(50,255,50)//drawarrowup(barindex[1],low[1])//endifendifreturn10/31/2017 at 11:22 AM #51046You could have saved the barindex of the first signal and then test if enough bars have passed since then to give a new signal.
Or store the first signal price into a variable and test if the new signal is different from the last saved one.
10/31/2017 at 11:40 AM #51050You mentioned that in your first reply above, but i dont know how to do that. Can you please provide a code example?
Thanks
11/02/2017 at 10:36 AM #5126911/02/2017 at 11:16 AM #51280Sorry @lebrinque, but sometimes between 2 topics, I take some rest 🙂 It was days off yesterday in France also!
This is the amended code:
1234567891011121314stoch=Stochastic[12,3](close)ema=average[10,1](close)atr=AverageTrueRange[10](close)//ll=low[1]<low[2]lc=close[1]<close[2]if ll and lc and stoch[2]>80 and close[2]>ema and barindex-lastsignal>2 thendrawtext("LL LC",barindex[1],high[1]+atr,SansSerif,standard,12)coloured(255,50,50)drawarrowdown(barindex[1],high[1])lastsignal=barindex[1]endifreturn‘lastsignal’ variable is your new friend, take care of him 🙂
1 user thanked author for this post.
11/02/2017 at 11:17 AM #5128211/02/2017 at 12:09 PM #51296Also @nicolas the other topic i created “Command depending on prior command” as a spinoff from this one – hope it was OK to create a new thread for that.
-
AuthorPosts
Find exclusive trading pro-tools on