Download MetaTrader 5

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

To add comments, please log in or register
No time to learn MQL5? Order your application from a developer!
Tiago Cetto Pietralonga
458
Tiago Cetto Pietralonga 2016.07.26 05:30 

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 

Marco vd Heijden
Moderator
4704
Marco vd Heijden 2016.07.26 06:38  
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.

Tiago Cetto Pietralonga
458
Tiago Cetto Pietralonga 2016.07.26 07:18  
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)
Marco vd Heijden
Moderator
4704
Marco vd Heijden 2016.07.26 08:02  
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
Tiago Cetto Pietralonga
458
Tiago Cetto Pietralonga 2016.07.26 16:06  
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);  

     

     

  } 

Sergey Golubev
Moderator
93709
Sergey Golubev 2016.07.26 16:25  
Marco vd Heijden
Moderator
4704
Marco vd Heijden 2016.07.26 16:33  
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.
To add comments, please log in or register