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 Haiasi, Today, 06:53 PM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ScottWalsh, Today, 06:52 PM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ScottW, Today, 06:09 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by ftsc2022, 10-25-2022, 12:03 PM
        5 responses
        256 views
        0 likes
        Last Post KeyonMatthews  
        Started by Board game geek, 10-29-2023, 12:00 PM
        14 responses
        244 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Working...
        X