How to check entry conditions multiple times
-
Hello, I am very new to forex trading and creating EAs. I wanted to know how or if it's possible to check for entry and exit conditions multiple times before opening/closing a position. For example, if I wanted to enter when a Moving Average 7 is above a Moving Average 13 and I wanted my EA to check for those conditions every 15 seconds for 1 minute how would I do that? I would want something along the lines of this passing "X" times before opening a position, and, reseting if it fails and timed check. Any assistance will be very much appreciated.
Thank you
-
When creating EA, the main part of it's content is executed on every tick. That's why it is EA - somethings that monitors changes and takes actions when needed.
You can see 5 buttons above the main workfield and one of them says "on Tick" and it's normally active. What you place in this workfield will be executed again and again when a new tick comes. -
Ok, I understand it goes through it's cycle every tick, but, is there a way to loop part of the ea (conditions for entry/exit) more than once before it makes a trade. I understand running every tick indicators may cross for a few seconds due to volatility, that is why i would like to run the conditions a few times before it places a trade.
-
Indicators also changes because of ticks. Everything changes only because of ticks, so there is no need to repeat something when there are no ticks. If you repeat some conditions 10 times between two ticks, the results will be the same, because indicators depends on ticks.
If you want to repeat something say 10 times within a tick, find a block named "Free loop...". There is also one named "Sleep". But I can't find any reason to do this