Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

"Exit on close" not disabled

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

    "Exit on close" not disabled

    Hello,

    I wanted "Exit On Close" to be disabled and I coded below

    protected override void Initialize()
    {
    ClearOutputWindow();
    TraceOrders = true;
    ExitOnClose = false;
    CalculateOnBarClose = false;
    .....

    During execution, strategy positions still get closed with "Exit on close" message on the charts at the end of session. Can you tell me why the "ExitOnClose = false" code still is being ignored?

    Thanks for your reply.
    -traderjh

    #2
    traderjh, did you compile those changes in by hitting F5 after making your code changes and then starting a new instance of the strategy? When you check the parameters of the running strategy, what would be shown for the instance running for ExitOnClose?

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      traderjh, did you compile those changes in by hitting F5 after making your code changes and then starting a new instance of the strategy? When you check the parameters of the running strategy, what would be shown for the instance running for ExitOnClose?
      Yes, I did hit F5 on editor to compile the code then I hit F5 on the chart to reload the strategy. I opened the strategy parameter window and it still says "Exit on close = true". I made sure to select the strategy to show the parameters. Is there something I overlook?

      Thanks,
      -traderjh

      Comment


        #4
        Would you see the same if you readded the strategy completely fresh, so a complete new instance would be used?

        Comment


          #5
          Originally posted by NinjaTrader_Bertrand View Post
          Would you see the same if you readded the strategy completely fresh, so a complete new instance would be used?
          Ah... After fiddling around and found a way to make it work is to completely remove the strategy from the parameter window then click on New button. It now shows "False". So it looks like I have to remove strategy from each chart and hit New to install it after compiling.

          I hope there is a better way. Is there any? I use control center to disable and enable strategy for each chart to reload the strategy. That doesn't change from True to False at Exit on close.

          Comment


            #6
            As this property is set in Initialize, you have to remove and re-add to recall these settings after changing.
            MatthewNinjaTrader Product Management

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            663 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            376 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            110 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            575 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            580 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X