How I can get value of price (op_buy with lot 0.01 - have only a op_buy with 0.01)? // Symbol()

 

How I can get value of price (op_buy with lot 0.01 - have only a op_buy with 0.01)?

 

Note: symbol()

 

Thank you 

 
Tiago Cetto Pietralonga:

How I can get value of price (op_buy with lot 0.01 - have only a op_buy with 0.01)?

 

Note: symbol()

 

Thank you 

Ask Price?

Bid Price?

Order Open Price?

Order Close Price?

Profit?

Loss?

What price.

 
Marco vd Heijden:

Ask Price?

Bid Price?

Order Open Price?

Order Close Price?

Profit?

Loss?

What price.

sorry, order open price (the order is open)
 
Tiago Cetto Pietralonga:
sorry, order open price (the order is open)


For the function PositionGetDouble()

ENUM_POSITION_PROPERTY_DOUBLE

Identifier

Description

Type

POSITION_VOLUME

Position volume

double

POSITION_PRICE_OPEN

Position open price

double

POSITION_SL

Stop Loss level of opened position

double

POSITION_TP

Take Profit level of opened position

double

POSITION_PRICE_CURRENT

Current price of the position symbol

double

POSITION_SWAP

Cumulative swap

double

POSITION_PROFIT

Current profit

double


https://www.mql5.com/en/docs/trading/positiongetdouble

pre-selected using PositionGetSymbol or PositionSelect.

Documentation on MQL5: Trade Functions / PositionGetDouble
Documentation on MQL5: Trade Functions / PositionGetDouble
  • www.mql5.com
Trade Functions / PositionGetDouble - Reference on algorithmic/automated trading language for MetaTrader 5
 
Marco vd Heijden:


For the function PositionGetDouble()

ENUM_POSITION_PROPERTY_DOUBLE

Identifier

Description

Type

POSITION_VOLUME

Position volume

double

POSITION_PRICE_OPEN

Position open price

double

POSITION_SL

Stop Loss level of opened position

double

POSITION_TP

Take Profit level of opened position

double

POSITION_PRICE_CURRENT

Current price of the position symbol

double

POSITION_SWAP

Cumulative swap

double

POSITION_PROFIT

Current profit

double


 

https://www.mql5.com/en/docs/trading/positiongetdouble

pre-selected using PositionGetSymbol or PositionSelect.

 

 

I used OrderOpenPrice();

It's is working.

 

But, thank you 

 

 

void OnStart()

  {

  

 double lots_total=9999; 

 double precoinicial=0;

 for(int i=0;i<OrdersTotal();i++)

     {

     

      if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==true)

        {

         //if(OrderMagicNumber()==MagicNumber)

           {

            //if(OrderSymbol()==Symbol())

              {

              // if(OrderSymbol()!=Symbol()) continue;

              if(OrderSymbol()!=Symbol()) continue; 

              

              if(OrderLots()<lots_total){

              lots_total=OrderLots();

              precoinicial=OrderOpenPrice();

              

              

              

              

              }

                   

               

              }

           }

        }

     }

     

     

     

     

     

     

 Alert("lots:",lots_total);

 Alert("precoinicial",precoinicial);

 Sleep(20000);  

     

     

  } 

 
Tiago Cetto Pietralonga:

I used OrderOpenPrice();

It's is working.

So next time you also note if your question is about MQL4 or about MQL5.
Reason: