Simple question - How to run a condition only once on startup of an EA?
-
Simple question - How to run a condition only once on startup of an EA?
I would basically like a condition met once before it's starts trading. It's to make the EA wait as to not have it initiate trades mid trends after it's started up.
Much appreciated. -
@johann-0 the way to limit that is by using once per bar. try relocating the once per bar under the condition

-
@vonmunchy Thanks for your help, I will give it a go.
-
@vonmunchy adding run once per bar underneath the condition still continuously run it unfortunately.
-
@johann-0 than i guess you need limit it using a variable. at the start of the of the day give it something like a value of 0. If trade adjust the value and set to default at start of new day
-
@johann-0 The most efficient way to execute anything just once and before anything else is by using the 'on init' tab. Put that condition there and it will be executed just once and never again as soon as the EA is hovered on the chart.
-
@l-andorrà Thank you. Will give it a go. So much still to learn.
-
@vonmunchy What I've done as a temporary fix was use set blocks on and off so it runs once then disables the conditions after. Will give @l-andorrà 's advice a go. Thnx for your help btw.
-
@johann-0 You're welcome.