Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

FisherTransform not responsive to change in price type - need help fixing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    FisherTransform not responsive to change in price type - need help fixing

    I am a new user of NinjaTrader. I am not a C# programmer. I need some help with an indicator named FisherTransform that does not behave the way I would expect it to behave.

    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.
    Last edited by Little Prof; 05-14-2009, 12:59 PM.

    #2
    Little Prof,

    If that is the behavior you hope for, make the changes and it will reflect the price types.

    You will need to save it as a new file.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_Josh View Post
      Little Prof,

      If that is the behavior you hope for, make the changes and it will reflect the price types.

      You will need to save it as a new file.
      Thanks. I will give it a try.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by AaronKoRn, Today, 09:49 PM
      0 responses
      1 view
      0 likes
      Last Post AaronKoRn  
      Started by carnitron, Today, 08:42 PM
      0 responses
      6 views
      0 likes
      Last Post carnitron  
      Started by strategist007, Today, 07:51 PM
      0 responses
      8 views
      0 likes
      Last Post strategist007  
      Started by StockTrader88, 03-06-2021, 08:58 AM
      44 responses
      3,975 views
      3 likes
      Last Post jhudas88  
      Started by rbeckmann05, Today, 06:48 PM
      0 responses
      9 views
      0 likes
      Last Post rbeckmann05  
      Working...
      X