Hi,
I found a lot of code for consecutive loss but not works. Also I try only to get all from history trades. Always I got 0. What code I need to get all losses?
use the search feature of this website.
You need to do HistorySelect first of all, then you should cycle DEALS, considering only DEAL_ENTRY_OUT backwards from the last one.
Surely there are planty of examples into the codebase.
Be aware that if you just need the maximum consecutive losses after a backtest, you can simply use the TesterStatistic, you don't need to calculate it manually.
STAT_MAX_CONLOSS_TRADES | The number of trades in the longest series of losing trades STAT_MAX_CONLOSSES | int |
Hi
You need to call HistorySelect function beforegetting the number of deals. No history functions will work if you don’t specify what orders you want to retrieve
*(from and to chosen dates)
If you need whole history data just use
HistorySelect(0, TimeCurrent());
Have a nice day👍📊

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi,
I found a lot of code for consecutive loss but not works. Also I try only to get all from history trades. Always I got 0. What code I need to get all losses?