To save charting space and to reduce the cluster in my charts, I have combined a few indicators into this one. The code is 961 lines long and contains liner regression, T3, VMA, woodies CCI, Inverse Fisher RSI, STC, QuotientTransform and a few others. Since these indicators each have different scales, I did the following to overcome scaling concerns:
All values of indicators are first calculated and stored in Series<double> data series variables. I have created separate functions for each indicator to build these Series<double>, private, class wide variables. These functions are called in the OnBarUpdate. The created Series<double> variable is then passed through a scale function and stored in the appropriate plot values data series as in the example below:
{
double lastValue = iDouble[0];
int sCount = iDouble.Count;
double sMax = MAX(iDouble, sCount)[0];
double sMin = MIN(iDouble, sCount)[0];
double num = lastValue - sMin;
double num2 = sMax - sMin;
retValue = (vMax - vMin) * (num/num2) + vMin;
return retValue;
The code compiles without error. When I close the workspace and reopen it, charts that contained the indicator do not have the indicator. When I apply the chart template that indicator is not applied to the chart.
I have deleted the chart template and recreated it. I have deleted the workspace and built a new one with new charts. I have also even created a new indicator then paste my code within the class, compiled it successfully. None of these attempts to solve the problem have helped.
The indicator plots fine, but to use it in its current state, I have to add it to each chart every time I open the workspace.
Any insight on what may be causing this error?
Comment