back ground first:
I have 1 indicator that I am splitting into 2 different visual representations. The 2 new indicators will share the same core calculations and parameters. Each new indicator will also have some additional parameters.
I had no problem creating the base indicator with all of it's parameters.
I then created the new indicator that extends the new base indicator and
added the parameters to the new indicator unique to it's visual presentation.
Both indicators compile correctly and when I place the new indicator, (that extends the new base indicator), on a chart it also draws correctly and all the parameters show up correctly in the property panel.
However, when I created a strategy that used the new indicator, the
strategy had a compiler error which was a complaint about the number of parms required to construct the indicator.
Upon deeper inspection into the code generated by ninja, I noticed that
the construction of the new indicator only took in the parameters defined in that extended class. It did not take into account the inherited parameters of it's base class.
This seemed strange because when the indicator is on a chart, the
property panel properly shows all the parameters, even the inherited ones.
I also noticed that if I put the parameter code in the extending class, BUT COMMENTED OUT, then ninja recognizes them and generates the constructor correctly.
Can ninja's code generator be made to look up the inheritance chain for all parameters?
Shouldn't ninja ignore commented out code?
Is there something more I have to code in the extending class to make
ninja's code generation notice the inherited parameters?
Thanks,
Gary
Comment