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

Is it proper way to have settlement line filter?

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

    #16
    I checked and that indicator uses this line
    AddDataSeries(Instrument.FullName, new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, tradingHours.Name, false);

    SO i went and changed it on my end and added variable tradinghours to match whats in indicator
    private TradingHours tradingHours;
    tradingHours = TradingHours.Get("CME US Index Futures RTH");

    but its still producing same error
    SettlementLines' tried to load additional data. All data must first be loaded by the hosting NinjaScript in its configure state. Attempted to load ES 03-23 Globex: Da

    Maybe you can glance in the strategy to see what i am doing wrong? I attached indicator earlier

    Attached Files

    Comment


      #17
      Hello tkaboris,

      It looks likes that indicator uses AddDataSeries in the unsupported way that I previously mentioned and linked to the help guide for. You would have to edit the indicator to not use variables for AddDataSeries for it to be used by a strategy. You would then have to make the strategy match what you changed the indicator to use.

      Using variables with AddDataSeries will cause errors because it is not intended to be used in a variable way, it looks like the user that created this script missed that note so they made the indicator in an incorrect way.

      You could do something like this as an example:

      Code:
      AddDataSeries("ES 03-23", new BarsPeriod { BarsPeriodType = BarsPeriodType.Day, Value = 1 }, "CME US Index Futures RTH", false);
      JesseNinjaTrader Customer Service

      Comment


        #18
        Ohh...
        So i can not pass default instrumetn name then?

        Last edited by tkaboris; 03-06-2023, 03:15 PM.

        Comment


          #19
          Hello tkaboris,

          Not if the indicator is using that AddDataSeries overload set, that overload requires the instrument name which needs to be typed in. It can't use the Instrument object for the name as the help guide notes.
          JesseNinjaTrader Customer Service

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by ageeholdings, Today, 07:43 AM
          0 responses
          7 views
          0 likes
          Last Post ageeholdings  
          Started by pibrew, Today, 06:37 AM
          0 responses
          4 views
          0 likes
          Last Post pibrew
          by pibrew
           
          Started by rbeckmann05, Yesterday, 06:48 PM
          1 response
          14 views
          0 likes
          Last Post bltdavid  
          Started by llanqui, Today, 03:53 AM
          0 responses
          6 views
          0 likes
          Last Post llanqui
          by llanqui
           
          Started by burtoninlondon, Today, 12:38 AM
          0 responses
          12 views
          0 likes
          Last Post burtoninlondon  
          Working...
          X