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

Need custom indicator constructor guide.

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

    Need custom indicator constructor guide.

    I wrote a custom indicator.

    Is it possible to adddataseries that indicator to a strategy but on a different instrument with a different time frame? In other words, there will be two different instruments on 2 different time frames. Both will need to have my custom indicator running on it.

    I know how to add another time frame series but I'm not sure how to add the custom indicator for that series.

    I hope that made sense?

    #2
    Hello Chippy,

    Thanks for your post.

    You would add your data series in State.Configure, and then you would instantiate your indicators in State.DataLoaded.

    The first parameter of an indicator's constructor is always the input series. Therefore, you can provide Closes[0] in the first parameter for the primary data series and Closes[1] for the secondary data series.

    I.E.

    MySMA1 = SMA(Closes[0], 14);
    MySMA2 = SMA(Closes[1], 14);

    Let us know if there is anything else we can do to help.
    JimNinjaTrader Customer Service

    Comment


      #3
      Oh, now I see. I tried that originally, but wasn't getting the constructor option for the iSeries (or didn't see it) for my indicator like I see with NT indicators and thought I need to add a constructor to the indicator manually to mimic that behavior. Still figuring all this out. Really appreciate you and your team!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by helpwanted, Today, 03:06 AM
      1 response
      12 views
      0 likes
      Last Post sarafuenonly123  
      Started by Brevo, Today, 01:45 AM
      0 responses
      9 views
      0 likes
      Last Post Brevo
      by Brevo
       
      Started by aussugardefender, Today, 01:07 AM
      0 responses
      5 views
      0 likes
      Last Post aussugardefender  
      Started by pvincent, 06-23-2022, 12:53 PM
      14 responses
      242 views
      0 likes
      Last Post Nyman
      by Nyman
       
      Started by TraderG23, 12-08-2023, 07:56 AM
      9 responses
      387 views
      1 like
      Last Post Gavini
      by Gavini
       
      Working...
      X