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

Ignore session close

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

    Ignore session close

    I have changed IsExitOnSessionCloseStrategy = false; from true to false and it continues to close at the session end. Is there something else that I need t do?
    ExitOnSessionCloseSeconds = 30;


    #2
    Hello galsermil,

    Did you re apply the strategy after making that change? Any changes to State.SetDefaults would require re applying the script to see that change.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Jesse,

      I need to get clear on applying. If I make a change in <OnBarUpdate>, all that is required is Update Ninja Script but other changes require a script update. My question is what is an update? If I remove it from a strategy and reload it, obviously that is reloaded but if a strategy is disabled and a change is made followed by enabled, is that reloaded?

      Comment


        #4
        Hello galsermil,

        Reloading NinjaScript by using F5 or disabling/re enabling a strategy just restarts the script using the existing settings that were defined when you applied it. If you change a default setting the scripts that are already running wont reflect that change even when doing a F5 or disabling/re enabling, its using the original defaults from when it was applied. You have to remove and re apply a script any time you change OnStateChange items so the script can reflect those changes.

        F5 or disabling/re enabling will restart the script so you will see code changes to later parts of the script like OnBarUpdate. In general its best to just re apply a script any time you make a change and don't get the expected outcome.
        JesseNinjaTrader Customer Service

        Comment


          #5
          Many thanks Jesse. I believe that I did not correctly reapply the script and that is why I got the wrong result.

          Comment


            #6
            Originally posted by galsermil View Post
            I have changed IsExitOnSessionCloseStrategy = false; from true to false and it continues to close at the session end. Is there something else that I need t do?
            ExitOnSessionCloseSeconds = 30;
            My issue has been solved. Many Thanks.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by DJ888, 04-16-2024, 06:09 PM
            6 responses
            18 views
            0 likes
            Last Post DJ888
            by DJ888
             
            Started by Jon17, Today, 04:33 PM
            0 responses
            1 view
            0 likes
            Last Post Jon17
            by Jon17
             
            Started by Javierw.ok, Today, 04:12 PM
            0 responses
            6 views
            0 likes
            Last Post Javierw.ok  
            Started by timmbbo, Today, 08:59 AM
            2 responses
            10 views
            0 likes
            Last Post bltdavid  
            Started by alifarahani, Today, 09:40 AM
            6 responses
            41 views
            0 likes
            Last Post alifarahani  
            Working...
            X