
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
That's the thing: the loop is called on all ticks!
See for yourself! I put the output into the body of the loop on purpose:
And here's the end result:
That's the thing: the loop is called on all ticks!
See for yourself! I put the output into the body of the loop on purpose:
And here's the end result:
The testing here is that I need to see the change of Equity within the tested period on the history.
I have made your corrections, I ran the indicator both in testing mode and by dragging it to a new chart.
The indicator works for the entire period, up to the current quotes, as well as for any timeframe (or what exactly does it mean "you will see everything"?)
Nevertheless the Equity value remains constant, although the output to the log shows that it changes.
( Otherwise, how else can we tell if the loop is working or not, other than through Print? )
...Just in case, here is the "skeleton" of the Expert Advisor with indicator attached:
The reason for testing here is that I need to see the change of Equity within the tested period on the history.
I have made your corrections, I ran the indicator both in test mode and by dragging and dropping it on a new chart.
The indicator works for the entire period, up to the current quotes, as well as for any timeframe (or what exactly does it mean "you will see everything"?)
Nevertheless the Equity value remains constant, although the output to the log shows that it changes.
( Otherwise, how else can we tell if the loop is working or not, other than through Print? )
...Just in case, here is the "skeleton" of the Expert Advisor with indicator attached:
Maybe I am mistaken, but don't you compare the indicator's appearance on the chart after the testing is completed with the calculations made during the testing?
The point is that the results (calculation arrays) of the custom indicator from the tester are not transferred to the chart in any way, but the specified indicator is simply launched on a new calculation on the chart.
Run this indicator on a minute chart (if you have an open position) and after 10-15 minutes you will get a picture like this.
Code:
Roche, I already asked you what my indicator is wrong, and I wrote you about how I checked your variant as well . And I tried to explain it to you in as much detail as possible, while you wrote only briefly about "the loop doesn't work" and "you'll see for yourself"...
...Renat, as I understand it, the indicator will be displayed on the chart after the test is completed, based on the calculations made during the test and the filling of the indicator array. But what does it mean that the results from the tester are not transferred to the custom indicator chart from the tester?
Then what for do they need and why does the indicator line disappear at once, when I remove the assignment of values to an array from the code (even if it's a constant horizontal line, it disappears)?
I thought that the correspondence between the array of indicator values that are filled in at OnCalculated and the indicator values on the chart is unambiguous, otherwise how can the indicator values be initialized?
It is difficult to understand... It seems to be a trivial task, but I have been struggling with it for several days, and it is difficult to find someone who can at least hint how it can be solved differently on the history and whether it is solved at all.
Once again, as I understand it (correct me if I'm wrong, if you don't mind).
1.I specify a testing period in the tester and select an Expert Advisor with my indicator attached to it.
2. thefirst call OnCalculated is called with parameters prev_calculated =0 and rates_total = number of tick (bar) corresponding to the beginning of testing. Within this period, the value of balance remains at the initial and constant level.
Theconsecutive calls of OnCalculated by bar within the testing period, occur for each individual bar, and here we can initialize an array of indicator values with those data that changes (for example, duplicate the price, that I received, but then why not initialize Equity with the changing prices ?)
And anyway, you're a pro. I hope this simple task is solved, or MetaTraderhas yet to reach such "heights"? :)))
I have offered my simple solution to this problem, but it refuses to work.
Then how can it be implemented - an Equity chart below the price chart based on the results of testing on the history?
Rosh, the variant for online has already been posted, but as someone who works primarily with History, I need a variant that works on historical data. And I still find it difficult to understand what the main difficulty may be.
The trader has an idea about the balance graph online due to a smaller number of deals (unless he is an extrascalper who hardly has time to press Buy and Sell).
Indeed, the Equity dynamics becomes critical on a long history with hundreds or even thousands of trades, but the graph in the tester does not provide a simple comparison of these dynamics with the price dynamics in principle (unless, of course, MetaQuote considers the main thing for programmers to be a quick elimination of already prepared experts without the analysis of separate series of weak and strong positions).