Forum

code for getting the loss of a long or short open position?

double PositionProfit = PositionGetDouble ( POSITION_PROFIT ); //is get profit What is the equivelent of POSITION_LOSS for mlq5

after the stop loss is set to value other than zero the bot does not buy and sell

stoploss = ((LastSARValue1 - LastSARValue) / 4 ) + PriceArray[ 0 ].low; myrequest.type = ORDER_TYPE_BUY ; myrequest.action = TRADE_ACTION_DEAL ; myrequest.sl = 0 ; myrequest.tp = stoploss; myrequest.symbol = _Symbol ; myrequest.volume = 0.1 ;