have not thoroughly investigated this, but if your using mq5 build 4463 and having trouble with onclick function, you might try 4468 build.....
the exact same code will run perfectly on 4468 but not run correctly on 4463.......
by correctly i mean, on build 4463 , the ea will place trades but the close and close all buttons will not work.....
i have spent several hours trying to figure out the problem..... gave up....
bottom line, 4468......h
//------
//------
//-----
the exact same code will run perfectly on 4468 but not run correctly on 4463.......
by correctly i mean, on build 4463 , the ea will place trades but the close and close all buttons will not work.....
i have spent several hours trying to figure out the problem..... gave up....
bottom line, 4468......h
//------
//------
MQL5:
void closing() { for(int i=PositionsTotal()-1; i>=0; i--) { ulong ticket = PositionGetTicket(i); if(PositionGetSymbol(i) != _Symbol) continue; if(PositionGetSymbol(i) == _Symbol) { trade.PositionClose(ticket); } } } void closingall() { for(int i=PositionsTotal()-1; i>=0; i--) { ulong ticket = PositionGetTicket(i); trade.PositionClose(ticket); } }
//-----
Last edited by a moderator: