Recently I started using a close algorithm that looks something like this:
I noticed that MT4 waits until the chart bar close to compute the values and execute the close when the parameters are hit. I have this on a 1 min chart and although in real time the equity flies past the account balance, the position does not close until the end of the bar. Note that there is no Close[1] or iClose used here. I'm simply comparing live equity vs. balance.
My question: Is there a way to have MT4 execute the close in real time up to the second after the parameter is triggered? Or is this a "flaw" in MT4 order close execution.
Btw, the ea is not really a scalping trader but since equity values can swing by several dollars anytime within a minute, it's very disappointing that it doesn't close immediately.
Is there a way around this?
Inserted Code
if ( ((OrderMagicNumber() > 0) || (OrderMagicNumber() == NULL)) && (AccountEquity() > AccountBalance()*Profit)) { CloseOut(); }
I noticed that MT4 waits until the chart bar close to compute the values and execute the close when the parameters are hit. I have this on a 1 min chart and although in real time the equity flies past the account balance, the position does not close until the end of the bar. Note that there is no Close[1] or iClose used here. I'm simply comparing live equity vs. balance.
My question: Is there a way to have MT4 execute the close in real time up to the second after the parameter is triggered? Or is this a "flaw" in MT4 order close execution.
Btw, the ea is not really a scalping trader but since equity values can swing by several dollars anytime within a minute, it's very disappointing that it doesn't close immediately.
Is there a way around this?