Since last week I am trying to develop a Predictive Indicator that can be use for 2 directional break-outs. This is what I am trying to do.
1: First I will try to revert back from MACD formula to get the Current Close. To achieve this I used the following statement in the OnBarUpdate Method.
Upper.Set((MACD(Fast,Slow,Smooth)[0] - (1 - (2/(1 + Fast)))*EMA(Fast)[1] + (1 - (2/(1 + Slow)))*EMA(Slow)[1])/((2/(1 + Fast)) - (2/(1 + Slow))));
Fast, Slow and Smooth are Input Variables defined under Variables
EMA(Fast)[1], EMA(Slow)[1] are previous bar EMA's for the given period.
MACD(Fast,Slow,Smooth)[0] is current bar MACD for the given inputs.
Upper must plot the Current Bar Close and this is what I am expecting it to do as I extracted the above formula from MACD formula working in the reverse dierction.
This is my first step to see if it can plot Current Close and from thereon I am planning to develop it further to give break-out signals.
I compiled this indicator and it did not give me any error.
So far so good.
However when I am trying to plot it on the chart, I am not getting anything.
The scale sets to MACD scale ie; in the range of -2 to +2 on the y-axis. If it has to plot the Close[0] then this should not be the case .
Log file show the error stating:
Error on plotting indicator MACDUpper. Please check the 'Plot' method. Overflow error.
I tried going through Help files but could not get anything in this context and hence I am asking for help from support to assist me in getting this.
Your kind support is appreciated as usual.
Thanks & best regards,
Yusuf SHAIKH
Comment