Topic: MQL5 Last Deal Price

Hello sir,

i wants to know that how can i get {last deal price} and {last deal volume} of  particular symbol without using loop in MQL5

thanks in advance

Re: MQL5 Last Deal Price

You can use the following code to print the current position:

  if ( PositionSelect(_Symbol) ) {
      datetime time   = (datetime)PositionGetInteger(POSITION_TIME);
      double   price  = PositionGetDouble(POSITION_PRICE_OPEN);
      double   amount = PositionGetDouble(POSITION_VOLUME);
      Print("Time:", TimeToString(time), ", Price: ", DoubleToString(price),", Volume: ", DoubleToString(amount));