if (m_positionInfo.Select(_Symbol)) { if (m_positionInfo.PositionType() == POSITION_TYPE_BUY) // <- Returns true { long deal_ticket=m_trade.ResultOrder(); // <- Returns ticket number if(PositionSelect(_Symbol)) // <- Returns true printf("Ticket: %i, Instrument = %s, Profit=%d", deal_ticket, m_positionInfo.Symbol(),m_positionInfo.Profit()); // Returns "2", "USDEUR", 823253212. } else if (m_positionInfo.PositionType() == POSITION_TYPE_SELL) { printf("Short Positon"); } }
This is so strange, why wont it return the profit as it should? What im i missing?
I have search for information about the CPositionInfo but there is not much. Anyone can help me? im kind a stuck...
dudknoen:
printf("Ticket: %i, Instrument = %s, Profit=%f", deal_ticket, m_positionInfo.Symbol(),m_positionInfo.Profit());
Hi
Im trying to make an EA, but some how i cant get the CPositionInfo class to work. I have also tried to use the GetPositionXXX functions but with no luck.
When i call int t = PositionsTotal(); It returns 1. PositionSelect(_Symbol) returns true. But it is impossible to get the information back. Im i missing something obvious here?
Any ideas?