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
DV2010:
...Renat, as I understand it, the display of the indicator on the chart after testing is completed is based on the calculations made during the test and the filling of the indicator array. But what does it mean, that the results are not transferred from the tester to the custom indicator chart?
Of course, the indicator calculation data from the tester-agent is not transferred to the terminal chart. We won't pass hundreds of megabytes of calculated data to the terminal, and they will be immediately (and on the next tick) recalculated by the indicator (call of the function OnCalculate has not been canceled).
The indicator should calculate itself.
sergey1294:
Отвечу вам одно, пока не появиться режим визуализации решить вашу задачу не так просто. Есть одно решение, это записывать данные эквити в файл при тесте. потом данные из этого файла записать в буфер индикатора тем самым построить график эквити.
But where exactly do I write the data to the buffer?
I thought it could only be written to OnCalculated and tried to implement it that way.
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 hard to understand what the main difficulty might be here.
But where exactly do I write the data to the buffer?
I thought it could only be written to OnCalculated and tried to implement it that way.
We use expert to write values into the file, then in the indicator we write the code for reading from the file and writing data into the buffer. I can't show you the code yet, it will take me some time to write it.
Of course, the calculated indicator values cannot be transferred from the Tester-Agent to the terminal chart. We won't pass hundreds of megabytes of calculated data to the terminal, and they will be immediately (and on the next tick) recalculated by the indicator (call of the function OnCalculate has not been canceled).
Renat, the indicator should read itself
That's why I initialize the indicator array values with some values in the OnCalculatedmethod .But why is it possible to initialize (build) the indicator line in this way, while the Equityvalues do not?
Renat, the indicator should read itself
That's why I initialize the values of the indicator array with some values in the OnCalculatedmethod .But why is it possible to initialize (build) the indicator line inthis way, while the Equityvalues cannot?
As I understand it, it should be written to the file in the Expert Advisor's OnInit based on definition via AccountInfoDouble(ACCOUNT_EQUITY) and read from the file - in OnCalculated indicator.
But why is the data on variable Equty through AccountInfoDouble(ACCOUNT_EQUITY) available directly in OnCalculated?
The code would then get too cumbersome.....
I can't understand ...OnCalculated in Print AccountInfoDouble(ACCOUNT_EQUITY) outputs some value .
What exactly prevents it from being immediately assigned to the array of indicator values?
I always thought that indication of values in the tester on the history differs from indication of current values only in the fact that the history is already recorded, while current data are just arriving.
sergey1294:
потому что цены имеют историю а эквити нет. По этому для эквити вам нужно строить собственную историю записав ее в файл.
But then how is Equty dynamics displayed at all through AccountInfoDouble(ACCOUNT_EQUITY) in OnCalculated Indicator (not only in OnTick Expert Advisor)?
Or does OnCalculated Indicator work differently in test mode and in display mode?
Declare two arrays Equity[] and Time[] on global level in EA.
Write the value of equity and time in the appropriate array when testing the EA.
Use a script to read the file at the end of testing and plot the equity on the required chart.
This is the best way for your purposes, I do not understand why you need an indicator.
As far as I understand, it should be written to the file in the Expert Advisor's OnInit based on definition via AccountInfoDouble(ACCOUNT_EQUITY) and read from the file - in OnCalculated indicator.
But why is the data on variable Equty through AccountInfoDouble(ACCOUNT_EQUITY) available directly in OnCalculated?
The code would then get too cumbersome.....
I can't understand ...OnCalculated in Print AccountInfoDouble(ACCOUNT_EQUITY) outputs some value .
What exactly prevents it from being immediately assigned to the array of indicator values?
I always thought that indicating values in the tester on the history differs from indicating current values only in the fact that the history is already recorded, while the current data is just arriving.