The Problem
I have applied the FisherTransform to a chart of the S&P 500 index. But, when I change the editable parameter named “Price Type” from High to Low, for example, and then click Apply, the magnitude of the FisherTransform displayed in the Data Box does not change—not even at the second decimal place. It responds (changes) when I change other editable parameters—“Period” from 10 to 20, for example—but not when I change the “Price Type.”
A Potential Source of the Problem
I have looked at the code for the indicator. In the OnBarUpdate section, I found statements that seem to “hardwire” the calculations to the Median price type. Three examples follow.
double minLo = MIN(Median, Period) [0];
double maxHi = MAX(Median, Period) [0];
double tmpValue = 0.66 * ((Median[0] – minLo) / num1 – 0.5) + 0.67 * tmpValuePrev;
Again, I am not a C# programmer, but I confess these statements make me wonder if prophet.net, the courtesy supplier of the code, inadvertently hardwired the calculation to use the Median price type vis-à-vis a price type chosen by the user.
A Potential Solution to (Fix for) the Problem
As I mentioned above, I am not a C# programmer. However, in an effort to discover a “fix” for the problem, I have read much (most?) of the NinjaTrader Help Guide – particularly, the part about editing and/or constructing indicators. I am wondering if the “fix” to the problem is as simple as editing the code for the FisherTransform as follows (color for emphasis only) and then recompiling.
Code as it currently exists on lines 62, 63, and 70:
double minLo = MIN(Median, Period) [0];
double maxHi = MAX(Median, Period) [0];
double tmpValue = 0.66 * ((Median[0] – minLo) / num1 – 0.5) + 0.67 * tmpValuePrev;
Code as it would be after the proposed editing on lines 62, 63, and 70:
double minLo = MIN(Input, Period) [0];
double maxHi = MAX(Input, Period) [0];
double tmpValue = 0.66 * ((Input[0] – minLo) / num1 – 0.5) + 0.67 * tmpValuePrev;
I hope one of you who really understands C# programming can look at the code for FisherTransform and help me.
Thanks in advance.
Comment