Issue with a counter CCI last 5 candles below level
-
Hi Guys,
I am new here, i am creating a bot that needs to have two counters (5 candles before) and not sure how can i achieve this? I have managed to get first one done but the second once got stuck.What i am trying to do:
- Price was above 3 MAs (for 5 candles)
- Price inside the MA Wave
- CCI below +100 (5 candles) = this is where i am stuck now...
- CCI above +100
https://fxdreema.com/shared/10hgQ918c
i have tried creating 5 different blocks but it did not worked and created a counter but then realised that the counter will not work because of my previous counter because i am on once per bar.
I want it once per bar because of optimization - as this is the fastest way "I think"

Please let me know if there is a way how to go around this as i have been stuck on this
Thank you
-
Hi!
The method with 5 different blocks should work just fine, although a looped solution would be my choice as it would allow to select any number of candles.
How can you know it doesnt work? Try chopping your strategy to different pieces and test each one alone. The draw line -block is great for troubleshooting with visual backtesting.Why the green counter blocks? Have you tried without them?
-
Thank you - i will look into loop as i wanted to have an option to select how many clandles to pass.
I have been doing this section by section and at this point it does not have trades.
I will look into draw line block too - need to see how it works
let me know if you see anything else that i am missing here...
thanks -
This is how I'd loop it. There is a dedicated loop block in the builder, too, but it is not necessary. You have to be careful though, if the loop never ends you will get a stack overflow error.

https://fxdreema.com/shared/h2FzCXa3bNow that I think of it, this would probably most easily be done with the "indicator moves within limits" block, lol
-
let me try and will update you
-
Hi i tried but for some reason i cannot make any trades and now cannot even optimize the bot - let me know if i am not getting something...
https://fxdreema.com/shared/cNFq9ktPd
thank you
-
Hi, i have managed to make it work with this - at least it makes trades - now need to test it and see if it does what i want
thanks you