OMG ... PositionType() ! I don't know why Type() just did not show any error and just compiled, while Type() not a valid CPositionInfo funct ... I completely forgot it had to be PositionType and as no error for Type() I got impression it is same and OK ...

Documentation on MQL5: Standard Library / Trade Classes / CPositionInfo
- www.mql5.com
CPositionInfo is a class for easy access to the open position properties. CPositionInfo class provides easy access to the open position properties...
geost77 #: OMG ... PositionType() ! I don't know why Type() just did not show any error and just compiled, while Type() not a valid CPositionInfo funct ... I completely forgot it had to be PositionType and as no error for Type() I got impression it is same and OK ...
Type() is NOT an error. It is valid for CPosition because it inherits it from the CObject class. It does however, have a different functionality.

Documentation on MQL5: Standard Library / Basic Class CObject / Type
- www.mql5.com
Gets the type identifier. Return Value Type identifier (for CObject - 0). Example...

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I have strange issue. I have this code:
when i call myFunct() it print test data and all data is correct for my position (PriceOpen, Ticket, Time, Symbol, Magic, etc ...). Except Type() ... it just always return 0/POSITION_TYPE_BUY, even I see position opened is a Sell in my Strategy Tester.
Returns like:
I don't know if this happen only in Tester, as I have no opened positions at my account and it is Saturday, so can't really open any to test EA there, but at Tester EA pos.Type() just keep return 0 even when I open only sell ...
Anyone ever had that strange issue? Ideas ?