It does not close all open positions New comment Giorgio 2019.04.24 17:43 this code works when I use [OHCL 1 minute] in the strategy tester, but when I use [every tick] it stops working and some positions remain open for ( int conta= PositionsTotal ()- 1 ; conta>= 0 ; conta--) { string symbol= PositionGetSymbol (conta); ulong PositionTicket=( ENUM_POSITION_PROPERTY_INTEGER ) PositionGetInteger ( POSITION_TICKET ); ulong magic= PositionGetInteger ( POSITION_MAGIC ); if ( Symbol ()==symbol && magic==EA_MagicNumber) trade.PositionClose(PositionTicket, NULL ); } if anyone can help me I'd be grateful :) My function to close all positions does not work properly EA is working perfectly on Strategy Tester(Every tick based on real ticks) but does not work properly while using it on a demo account. My script does not open positions in real trades in mql5 New comment
if anyone can help me I'd be grateful :)