Indicator Overlay with OnCalculate Second Form

 

Hi all,

 I am wondering whether it is possible to apply an indicator, which used the second form of the OnCalculate event (i.e. Open, High, Low, Close etc.),  to another indicator?

 For example, I would like to apply the Stochastic indicator to another custom indicator. However, the Stochastic indicator has been coded using the second form within the OnCalculate event. As a result, if I drag the Stochastic indicator to a chart, I don't get the possibility to chose on which price this indicator should be based, i.e. Close or Previous Indicator's Data.

So, how can I apply indicators of such type, such as Stochastic, to another indicator?

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.
 
avester:

Hi all,

 I am wondering whether it is possible to apply an indicator, which used the second form of the OnCalculate event (i.e. Open, High, Low, Close etc.),  to another indicator?

 For example, I would like to apply the Stochastic indicator to another custom indicator. However, the Stochastic indicator has been coded using the second form within the OnCalculate event. As a result, if I drag the Stochastic indicator to a chart, I don't get the possibility to chose on which price this indicator should be based, i.e. Close or Previous Indicator's Data.

So, how can I apply indicators of such type, such as Stochastic, to another indicator?

You can't with standard Stochastic, you have to create a custom indicator with first form of OnCalculate event. Maybe this already exist, search firstly on the Codebase. If not you can read this article to help you to create a custom indicator.
Reason: