Announcement

Collapse
No announcement yet.

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);

      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.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by NullPointStrategies, Yesterday, 05:17 AM
          0 responses
          63 views
          0 likes
          Last Post NullPointStrategies  
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          139 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          75 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          45 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          50 views
          0 likes
          Last Post TheRealMorford  
          Working...
          X