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

TradingHours null when autoconnecting at startup

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

    TradingHours null when autoconnecting at startup

    Hi,
    a client has received this error when autoconnecting to data at Ninja startup. Why would the TradingHours be null? (The strategy is not referencing any TradingHours object in OnStateChange().


    2019-01-17 15:23:23:656|2|4|Session Break (Version 8.0.16.3)
    2019-01-17 15:23:27:448|1|4|Verifying license at primary server...
    2019-01-17 15:23:27:886|1|4|Type=Regular State=Verified Start Date=12/19/2018 End Date=12/30/2098
    2019-01-17 15:23:29:527|1|4|Global simulation mode enabled
    2019-01-17 15:23:29:839|1|4|Vendor assembly 'DTTW8News4T' version='1.0.0.1' loaded.
    2019-01-17 15:23:34:779|1|2|Using IS (is-us-nt-001.ninjatrader.com/31658)
    2019-01-17 15:23:34:805|1|4|Automated trading disabled
    2019-01-17 15:23:34:820|1|4|Auto connecting 'My NinjaTrader Continuum'...
    2019-01-17 15:23:34:820|1|2|My NinjaTrader Continuum: Primary connection=Connecting, Price feed=Connecting
    2019-01-17 15:23:34:983|1|32|Order entry hot keys disabled
    2019-01-17 15:23:34:983|1|4|Auto close enabled=False
    2019-01-17 15:23:36:397|1|4|Restoring workspace 'Default FX'...
    2019-01-17 15:23:39:874|1|4|Restoring workspace 'Daily EURO Charts'...
    2019-01-17 15:23:40:453|3|4|Strategy 'jjJeffsDoubleDown/158537373': Error in loading strategy from the database: System.NullReferenceException: Object reference not set to an instance of an object. at NinjaTrader.NinjaScript.StrategyBase.GetTradingHou rs(Instrument instrument) at NinjaTrader.NinjaScript.StrategyBase.DbLoad()
    2019-01-17 15:23:46:588|1|2|My NinjaTrader Continuum: Primary connection=Connected, Price feed=Connected
    2019-01-17 15:23:46:605|3|4|Failed to process 'EventuallyConnected': 'One or more errors occurred.'


    Thanks in advance,
    saltminer

    #2
    Hello saltminer,

    Thank you for the post.

    It would be difficult to say from these details what may be happening, however, I do have some questions surrounding the script and how it was run.

    Is the script adding any secondary series?

    Is a standard set of trading hours being used when applying the strategy, or is a custom defined set of hours being used?

    Does the strategy use the "Use Instrument Settings" or has a specific session been selected?

    Does this happen if you close the workspaces that are opening at startup and remove all instances of the script, then apply 1 instance in a new workspace using the scripts default settings?

    These would all be helpful to know and test to better understand the scope of the problem. I assume based on the details that you have tried with success when not using auto connect, is this correct?



    Another item I can note is the message at the bottom:

    Failed to process 'EventuallyConnected': 'One or more errors occurred.'
    This message can come from how NinjaTrader deals with daylight saving time that occurs at midnight however I am unsure if this additionally happens for other reasons. We have seen this with Brazil as it happens to start DST at midnight while all other known DST begins at a different hour. The current suggestion for timezones which reach this message is to change the PC time to UTC-5 (eastern US) or UTC-6 (central US) until a fix is implemented (NTEIGHT-13334).

    I am unsure if this message is related to the null message, so that would also be something that can be tested to check if it is. I would like to have these details if that were to be the case so I can further this report.



    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by DanielTynera, Today, 01:14 AM
    0 responses
    2 views
    0 likes
    Last Post DanielTynera  
    Started by yertle, 04-18-2024, 08:38 AM
    9 responses
    40 views
    0 likes
    Last Post yertle
    by yertle
     
    Started by techgetgame, Yesterday, 11:42 PM
    0 responses
    9 views
    0 likes
    Last Post techgetgame  
    Started by sephichapdson, Yesterday, 11:36 PM
    0 responses
    2 views
    0 likes
    Last Post sephichapdson  
    Started by bortz, 11-06-2023, 08:04 AM
    47 responses
    1,615 views
    0 likes
    Last Post aligator  
    Working...
    X