Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Session Templates?

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

    Session Templates?

    My indicator gets the following error:

    "Time Category Message - Error on calling 'OnStateChange' method: 'AddDataSeries' method only accepts valid trading hours names, but 'Default 24x7' does not exist in the Trading Hours Manager."

    REALLY? ;-)

    #2
    Hello molecool,

    Thank you for writing in.

    Did you create this NinjaScript Strategy/Indicator yourself?

    Or, did you get this NinjaScript Strategy/Indicator from a 3rd party Developer?

    Finally, if you go to a Chart and select the "Default 24x7" trading hours template and click OK, does an error appear?

    Comment


      #3
      Nah I wrote it myself - and I made sure that Default 24x7 worked in the chart (BTCUSD).

      So I eventually got it compiled by using Bars.TradingHours.Name which worked. You may want to document the session strings though somewhere, I only found the attribute by accident.

      Comment


        #4
        Hello molecool,

        Capitalization and spaces matter in matching strings.

        Try "Default 24 x 7"

        You can view the exact name in the Tools -> Trading Hours window. These strings are subject to change by the user.
        Chelsea B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        169 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Started by CaptainJack, 04-24-2026, 11:07 PM
        0 responses
        324 views
        0 likes
        Last Post CaptainJack  
        Started by Mindset, 04-21-2026, 06:46 AM
        0 responses
        250 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        351 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        180 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Working...
        X