How to set consecutive conditions
-
Hello, i am currently on a fxdreema project and as i understood conditions in a same line must be verified simultaneously to be satisfied, i was looking for a way to make consecutive conditions. That would allow me to do something like : if candle X top crosses the level Z, and the next candle (X+1) is a bearish then ..
-
@seb-0 there are several ways to do that such as setting and checking flags or turn on/off blocks.
If the order is pretty clear you may still use a single line and start with the most recent action or with the strictest one.
So if your condition is a) X crosses y and b) 2 next candle has to be something, you'd start with b) and in the line check a) afterwards.Always think from the point in time the EA is at current.
-
I see, so it would be something like : a) If 2 candles crossed the level Z upward, with an exception of one (one is enough) b) If the candle is bearish then.. i could sell now for exemple
Im still gonna have a look to flag blocs, and ON/OFF blocs, it could be helpful if i need to add more conditions. -
If you share your project we can give you a more detailed answer.
-
I deleted my project, but i found that i could determine what candle is taken in count as a condition with the Candle ID parameter : Current candle = Candle ID 0, the previous one = Candle ID 1 etc