Mind problem ;-)
Can you eplain it a bit more?
Can you eplain it a bit more?
Please read the documentation before posting.
To ensure receipt of fresh data about a position, it is recommended to call PositionSelect() right before referring to them.
- www.mql5.com
Please read the documentation before posting.
sorry you are wrong,
double lastLot(const string sym,const int magic) //aller offenen Positionenauf diesem Symbol und dieser MN { double LastLot=0; if(PositionsTotal()>0) { for(int i=0; i<PositionsTotal(); i++) { PositionSelect(_Symbol); if(PositionGetString(POSITION_SYMBOL)== sym && PositionGetInteger(POSITION_MAGIC)== magic ) { LastLot=0; LastLot=PositionGetDouble(POSITION_VOLUME); } } } Print(LastLot); return(LastLot); }
even with position select MT5 calculate wrong
sorry you are wrong,
even with position select MT5 calculate wrong
You have the "mind problem." Perhaps you should read the manual.
For the "netting" interpretation of positions only one position can exist for a symbol at any moment of time.
If individual positions are allowed ... In this case, PositionSelect will select a position with the lowest ticket.
Trade Functions / PositionSelect - Reference on algorithmic/automated trading language for MetaTrader 5
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
i Use MT5 with Hedging mode and i want to know, the last open position volume
this works fine, as long i have only 1 open position
as soon i have 2 open position, it will be used the Volume for Position 1 and Position 2
LastLot = Volume1 + Volume2
i geht the last ticket number in the same way, so is this an bug from MT5 or does i have a mind problem
amando