Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Saving Variables Between NT Sessions

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

    Saving Variables Between NT Sessions

    If I shutdown the computer at the end of the trading day and then relaunch the program just prior to the trading day, what system variables are saved to file and reloaded on relaunch? Is there any NT documentation on this? How does this affect an autotrading?

    Is there a way to save user defined ninjiscript variables to file, so on restarting the program, the variables are reloaded?

    #2
    In NinjaTrader 6.5, not much is saved when you shut down. All strategies settings are lost, so when you start it up again, you need to input all settings again.

    NT7 will address this and save strategy information during a shutdown so it is there upon restart.

    If you'd like to save variables to a file, please take a look at the samples titled Using StreamWriter to write to a text file and Using StreamReader to read from a text file.
    AustinNinjaTrader Customer Service

    Comment


      #3
      Austin, Thanks for the quick reply.

      My strategy presents multiple buy and sell signals (triggers), so I want to enter a position on the first such trigger, then ignore any subsequent triggers while waiting for the first trigger to exit the position.

      I assumed a need to set up a boolean variable for program flow control for directing which trading opportunity to look for. Do you know of another approach for handling this?


      Originally posted by NinjaTrader_Austin View Post
      In NinjaTrader 6.5, not much is saved when you shut down. All strategies settings are lost, so when you start it up again, you need to input all settings again.

      NT7 will address this and save strategy information during a shutdown so it is there upon restart.

      If you'd like to save variables to a file, please take a look at the samples titled Using StreamWriter to write to a text file and Using StreamReader to read from a text file.

      Comment


        #4
        borland,

        If you simply want to prevent the condition from being true when it is already holding a position, you could try something like if (Position.MarketPosition != MarketPosition.Flat)
        Josh P.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        572 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        331 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        549 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        550 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X