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
But your original version with build 1596 is far slower so your original comparison with MT4 must be updated.
You may be using an old version of the library. You can always find the latest version here.
Converted your code to MT4 through MT5Bridge. MT4build1072
Original Code
Results after conversion are identical! Speed has dropped by half.
it makes more sense to write an optimal algorithm!
How?
How to do this?
Once per cycle get the necessary data. Cycle only when needed, not on every tick.
My EA only works on opening prices. The bigger the story the slower it works - times slower.
Get the history at startup, once and remember it.
When you start, the tester has no history.
If we are talking about the tester only, of course there isn't one.
In any case, you should not go through the whole history on every tick or even on every bar.
If the test is carried out on ticks, then it is enough to select only one order entered into the history.
My Expert Advisor works only with opening prices. The larger the history, the slower it works.
If the test is on bars, several orders may have entered the history, which means that only these orders need to be traced.
My EA only works on opening prices. The bigger the story the slower it works - times slower.
The more closed positions in the history list, the longer the cycle. Limit the cycle to a small enough depth of history.
I have a suspicion that the tester starts to slow down not from the orders themselves, but from their modification - this process happens on every bar.
If we are speaking only about the tester, of course it does not exist.
In any case, you shouldn't go through the entire history on every tick, or even on every bar.
If the test is run on ticks - then it is enough to select only one order entered into the history.
If the test is on bars - several orders may have entered the history, which means that only these orders must be traced.
I seldom go through the history - the slowdown is due to the accumulation of history as such - as I see it.
If you could get information about the order number by its date (the first number in that date), then the large overshoot could be avoided - go through the orders by the number falling within the range.
I have a suspicion that the tester starts to slow down not because of the orders themselves but because of their modification - this process takes place on each bar.
I rarely go through the history - the slowdown is due to the accumulation of history, as such - to my senses.
If it were possible to obtain information about the order number by its date (the first number in this date), then the large overshoot could be avoided - to search for orders by the number falling within the range.