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

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 wzgy0920, 04-20-2024, 06:09 PM
        2 responses
        26 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, 02-22-2024, 01:11 AM
        5 responses
        32 views
        0 likes
        Last Post wzgy0920  
        Started by wzgy0920, Yesterday, 09:53 PM
        2 responses
        49 views
        0 likes
        Last Post wzgy0920  
        Started by Kensonprib, 04-28-2021, 10:11 AM
        5 responses
        192 views
        0 likes
        Last Post Hasadafa  
        Started by GussJ, 03-04-2020, 03:11 PM
        11 responses
        3,234 views
        0 likes
        Last Post xiinteractive  
        Working...
        X