yuv98:
Look at thisHello,
Im trying to get my last deal profit, that means that if I lose I get a negative number and if I win I get positive number.
I wrote the simple code:
but all I get is 0.0, always.
When I use:
It does return true, but doubleVariable equals 0.0.
what am I doing wrong?
Thanks.
https://www.mql5.com/en/docs/trading/historyselect
Only thing I would change is counting down the deals (in case you are making changes).
strategy_tester:
Look at this
Look at this
https://www.mql5.com/en/docs/trading/historyselect
Only thing I would change is counting down the deals (in case you are making changes).
I changed the "HistorySelect" to:
HistorySelect(0,TimeCurrent());
Insted of
HistorySelectByPosition(last position ticket);
and it did work. when I check a deal that closed a position it showed me the profit.
Thank you!

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
Hello,
Im trying to get my last deal profit, that means that if I lose I get a negative number and if I win I get positive number.
I wrote the simple code:
but all I get is 0.0, always.
When I use:
It does return true, but doubleVariable equals 0.0.
what am I doing wrong?
Thanks.