How to Close in Loss?? New comment Scalper8 2022.09.22 09:29 I would like to close in a loss but unfortunately it does not close at all with the code below. for(int Loop=PositionsTotal()-1;Loop>=0;Loop--) { if(m_position.SelectByIndex(Loop)) if(m_position.Symbol()==Symbol()) { double ProfitPips=PositionGetDouble(POSITION_VOLUME)*20; int Loss=-2; double Profit2=PositionGetDouble(POSITION_PROFIT); int Type=m_position.PositionType(); switch(Type) { case POSITION_TYPE_BUY:if(m_position.Profit()<=Loss)trade.PositionClose(m_position.Ticket()); //POSITION_TYPE_BUY case POSITION_TYPE_SELL:if(m_position.Profit()<=Loss)trade.PositionClose(m_position.Ticket()); //POSITION_TYPE_SELL } } } New comment
I would like to close in a loss but unfortunately it does not close at all with the code below.