• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

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 usero86, Today, 04:28 AM
        0 responses
        8 views
        0 likes
        Last Post usero86
        by usero86
         
        Started by bohenriksen, Today, 04:00 AM
        0 responses
        4 views
        0 likes
        Last Post bohenriksen  
        Started by Derjan, Today, 03:09 AM
        0 responses
        7 views
        0 likes
        Last Post Derjan
        by Derjan
         
        Started by CDXTrader, Today, 12:29 AM
        0 responses
        8 views
        0 likes
        Last Post CDXTrader  
        Started by TopGun13, Yesterday, 10:35 PM
        0 responses
        5 views
        0 likes
        Last Post TopGun13  
        Working...
        X