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

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 nandhumca, Today, 03:41 PM
        0 responses
        1 view
        0 likes
        Last Post nandhumca  
        Started by The_Sec, Today, 03:37 PM
        0 responses
        3 views
        0 likes
        Last Post The_Sec
        by The_Sec
         
        Started by GwFutures1988, Today, 02:48 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_Clayton  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        6 responses
        32 views
        0 likes
        Last Post ScottWalsh  
        Started by frankthearm, Today, 09:08 AM
        10 responses
        36 views
        0 likes
        Last Post frankthearm  
        Working...
        X