Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

StopCancelCloseIgnoreRejects does not honor rejected changes

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

    StopCancelCloseIgnoreRejects does not honor rejected changes

    Hi there,

    there is a problem with RealtimeErrorHandling = RealtimeErrorHandling.StopCancelCloseIgnoreRejects with unmanaged strategies.

    If I try to trail a Stop Loss in an Unmanaged Strategy and the market moves fast and my trailed stop price ends up on the wrong side of the market, resulting in a rejected change, this is not captured by StopCancelCloseIgnoreRejects. The strategy closes the position and shuts down.

    It would seem that the only way to handle this scenario is to use RealtimeErrorHandling.IgnoreAllErrors; which exposes my strategy to a huge amount of risk as any unexpected exception will be ignored. Should rejected order changes not be captured by StopCancelCloseIgnoreRejects ? I think they should be.


    #2
    One more question on this, if I may. I noticed that when an order is rejected that the State goes straight from ChangeSubmitted to Working, but there's an error string which contains "UnableToChangeOrder".

    In the interests of making my Unmanaged order handler broker agnostic; is this error string an internal Ninjatrader string or it it coming from CQG? i.e Is checking for the presence of this string a robust way for identifying failed order changes across all supported brokers?

    Thanks
    Attached Files
    Last edited by kevinenergy; 12-03-2018, 08:55 AM.

    Comment


      #3
      Hello kevinenergy,

      I've tested using a live demo and I was not able to reproduce this behavior using 8.0.16.3.

      Below is a link to a video of the test.
      https://drive.google.com/file/d/1xmEDZr26MSCTax2p6EpDktqY34UwFQId/view?usp=drivesdk

      May I confirm that if you changed this in code you have removed the instance of the script and added a new instance so that the default settings are pulled?

      If so, please send an email to platformsupport [at] ninjatrader [dot] com so that we may request your log and trace files.
      Last edited by NinjaTrader_ChelseaB; 12-03-2018, 09:09 AM.
      Chelsea B.NinjaTrader Customer Service

      Comment


        #4
        Hi Chelsea, I think you've mis-understood the issue. The problem is when you submit a stoploss order correctly. And then change the order price so that it is on the wrong side of the market.

        If you reverse the +/- 5 Ticks on your example so that the stops submit correctly, then drag them to the wrong side of the market via chart trader you will see that the Strategy does a StopCancelClose on the rejected order change.



        Originally posted by NinjaTrader_ChelseaB View Post
        Hello kevinenergy,

        I've tested using a live demo and I was not able to reproduce this behavior using 8.0.16.3.

        Below is a link to a video of the test.
        https://drive.google.com/file/d/1xmEDZr26MSCTax2p6EpDktqY34UwFQId/view?usp=drivesdk

        May I confirm that if you changed this in code you have removed the instance of the script and added a new instance so that the default settings are pulled?

        If so, please send an email to platformsupport [at] ninjatrader [dot] com so that we may request your log and trace files.

        Comment


          #5
          Hello kevinenergy,

          I was able to reproduce with a ChangeOrder() and the 'Unable to change order' message.

          I am further inquiring with our development if this is expected behavior for this realtime error handing type.

          I appreciate your patience.
          Chelsea B.NinjaTrader Customer Service

          Comment


            #6
            Hello kevinenergy,

            I've been informed this behavior is the expected and intended behavior. The unable to change error does not cause the order to be rejected, the order state of the order remains working (unless cancelled by the strategy being disabled).

            I've received tracking ID #SFT-3667 for unable to change failures to be excluded with the StopCancelCloseIgnoreRejects error handling.

            Please note it is up to the NinjaTrader Development to decide if or when any request will be implemented.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by kevinenergy, 02-17-2023, 12:42 PM
            117 responses
            2,765 views
            1 like
            Last Post jculp
            by jculp
             
            Started by Mongo, Today, 11:05 AM
            5 responses
            15 views
            0 likes
            Last Post NinjaTrader_ChelseaB  
            Started by SightCareAubetter, Today, 12:55 PM
            0 responses
            3 views
            0 likes
            Last Post SightCareAubetter  
            Started by traderqz, Today, 12:06 AM
            8 responses
            16 views
            0 likes
            Last Post traderqz  
            Started by SightCareAubetter, Today, 12:50 PM
            0 responses
            2 views
            0 likes
            Last Post SightCareAubetter  
            Working...
            X