Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Referencing Other Inicators

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

    Referencing Other Inicators

    Hi,

    Trying to build Kaufman's AMA filter, buy and sell zones as indicators. 3 days of frustration has driven me into the forum.

    I've done a fair bit of PowerShell scripting at work, but nothing like this. Start with a simple question.

    Under the Indicator, I have:
    private KAMA Kama;

    In State.Configure,
    Kama = KAMA(Fast, Period, Slow);

    In OnBarUpdate(), if I do,
    double Kama0 = Kama[0];
    Value[0] = Kama0;

    I get values on the chart

    But if I do,
    double Kama0 = Kama[1];
    Value[0] = Kama0

    I get nothing.

    Does Kama need to be declared as a series? Pls explain.

    Thanks in advance for the assist. I have a short stint between jobs and I need to shorten the learning curve as much as possible while I have this opportunity!

    #2
    Hi jstarai,

    Are you getting any error messages in the Log tab of the Control Center?

    Are you checking there is at least 1 historical bar before trying to call 1 bar ago?

    Without a check for there being a bar 1 bar ago, double Kama0 = Kama[1]; could cause an index error if this is called on bar 0.

    Is this a script you are making in NinjaTrader 7 or NinjaTrader 8?

    (Below is a link to the NinjaTrader 8 section of the forums)
    http://ninjatrader.com/support/forum...splay.php?f=59
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Thanks, that did the trick. It's NT8, by the way.

      But more importantly, now I know where to look for errors.

      Comment


        #4
        Originally posted by jstarai View Post
        Thanks, that did the trick. It's NT8, by the way.

        But more importantly, now I know where to look for errors.
        You look in the log.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        560 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        325 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        547 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X