• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Management system rejecting requests / failed cancellations

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

    Order Management system rejecting requests / failed cancellations

    Hi,

    quick question on the attached error, I think I *may* have solved by amending the ExitShort and ExitLong methods Ive been using, does the error below ever correspond to the strategy attempting to update a position during stoppages in trading etc?

    My question is essentially, during the market pause when the regular session ends and the extended session begins 3:15pm-3:30pm , how does the strategy handle rejections? Do I need to manually account for this, or should Ninjatrader be aware of this based on the predefined instrument trading hours?

    I want to make sure it copes with this gracefully, as , as you can see in the screenshot, I had a case where an order cancellation failed, which led to a position that was completely unmanaged with no risk management whatsoever on it.

    When I unlocked the strategy and began to develop it further in the Ninjascript editor, I notice the scheme for ExitLong for example was:

    ExitLong(string signalName, string fromEntrySignal);

    I originally had the below:

    ExitLong("<NAME OF THE EXIT HERE>", "<NAME OF THE ENTRYSIGNAL HERE>)

    Ive since amended these to simply :

    ExitLong("<NAME OF ENTRY HERE>);

    as per examples in the NT8 referencebase.

    should I have any other concerns? or does the above cover it? thanks.
    (Time is in GMT, subtract 5 hours for Eastern time!)

    #2
    Hello Conall,

    Thank you for the post.

    By default the strategy will not handle rejections, you will see a popup message and the script disables. You can change this using the settings shown in the following link:

    https://ninjatrader.com/support/help...orhandling.htm

    In regard to ExitLong, that really depends on the use case, you can use it in quite a few ways:

    Code:
    ExitLong()
    ExitLong(int quantity) 
    ExitLong(string fromEntrySignal)
    ExitLong(string signalName, string fromEntrySignal)
    ExitLong(int quantity, string signalName, string fromEntrySignal)
    If what you changed to is working, likely your logic is allowing for that use case. The other overload patterns are there to provide flexibility in case the one you used did not fit in with your design pattern. Some users may need to define quantities that always apply or only use one entry, others use multiple entries and the SignalName system so it really depends on the situation. If you only have 1 entry, you don't need to use a SignalName here, the target is smart to know that when using the overload without the signal name. The overload you were using defined a specific name for the target which makes it easier to find later from OnExecutionUpdate or OnOrderUpdate.



    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse, the problem persists. Ive isolated the problem to how my trailing stop is being handled, see attached. Should I log a ticket for this, or what is the best plan to resolve? I feel like this is as simple as the trailing stop can get, am I overlooking something?

      Only 1 lot is being traded at any one time.

      Variable declarations are setup as below:

      Code:
      protected override void OnStateChange()
              {
                  if (State == State.SetDefaults)
                  {
                      Description                                    = @"DEVPROG";
                      Name                                        = "TurtleSystem1StrategyOriginal";
                      Calculate                                    = Calculate.OnBarClose;
                      EntriesPerDirection                            = 1;
                      EntryHandling                                = EntryHandling.AllEntries;
                      IsExitOnSessionCloseStrategy                = true;
                      ExitOnSessionCloseSeconds                    = 30;
                      IsFillLimitOnTouch                            = false;
                      MaximumBarsLookBack                            = MaximumBarsLookBack.TwoHundredFiftySix;
                      OrderFillResolution                            = OrderFillResolution.High;
                      Slippage                                    = 1;
                      StartBehavior                                = StartBehavior.ImmediatelySubmitSynchronizeAccount;
                      TimeInForce                                    = TimeInForce.Gtc;
                      TraceOrders                                    = false;
                      RealtimeErrorHandling                        = RealtimeErrorHandling.StopCancelClose;
                      StopTargetHandling                            = StopTargetHandling.PerEntryExecution;
                      BarsRequiredToTrade                            = 20;
                      // Disable this property for performance gains in Strategy Analyzer optimizations
                      // See the Help Guide for additional information
                      IsInstantiatedOnEachOptimizationIteration    = true;
                      Trailing_Stop                            = 25.0;
                  }
      Trailing stops are setup as below:


      Code:
      else if (State == State.Configure)
                  {
                      //Sets a trailing stop
                      SetTrailStop(CalculationMode.Ticks, Trailing_Stop);
      
                  }

      Comment


        #4
        Hello Conall,

        Thank you for your reply.

        To continue troubleshooting this specifically I will likely need to review the log and trace files in addition to the script. Can you send an email to platform support [at] ninjatrader.com and attach the strategy along with your log and trace files?
        https://ninjatrader.com/support/help...tAsSourceFiles


        Please follow the steps below to manually attach your log and trace files to your response so I may investigate this matter further.
        1. Open Windows File Explorer (hotkey = Windows key + E) Then navigate to Documents > 'NinjaTrader 8' folder
        2. Right click on the 'log' and 'trace' folders and select Send To> Compressed (zipped) Folder.
        3. Send the 2 compressed folders as attachments to this email.
        4. Once complete, you can delete these compressed folders.
        Please also include a link to this post in your email.


        I look forward to being of further assistance.
        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by FMtrader, 03-15-2019, 02:30 AM
        6 responses
        31 views
        0 likes
        Last Post James108  
        Started by timko, Today, 08:18 AM
        0 responses
        0 views
        0 likes
        Last Post timko
        by timko
         
        Started by victorsmith, Today, 06:00 AM
        0 responses
        3 views
        0 likes
        Last Post victorsmith  
        Started by sohailashraf, Yesterday, 10:18 PM
        0 responses
        6 views
        0 likes
        Last Post sohailashraf  
        Started by jjnc2006, Yesterday, 07:36 PM
        0 responses
        15 views
        0 likes
        Last Post jjnc2006  
        Working...
        X