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 CaptainJack, 05-29-2026, 05:09 AM
            0 responses
            263 views
            0 likes
            Last Post CaptainJack  
            Started by CaptainJack, 05-29-2026, 12:02 AM
            0 responses
            168 views
            0 likes
            Last Post CaptainJack  
            Started by charlesugo_1, 05-26-2026, 05:03 PM
            0 responses
            170 views
            1 like
            Last Post charlesugo_1  
            Started by DannyP96, 05-18-2026, 02:38 PM
            1 response
            257 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by CarlTrading, 05-11-2026, 05:56 AM
            0 responses
            209 views
            0 likes
            Last Post CarlTrading  
            Working...
            X