Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Exit on Close exited 30 Minutes Early (instead of 30 secs)

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

    Exit on Close exited 30 Minutes Early (instead of 30 secs)

    The Exit on Close seems to work fine in historical testing.

    Today was the first time my automated strategy was able to run on its own after resolving hosting and port problems, etc.

    Well, it was in a winning short trade on USD/JPY from arount 10 AM EST and exited at 11:30 AM EST with an "Exit on close" signal.

    HOWEVER, the session on the chart is setup at 6:00 AM to start and 12:00 PM to end.

    The strategy is set to exit on close with "Exit on close seconds" set to 30.

    This is on NT 6.5 (prod version).

    Is it possible that the strategy exits 30 minutes early instead of 30 seconds when running real time?

    Could this be a bug?

    Maybe I have to disable "Exit on Close" and create my own exit on close code in the strategy.

    Please advise.

    - Wayne

    #2
    In the log tab can you confirm that the order to close the position was triggered by Exit On Close? What time did this log fire, exactly at 11:30?
    RayNinjaTrader Customer Service

    Comment


      #3
      Here are the last entries in the log in reverse order.

      Please advise.

      Code:
      4/22/2008 11:34:52 AM,Order,Order='0xk0101:0f75/E5568100' Name='Exit on close' New State=Filled Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=1000 Fill price=103.079 Error=NoError Native error='',
      4/22/2008 11:34:52 AM,Execution,Execution='NT_20080422_0171' Instrument='$USDJPY' Account='E5568100' Exchange=Default Price=103.079 Quantity=1,000 Market position=Long Operation=Insert Order='0xk0101:0f75' Time='4/22/2008 11:34:52 AM' Multiplier=0.001 Rate=0.00970214417386242,
      4/22/2008 11:34:52 AM,Position,Instrument='$USDJPY' Account='E5568100' Avg price=103.21 Quantity=1,000 Market position=Short Operation=Remove Currency=UsDollar,
      4/22/2008 11:34:52 AM,Order,Order='0xk0101:0f75/E5568100' Name='Exit on close' New State=Working Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 11:34:52 AM,Order,Order='0xk0101:0eak/E5568100' Name='Profit target' New State=Cancelled Instrument='$USDJPY' Action=BuyToCover Limit price=102.51 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 11:34:51 AM,Order,Order='0xk0101:0eaj/E5568100' Name='Stop loss' New State=Cancelled Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=103.19 Quantity=1,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 11:34:51 AM,Order,Order='0xk0101:0f75/E5568100' Name='Exit on close' New State=Accepted Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 11:34:51 AM,Order,Order='2f2818f-greaterreturn-34/E5568100' Name='Exit on close' New State=PendingSubmit Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=0 Quantity=1,000 Type=Market Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 11:34:51 AM,Order,Order='0xk0101:0eak/E5568100' Name='Profit target' New State=PendingCancel Instrument='$USDJPY' Action=BuyToCover Limit price=102.51 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 11:34:51 AM,Strategy,Exit on close handling for strategy 'ProbabilityEMA' started.,
      4/22/2008 11:34:51 AM,Order,Order='0xk0101:0eaj/E5568100' Name='Stop loss' New State=PendingCancel Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=103.19 Quantity=1,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 11:07:59 AM,Order,Order='0xk0101:0eaj/E5568100' Name='Stop loss' New State=Accepted Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=103.19 Quantity=1,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 11:07:59 AM,Order,Order='0xk0101:0eaj/E5568100' Name='Stop loss' New State=PendingChange Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=103.19 Quantity=1,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:54:20 AM,Order,Order='0xk0101:0eak/E5568100' Name='Profit target' New State=Working Instrument='$USDJPY' Action=BuyToCover Limit price=102.51 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:54:19 AM,Order,Order='0xk0101:0eak/E5568100' Name='Profit target' New State=Accepted Instrument='$USDJPY' Action=BuyToCover Limit price=102.51 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:54:19 AM,Order,Order='0xk0101:0eaj/E5568100' Name='Stop loss' New State=Accepted Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=103.26 Quantity=1,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:54:19 AM,Execution,Execution='NT_20080422_0153' Instrument='$USDJPY' Account='E5568100' Exchange=Default Price=103.21 Quantity=1,000 Market position=Short Operation=Insert Order='0xk0101:0eah' Time='4/22/2008 10:54:19 AM' Multiplier=0.001 Rate=0.00968898362561767,
      4/22/2008 10:54:19 AM,Order,Order='0xk0101:0eah/E5568100' Name='cross low' New State=Filled Instrument='$USDJPY' Action=SellShort Limit price=103.2 Stop price=0 Quantity=1,000 Type=Limit Filled=1000 Fill price=103.21 Error=NoError Native error='',
      4/22/2008 10:54:19 AM,Order,Order='2f2818f-greaterreturn-30/E5568100' Name='Profit target' New State=PendingSubmit Instrument='$USDJPY' Action=BuyToCover Limit price=102.51 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:54:19 AM,Order,Order='2f2818f-greaterreturn-2f/E5568100' Name='Stop loss' New State=PendingSubmit Instrument='$USDJPY' Action=BuyToCover Limit price=0 Stop price=103.26 Quantity=1,000 Type=Stop Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:54:19 AM,Position,Instrument='$USDJPY' Account='E5568100' Avg price=103.21 Quantity=1,000 Market position=Short Operation=Insert Currency=UsDollar,
      4/22/2008 10:54:19 AM,Order,Order='0xk0101:0eah/E5568100' Name='cross low' New State=Working Instrument='$USDJPY' Action=SellShort Limit price=103.2 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:54:19 AM,Order,Order='0xk0101:0eah/E5568100' Name='cross low' New State=Accepted Instrument='$USDJPY' Action=SellShort Limit price=103.2 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:54:18 AM,Order,Order='2f2818f-greaterreturn-2e/E5568100' Name='cross low' New State=PendingSubmit Instrument='$USDJPY' Action=SellShort Limit price=103.2 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:46:45 AM,Order,Order='0xk0101:0du2/E5568100' Name='Profit target' New State=Cancelled Instrument='$USDJPY' Action=Sell Limit price=103.75 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:46:44 AM,Order,Order='0xk0101:0du1/E5568100' Name='Stop loss' New State=Filled Instrument='$USDJPY' Action=Sell Limit price=0 Stop price=103 Quantity=1,000 Type=Stop Filled=1000 Fill price=103 Error=NoError Native error='',
      4/22/2008 10:46:44 AM,Order,Order='0xk0101:0du2/E5568100' Name='Profit target' New State=PendingCancel Instrument='$USDJPY' Action=Sell Limit price=103.75 Stop price=0 Quantity=1,000 Type=Limit Filled=0 Fill price=0 Error=NoError Native error='',
      4/22/2008 10:46:44 AM,Execution,Execution='NT_20080422_0147' Instrument='$USDJPY' Account='E5568100' Exchange=Default Price=103 Quantity=1,000 Market position=Short Operation=Insert Order='0xk0101:0du1' Time='4/22/2008 10:46:44 AM' Multiplier=0.001 Rate=0.00970968055150986,
      4/22/2008 10:46:44 AM,Position,Instrument='$USDJPY' Account='E5568100' Avg price=103.046 Quantity=1,000 Market position=Long Operation=Remove Currency=UsDollar,

      Comment


        #4
        The logs would not indicate 30 minutes early since the time stamp would then be 11:30:XX and not 11:34XX.

        Can you double check that you have not hard coded some setting in your strategy for exit on close that would override the default setting of 30 seconds?
        RayNinjaTrader Customer Service

        Comment


          #5
          I searched by "exit" and "close" and there's nothing related to "exit on close" in my script.

          Based on the help, there's two related properties. ExitOnClose and ExitOnCloseSeconds. But my strategy never refers to them. What else could possibly create this bizarre behavior?

          It must be running off of the defaults.

          Sincerely,
          Wayne

          Comment


            #6
            Hmm. This is quite an odd case. Do you mind emailing me your strategy so I can test it out on my end? Thanks. josh[at] ninjatrader dot com
            Josh P.NinjaTrader Customer Service

            Comment


              #7
              Hi wayneFH,

              I've examined your strategy for a bit and was not able to find anything. The only thing that strikes me is that you basically rewrote all the entry methods with your own helper methods. I would put my suspicions around that area. Unfortunately this is beyond the scope of support we can offer. Please try testing for yourself the SampleMACrossOver strategy for ExitOnClose functionality. You should find that it works as expected.
              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
              670 views
              0 likes
              Last Post Geovanny Suaza  
              Started by Geovanny Suaza, 02-11-2026, 05:51 PM
              0 responses
              379 views
              1 like
              Last Post Geovanny Suaza  
              Started by Mindset, 02-09-2026, 11:44 AM
              0 responses
              111 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
              581 views
              1 like
              Last Post RFrosty
              by RFrosty
               
              Working...
              X