|
How do I code an EA to enter a trade at the open of a new candle?
Hi everyone,
Please forgive my ignorance, but I am new to the programming side of MQL4.
What I am trying to accomplish is enter one trade at the open of a new candle.
For example, if I had a 30min chart open, I would like to enter one trade at the open. Or if I had a 4hour chart open, how would I enter the trade at the open of that chart?
Also, I would like to enter only 1 trade at the open. I have tried a few commands and found it either entering the trade many times during the first minute, or not at all.
I have tried the "time current" function as well as "if minute = XXXX". The EA works when I backtest it, but when I try to put it on my live demo, it only works once in a while.
Any input would be greatly appreciated.
Thanks in advance.
|