loop MA close
-
Hi, I am working on a project that if Candle 1 close < MA20, then loops check Candles 2-21 close>MA20. if so, a buy position will be open. I don't know what's wrong that it does not open positions. probably I need to do something that I don't understand. here is the shared link. your help is appreciated.
https://fxdreema.com/shared/X3NjLSbjc -
Without looking too deep into this, conditions on top of conditions rely on all being true at the same time, once per bar above conditions relies on all conditions being true at the moment of the 1st tick of the bar. All in all, this limits how things can work, test a couple of situations until you know they work, then add them all together.
-
@jstap I have tried many combinations and the conditions are not many I suppose. I had EAs working with many more conditions and doing perfectly fine. I guess I'm doing something wrong with the 'Loop' block but I can't figure it out. that could be a lot to ask but I appreciate if you have a chance to look at it a bit more for any guidance.
thanks -
Split things so the loop is separate and put the variables in a comment, then check you are getting the correct result, then you can add things back together. It looks like it's nearly there, so a couple of tests will find the problem.
-
@jstap sure, I will do that. it's a good idea. thank you so much