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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        37 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, Yesterday, 02:41 AM
        0 responses
        17 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        25 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        34 views
        0 likes
        Last Post CarlTrading  
        Working...
        X