Download MetaTrader 5

PositionGetDouble(POSITION_PRICE_CURRENT) and SymbolInfoTick(targetSymbol,lastTick);

To add comments, please log in or register
Do you have a trading signal? Publish it in your blog as well!
nicolasxu
296
nicolasxu 2014.10.03 08:09 

If I had a position on "EURUSD", there are 2 ways to get current price. 

1) PositionSelect("EURUSE")

    then call PositionGetDouble(POSITION_PRICE_CURRENT)

2)   SymbolInfoTick("EURUSD",lastTick);

 

My question is what is the difference? Which one I should use?

Alain Verleyen
Moderator
30707
Alain Verleyen 2014.10.03 10:51  
nicolasxu:

If I had a position on "EURUSD", there are 2 ways to get current price. 

1) PositionSelect("EURUSE")

    then call PositionGetDouble(POSITION_PRICE_CURRENT)

2)   SymbolInfoTick("EURUSD",lastTick);

 

My question is what is the difference? Which one I should use?

POSITION_PRICE_CURRENT give you directly the right price (Bid or Ask) depending if your position is BUY or SELL.
nicolasxu
296
nicolasxu 2014.10.03 13:34  
angevoyageur:
POSITION_PRICE_CURRENT give you directly the right price (Bid or Ask) depending if your position is BUY or SELL.
I see. Thank you!
To add comments, please log in or register