Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit Target Causes platform to crash

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

    Profit Target Causes platform to crash

    Sometimes When I use a strategy that has a profit target (built in) if it blows past the profit target too fast the chart will stop printing data and unrealized gains will short for example $50 but when I reset the platform (because the platform stops working correctly so I have to) It shows it closed the trade when it hit the profit. Please help in dealing with this issue
    12/4/2024 3:44:50 AM Order APEX-131860-1, Cancellation rejected by the Order Management System - Order is complete. Further cancellations on this order may lead to logoff/disable affected Order: Buy 2 Limit @ 21370.75
    12/4/2024 3:44:50 AM Default Strategy 'TX5/344365146': An overfill was detected on order 'orderId='1935164468' account='APEX-131890-70' name='Long Entry' orderState=CancelSubmitted instrument='MNQ 12-24' orderAction=Buy orderType='Limit' limitPrice=21370.75 stopPrice=0 quantity=2 tif=Gtc oco='' filled=2 averageFillPrice=21370.75 onBehalfOf='' id=3990 time='2024-12-04 03:44:50' gtd='2099-12-01' statementDate='2024-12-04''. The strategy will be disabled and NinjaTrader will attempt to cancel/close any strategy generated orders and positions. Please check your account orders and positions and take any appropriate action.
    Last edited by rickyblah12; 12-04-2024, 02:53 AM.

    #2
    Hello rickyblah12,

    To confirm, the entire platform is crashing instead of the strategy being disabled?

    The entire platform instantly shuts down?


    An overfill means an order was attempted to be cancelled that has already filled.
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    This should be causing the strategy to be disabled, but the entire platform instantly shutting down would be unexpected.
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      the platform doesnt crash but the data stops loading because the order got stuck so the only way to get the data running again is by restarting the program and it deletes log files when I turn it back on

      Comment


        #4
        Hello rickyblah12,

        Thank you for confirming the platform is not experiencing a crash.

        The overfill was on the order 'Long Entry' and not a profit target submitted with SetProfitTarget().

        There may have been multiple cancellations to orders on the account.

        The error message from your brokerage warns:
        "Further cancellations on this order may lead to logoff/disable"

        Likely disconnecting and reconnecting (without having to restart the platform) would resume the connection.

        You may want to contact your broker and inquire if you can be allowed to have more overfills..

        You may also want to see if the logic for the cancelling of the 'Long Entry' can be improved. Are you checking the order state of this order is OrderState.Working or OrderState.Accepted before attempting to cancel the order?

        Have you enabled TraceOrders to see if the order is being cancelled automatically?
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Ok thank you I will Check Trace...would the orderstate.working be checked in onorderupdate or onexecutionupdate?

          Comment


            #6
            Hello rickyblah12,

            The order state should be checked before the order is cancelled one line above where it is cancelled.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by argusthome, 03-08-2026, 10:06 AM
            0 responses
            116 views
            0 likes
            Last Post argusthome  
            Started by NabilKhattabi, 03-06-2026, 11:18 AM
            0 responses
            61 views
            0 likes
            Last Post NabilKhattabi  
            Started by Deep42, 03-06-2026, 12:28 AM
            0 responses
            40 views
            0 likes
            Last Post Deep42
            by Deep42
             
            Started by TheRealMorford, 03-05-2026, 06:15 PM
            0 responses
            43 views
            0 likes
            Last Post TheRealMorford  
            Started by Mindset, 02-28-2026, 06:16 AM
            0 responses
            82 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Working...
            X