A crossover. That's a part of the problem. But not even really needed.
The 1st buy will indeed be when a price crosses above the MA. (if a gap is also seen as a crossover)
But opening above the MA is also a buy.
But there will be only 1 buy per day. Bouncing prices could trigger a buy 10 times a day.
So simply put I want the following:
If price>MA AND First_Trade_of_the_day = TRUE THEN buy.
Other question.
Am I allowed to ask a ton of coding questions on this board?
Or is it more for exchanging trading ideas.
If yes then maybe a seperate forum could keep other sections less poluted.
I need get some help to get started with the MT4 code.
ATM it's a bit over my head. MT4 is spaghetti code. I'm more the type of person that splits things up in subrountines.