Function PositionGet does not deliver any data

 

Hi there,


I'm struggling with using data of an open position in my EA.

To make it more simple to analyse, I've opened manually a buy position and created a single line script with the following content:

Print((string)PositionGetDouble(POSITION_PRICE_OPEN));

When I drop this script to the chart, the result is always 0.0. I cannot access to any other values of the PositionGet function. Other functions like AccountInfo do work, so in general it should work as well.

Any idea why this doesn't work?


Thanks a lot 

Ben

 
al_ben :

Read the help: PositionGetDouble

The function returns the requested property of an open position, pre-selected using PositionGetSymbol or PositionSelect. 
Documentation on MQL5: Trade Functions / PositionGetDouble
Documentation on MQL5: Trade Functions / PositionGetDouble
  • www.mql5.com
PositionGetDouble - Trade Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Vladimir Karputov #:

Read the help: PositionGetDouble

The function returns the requested property of an open position, pre-selected using PositionGetSymbol or PositionSelect. 

Thanks man, that worked :-)