forex software

Create and Test Forex Strategies

forex software

Skip to forum content

Forex Forum

Forex Software, Forex Strategies, Expert Advisors Generator

You are not logged in. Please login or register.


Forex Forum → General Users Forum → MQL5 Last Deal Price

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 2

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
Regards
Shailesh

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));  
  }

Posts: 2

Pages 1

You must login or register to post a reply

Forex Forum → General Users Forum → MQL5 Last Deal Price

Similar topics in this forum