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

Schaff Trend RSI

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

    Schaff Trend RSI

    Having heard about Schaff indicators in this forum I browsed fxstreet.com and found TRSI at


    I tried to implement a Trend RSI which I want to be a RSI(MACD(23,50,9), 9) and used the Wizard to generate this bugged code :
    ---
    protected override void Initialize()
    {
    Add(new Plot(Color.Orange, PlotStyle.Line, "STR"));
    Rperiod = 9;
    Smooth = 9;
    Mfast = 23;
    Mslow = 50;
    CalculateOnBarClose = true;
    Overlay = false;
    PriceTypeSupported = false;
    }
    /// <summary>
    /// Called on each bar update event (incoming tick)
    /// </summary>
    protected override void OnBarUpdate()
    {
    // Use this method for calculating your indicator values. Assign a value to each
    // plot below by replacing 'Close[0]' with your own formula.
    STR.Set(RSI(MACD(Close, Mfast, Mslow, Smooth) ,Rperiod, Smooth)[0]);
    }
    ---
    would you mind lending a hand ?

    #2
    What errors are generated? Try double clicking on the error itself in the NinjaScript Editor window.

    I created a quick indicator with no inputs and inserted the following in OnBarUpdate() and worked as I expected.

    STR.Set(RSI(MACD(Close, 23, 50, 9), 9, 9)[0]);
    RayNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by r68cervera, Today, 05:29 AM
    0 responses
    3 views
    0 likes
    Last Post r68cervera  
    Started by geddyisodin, Today, 05:20 AM
    0 responses
    6 views
    0 likes
    Last Post geddyisodin  
    Started by JonesJoker, 04-22-2024, 12:23 PM
    6 responses
    35 views
    0 likes
    Last Post JonesJoker  
    Started by GussJ, 03-04-2020, 03:11 PM
    12 responses
    3,241 views
    0 likes
    Last Post Leafcutter  
    Started by AveryFlynn, Today, 04:57 AM
    0 responses
    7 views
    0 likes
    Last Post AveryFlynn  
    Working...
    X