I feel stupid!! I can not find out how to get the current profit of an open position. tried lots of things like if (OrderSelect(ticket) Print("Profit = ", Profit());
but compiler says Profit function not defined although its in the documentation.
Help Please
There can be no profit on an Order only on a Position.
Why don't you use PositionGetDouble() with POSITION_PROFIT ?
Perhaps you should be using Select() rather than OrderSelect() ?
There can be no profit on an Order only on a Position.
Why don't you use PositionGetDouble() with POSITION_PROFIT ?
Perhaps you should be using Select() rather than OrderSelect() ?
There you go knew I was stupid lol! thanks
There you go knew I was stupid lol! thanks
That's from standard library.
Use MQL5 function PositionSelect and then PositionGetDouble with POSITION_PROFIT identifier.
Not stupid at all, I now know the difference between Select() and OrderSelect() in mql5, thanks for helping me learn :-)
Thanks again
That's from standard library.
Use MQL5 function PositionSelect and then PositionGetDouble with POSITION_PROFIT identifier.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I feel stupid!! I can not find out how to get the current profit of an open position. tried lots of things like if (OrderSelect(ticket) Print("Profit = ", Profit());
but compiler says Profit function not defined although its in the documentation.
Help Please