Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ninja Traders 8 - Problems with Order Handling

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

    Ninja Traders 8 - Problems with Order Handling

    I am seeing issues with Order Handling recently with NinjaTrader 8. I am trading FOREX using a live account.

    Problems appear to be with OCO oder handling.
    Strated happening since Monday. Had already tow occurnace.
    How do I prevent this issue from happening.

    How do I cancel the pending order this is currently stuck ( Issue 2)


    I faced two issues:

    1) Yesterday I received an error message "Order Rejected"

    6/18/2018 02:15 Default Disabling NinjaScript strategy 'ABCD'

    6/18/2018 02:15 Order Order='57464a8c06ed4becb45ee4aec937b87c/401308720' Name='Close position' New state='Rejected' Instrument='EURUSD' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=5,000 Type='Market' Time in force=GTC Oco='' Filled=0 Fill price=0 Error='Order rejected' Native error='Another instruction has already made changes to the trades and orders. '

    6/18/2018 02:15 Default Strategy 'ABCD' submitted an order that generated the following error 'Order rejected'. Strategy has sent cancel requests, attempted to close the position and terminated itself.

    I saw the strategy was disabled but the position was left open. I was able to close the position from the Control Center.



    2) Today I am facing another issue

    I was trying to close a position and NT8 reported a timeout error. The position remained open. I was able to close it from the Control Center but the StopLoss Order is still open in Cancel Pending state.


    6/19/2018 07:29 Position Instrument='EURUSD' Account='1234' Average price=0 Quantity=0 Market position=Flat Operation=Remove

    6/19/2018 07:29 Execution Execution='638832049' Instrument='EURUSD' Account='1234' Exchange=Default Price=1.15642 Quantity=5,000 Market position=Long Operation=Operation_Add Order='638832049' Time='6/19/2018 07:29'

    6/19/2018 07:29 Order Order='638832049/1234' Name='Close' New state='Filled' Instrument='EURUSD' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=5,000 Type='Market' Time in force=DAY Oco='' Filled=5000 Fill price=1.15642 Error='No error' Native error=''


    6/19/2018 07:29 Order Order='638832049/1234' Name='Close' New state='Working' Instrument='EURUSD' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=5,000 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''


    6/19/2018 07:29 Order Order='638832049/1234' Name='Close' New state='Accepted' Instrument='EURUSD' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=5,000 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''


    6/19/2018 07:29 Order Order='638832049/1234' Name='Close' New state='Submitted' Instrument='EURUSD' Action='Buy to cover' Limit price=0 Stop price=0 Quantity=5,000 Type='Market' Time in force=DAY Oco='' Filled=0 Fill price=0 Error='No error' Native error=''

    6/19/2018 07:29 Position Close operation failed. Operation timed out. Manually close your position


    6/19/2018 07:28 Order Order='638708575/1234' Name='Profit target' New state='Cancelled' Instrument='EURUSD' Action='Buy to cover' Limit price=1.14746 Stop price=0 Quantity=5,000 Type='Limit' Time in force=GTC Oco='638708560' Filled=0 Fill price=0 Error='No error' Native error=''


    6/19/2018 07:28 Order Order='638708575/1234' Name='Profit target' New state='Cancel submitted' Instrument='EURUSD' Action='Buy to cover' Limit price=1.14746 Stop price=0 Quantity=5,000 Type='Limit' Time in force=GTC Oco='638708560' Filled=0 Fill price=0 Error='No error' Native error=''


    6/19/2018 07:28 Default Disabling NinjaScript strategy 'ABCD'
    6/19/2018 07:28 Strategy Disabled strategy='ABCD'

    #2
    Hello ajsdnyyrr1234DDf,

    Thank you for your post.

    CRITICAL — If your inquiry involves live orders, please always reach out to your broker's Orders Desk immediately to confirm and manage your live orders and positions.

    If your trades are with NinjaTrader Brokerage, you can contact NinjaTrader Brokerage Order Desk here:
    Phone: 312.423.2234
    Email: orders[at]ninjatrader[dot]com


    Order that are stuck need to be handled with your brokerage. Once they have handled the order the order should not be present on a subsequent restart of the NinjaTrader platform.

    Please send me your log and trace files so that I may look into what occurred.

    You can do this by going to the Control Center-> Help-> Email Support

    Ensuring 'Log and Trace Files' is checked will include these files. This is checked by default.

    Please place 'ATTN: Patrick H' in the subject line and reference this thread in the body of the email.

    Comment


      #3
      I have e-mailed you the logs etc.
      The Cancel Order was cleared after I restarted NinjaTrader.

      I trade live and my connection is FOREX.com. Does that mean my brokerage is with FOREX.com or with NinaTrader?

      Comment


        #4
        Hello ajsdnyyrr1234DDf,

        Thank you for your response.

        You would reach out to the FCM (FOREX.com) in that case.

        Comment


          #5
          Hello ajsdnyyrr1234DDf,

          Thank you for your patience.

          On the first item with the rejection message. This would be specific to the brokerage technology for your account. You would need to reach out to them on why the order was rejected with the message 'Another instruction has already made changes to the trades and orders'.

          I reviewed your Log and Trace and I see no other attempt to make changes to the trades or orders for the EURUSD at the time of the message.

          The second item that occurred today is another native message to the brokerage technology. 'Close operation failed. Operation timed out. Manually close your position', please reach out to your brokerage on these messages.

          Please let me know if you have any questions.

          Comment


            #6
            When I was dealing with NinjaTrader license fees with sales, I had received the following communication from Dan, but you seem to indicate that NinjaTrader is not the brokerage but FOREX.com. Could you please clarify?. Based on my understanding FOREX.com/GAIN is a clearinghouse and NinjaTrader is the brokerage.

            =======================================

            Raj,

            GAIN Capital is simply your clearing firm. They just hold your funds and clear your trades, nothing more. So as far as GAIN goes, you wouldn’t need a “demo on GAIN” because there is nothing to test out. Your brokerage account would be fully serviced by NinjaTrader Brokerage.

            Please let me know if this helps at all.

            Sincerely,
            Dan Scheckel | Inside Sales Associate | NinjaTrader, LLC
            [email protected] | www.ninjatrader.com

            =============================================

            Comment


              #7
              Hello ajsdnyyrr1234DDf,

              Thank you for your response.

              I am incorrect here then. Please defer to the information from the NinjaTrader Brokerage team.

              Comment


                #8
                Thanks. I submitted a request from the NinjaTrader web site.
                Brokerage Account Support Request {307178}

                Comment


                  #9
                  Hello,

                  Thank you for your patience. I have sent this to your email as well.

                  NinjaTrader Brokerage has sent your inquiry back to me as FOREX.com handles the order messages and why they occur. Please reach out to them directly for information on the orders and messages.

                  I do have some details on these messages that I can provide.
                  1. 'Another instruction has already made changes to the trades and orders'
                    This is due to the G2 adapter used in FOREX.com. This occurs when multiple attempts to change the order are seen in quick succession. FOREX.com will have further details on exactly why this occurred in your case on the 18th.
                  2. 'Close operation failed. Operation timed out. Manually close your position'
                    This occurs when the close operation is currently running and another attempt to close the position occurs. This would be expected in the case that you attempt to close the position manually while a close operation was occurring. Were you attempting to close the position manually on the 19th?

                  I look forward to your response.

                  Comment


                    #10
                    Thanks for your response.

                    Yes for Issues (2) I closed the position manually.

                    I will reach out to FOREX.com support and ask for help.

                    I might have a theory as to why this might be happening.

                    I use managed orders and StopTargetHandling.ByStrategyPosition in my strategy.
                    And I have

                    EntriesPerDirection = 1;
                    EntryHandling = EntryHandling.AllEntries;

                    What I have seen happening is, when the market changes direction and I have a position open and the strategy trigged a trade in the opposite direction, then NinjaTrader submits a Close() and then opens a new position in the other direction. Sometimes what I see happen is the Close() is executed slower that the Entry Orders and the Entry Orders might have triggered a Close operation as it is in the opposite direction.

                    This is the second time I notice this behavior and I suspect this might be a timing issue within the NinjaTrader Strategy execution framework.

                    Do you have any idea why this might be getting triggered?

                    Comment


                      #11
                      Hello ajsdnyyrr1234DDf,

                      Thank you for your response.

                      I see the 'Close operation failed. Operation timed out. Manually close your position' message in your Log occur when the Close operation is created and the Stop Loss and Profit Target are attempting to cancel. Does your strategy reverse position and use SetStopLoss() and SetProfitTarget()?

                      I look forward to your response.

                      Comment


                        #12
                        I don't have anything specific in my strategy to reverse position. I use the NinjaTrader attribute StopTargetHandling.ByStrategyPosition to do that. When the market direction changes, and if the strategy sees a signal, it calls the EnterLong() or EnterShort() based on the signal. And yes, I use SetStopLoss() and SetProfitTarget(). If the strategy didn't detect a signal then the trade exists on a StopLoss whenever it hits the StopLoss.

                        Comment


                          #13
                          Originally posted by ajsdnyyrr1234DDf View Post
                          I don't have anything specific in my strategy to reverse position. I use the NinjaTrader attribute StopTargetHandling.ByStrategyPosition to do that. When the market direction changes, and if the strategy sees a signal, it calls the EnterLong() or EnterShort() based on the signal. And yes, I use SetStopLoss() and SetProfitTarget(). If the strategy didn't detect a signal then the trade exists on a StopLoss whenever it hits the StopLoss.
                          You can check the logs from June 18 - ' Another instruction has already made changes to the trades and orders'. Here I noticed the market changed direction and a trade was placed in the opposite direction but the Close in the original direction was reported as failed. This error was particularly concerning to me because when I checked the system, the position was still open with no protective orders and the Strategy was disabled.

                          Comment


                            #14
                            Hello ajsdnyyrr1234DDf,

                            Thank you for your response.

                            That would be a reversing strategy as you describe and as I was thinking it may be. I agree that I see the same behavior here.

                            Do you see this consistently during the reversals of positions? Or was this the first occurrence of this message?

                            I look forward to your response.

                            Comment


                              #15
                              This is the first time I encountered this issue. I didn't see this on backtests. I have been running the strategy for more than a week now and I think it might be the only time it encountered a pure reversal.

                              I will keep it running and report if I encounter the same again.
                              Do you think this is a defect?

                              Comment

                              Latest Posts

                              Collapse

                              Topics Statistics Last Post
                              Started by frslvr, 04-11-2024, 07:26 AM
                              9 responses
                              123 views
                              1 like
                              Last Post caryc123  
                              Started by rocketman7, Today, 09:41 AM
                              4 responses
                              15 views
                              0 likes
                              Last Post rocketman7  
                              Started by selu72, Today, 02:01 PM
                              1 response
                              9 views
                              0 likes
                              Last Post NinjaTrader_Zachary  
                              Started by WHICKED, Today, 02:02 PM
                              2 responses
                              16 views
                              0 likes
                              Last Post WHICKED
                              by WHICKED
                               
                              Started by f.saeidi, Today, 12:14 PM
                              8 responses
                              21 views
                              0 likes
                              Last Post f.saeidi  
                              Working...
                              X