CPositionInfo not returning information

 

Hi All,


I am trying to use the CPositionInfo object to return information on an open position. However, it does not return the expected values.


Here is the relevant code:

//declaration
class CSampleExpert
        public:
        CPositionInfo     m_position;

//buy statement
if(m_trade.PositionOpen(Symbol(),ORDER_TYPE_BUY,InpLots,price,fsl,tp))                
        printf("Long Position opened: ticket: %s, price: %f, sl: %f, tp: %f" ,Symbol(), m_position.PriceOpen(), m_position.StopLoss(), m_position.TakeProfit());

Here is the result:

Print


Any ideas?


Regards,

Muhammad Khan

 
Muhammad Khan:
...

Any ideas?

Maybe read the documentation of CPositionInfo ?
Reason: