DeInit() and iCustom indicators

 

Hi Guys

I was wondering if anyone knew how to have custom indicators remain on chart after backtesting?

Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
 
Please explain your question. What do you exactly mean?
 
alexvd:
Please explain your question. What do you exactly mean?

I mean normally in the DeInit() function if you include something like this below.

say for instance im using 2 stochastics in my EA ie stocastic_1 and stochastic_2

if i include stochastic_1 in the OnDeinit() function like below, when backtesting is complete, stochastic_1 will not show on the chart because it has been released, however because stochastic_2 was NOT released, stochastic_2 will show on the chart.

My question is, when i have custom indicators in my EA, even though i didn't "release" it, it does not show on my chart after running my EA through the Strategy Tester...how do i get it to show on the chart after testing is complete.

void OnDeinit(const int reason)) {

IndicatorRelease(stochastic_1);   //This will remove or release stochastic_1 from the chart when backtesting is complete in the strategy tester

} 
Step on New Rails: Custom Indicators in MQL5
Step on New Rails: Custom Indicators in MQL5
  • 2009.11.23
  • Андрей
  • www.mql5.com
I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.
 
you can't. it doesn't work.
 
graziani:
you can't. it doesn't work.
If you made a template with your(s) indicator(s) and name it "Tester". Your(s) indicator(s) will be showed on chart at end of testing.
 

That sucks. I know you can add templates but then all the positions you have taken will disappear upon loading the template. It just becomes a annoying everytime you do a backtest and you want to analyse your chart.


Thanks to all for your replies.

 
angevoyageur:
If you made a template with your(s) indicator(s) and name it "Tester". Your(s) indicator(s) will be showed on chart at end of testing.

yes but with which parameters?

this is not a solution. 

 
Syphon:

That sucks. I know you can add templates but then all the positions you have taken will disappear upon loading the template. It just becomes a annoying everytime you do a backtest and you want to analyse your chart.


Thanks to all for your replies.

Have you tried what I suggest to you. I don't say you to add a template manually. To be more clear.

  1. Made a chart as you want.
  2. Save as a template with the name : Tester.tpl
  3. Run your backtest.
  4. If set on "Auto open chart" or you use "Open chart" on result tab.

You obtain a chart with your template AND your positions (from backtesting). Isn't what you want ?

 
graziani:

yes but with which parameters?

this is not a solution. 

Are you not a bit lazy ? ;-)
 
angevoyageur:
Are you not a bit lazy ? ;-)

no, i am very lazy. ;) 

but this doesn't change the fact that i have to manually copy and change parameters when i am inspecting results of strategy tester for every backtest i do.

which should work automatically.