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

Multi-Instrament Strategy Target & Cancel Orders Cancel Automaticly

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

    Multi-Instrament Strategy Target & Cancel Orders Cancel Automaticly

    I have a multi-Instrument Strategy where I specifiy a generic percent Target and StopLoss. I specify in State== State.Configured. It look like this:

    else if (State == State.Configure)
    {

    SetStopLoss( CalculationMode.Percent, PStopLoss);
    SetProfitTarget(CalculationMode.Percent, PTargetProfit);

    The Order are all place correctly but after a few minutes I will hear "Order Cancelled". Its the Target and Cancelled orders that automatically cancel for some reason. Would anyone know any reason that would happen. I have set TraceOrders = True but this has not help me find out what is happening.

    #2
    Hello [email protected],

    Thank you for your post.

    Based on your code and details I would not expect a cancel to occur. 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.

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

    I look forward to your response.

    Comment


      #3
      Hello,
      I have exactly the same issue with SetProfitTarget in multi instrument strategy. As soon as the entry order is executed, the profit target is sent, but then the order is canceled. The sequence given in the Log tab is always the same : submitted, working, accepted, cancel submitted and finally cancelled.
      I have first experienced this on the IB paper trading account, but there is exactly the same behaviour on Playback101.
      The code is very basic :

      Code:
      if (State == State.Configure) {
         AddDataSeries("EURUSD", BarsPeriodType.Minute, 5 );
         SetProfitTarget(SIGNAL_NAME_ENTRY_LONG, CalculationMode.Pips, 5);
      }
      OnBarUpdate() {
         ...
          EnterLong( 1, FOREX_QUANTITY, SIGNAL_NAME_ENTRY_LONG );
         ...
      }
      When using "TraceOrders = true" one can see in the log window :
      Code:
      [...]   Strategy   [...]   Cancelled expired order: BarsInProgress=1, [...]
      So it is as if the strategy believes the Profit Target order is expired.

      If EnterLong is sent on the main instrument, everything works ok, i.e. the Profit Target order is not cancelled.

      I have also tried to check the BarsInProgress in OnBarUpdate to send the EnterLong only when the BarsInProgress is 1, but it changes nothing.

      There is probably an issue here.

      Thanks.
      Last edited by fpa75; 03-12-2017, 04:42 AM.

      Comment


        #4
        Hello fpa75,

        Thank you for your post on this matter.

        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.

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

        I look forward to your response.

        Comment


          #5
          Hello Patrick,
          I have just sent the email with some details.
          Best regards,
          Fabrice

          Comment


            #6
            Hello,
            After more than 2 months, I still haven't any news from you for this serious issue.
            Regards.

            Comment


              #7
              Hello fpa75,

              Thank you for your update on this matter.

              After we received your log and trace files we sent the following response but did not receive a response from your email. We contacted you via platformsupport[at]ninjatrader[dot]com as well as my direct email.
              Hello,

              Thank you for your patience.

              Would it be possible to view the full strategy?

              Based on your detail and what I see in the Log the order should not be cancelled.

              You can export your strategy by going to Tools > Export > NinjaScript Add On > Add > select your strategy > OK > Export > name the file 'NTsupport' > Save.

              The file will be located under Documents\NinjaTrader 8\bin\Custom\ExportNinjaScript. Please attach the file to your response.

              I look forward to your response.
              Sometimes our support emails can get blocked by firewalls/spam filters. If this is the case please unblock NinjaTrader so we may better assist you.
              Can I verify, did you receive our previous email or resolve your inquiry?

              I look forward to your response.

              Comment


                #8
                Hi NT,

                I believe this has to do with the Time In Force setting on the non-native symbols of a multi instrument chart. I am testing and see the same result.

                Testing on a 1 minute chart, the target / stop are canceled at the close of the bar. This only occurs on a symbol that is not the chart you apply the strategy to.

                Is there a way to set the Time In Force on additional data series when using a multi instrument strategy?
                mrlogik
                NinjaTrader Ecosystem Vendor - Purelogik Trading

                Comment


                  #9
                  Hello mrlogik,

                  Thanks for your note.

                  I believe I am in contact with one of your clients on this matter. I would like to review this matter with an example strategy that demonstrates the issue.

                  I had asked for the strategy and some steps I can take to reproduce so I can look into the TimeInForce matter and report it further. If you have a simplified strategy that can do this and has some steps I can take, I would greatly appreciate it.

                  Could I reproduce this in Market Replay or would I need to look at this on a paper trading account?

                  There isn't an overload for specifying a TIF for an added data series, and it does not look like you can specify a TIF in the Unmanged approach. There is a TimeInForce property that can be set, but I can foresee issues for submitting orders to a different data series when attempting to change this on a BarsInProgress change for example.

                  I will be happy to assist you further and provide any further input.
                  Last edited by NinjaTrader_Jim; 09-12-2017, 10:39 AM.
                  JimNinjaTrader Customer Service

                  Comment


                    #10
                    Hi Jim,

                    Yes, I believe you are.

                    You can reproduce this using the standard SIM101 account, as well as Replay. I am not using an unmanaged approach; I am simply using EnterLong / EnterShort, and SetProfitTarget / SetStopLoss.

                    You can use the standard MultiInstrument Strategy sample NT provides for NT8 and see this occur. I have asked my client to send you the code so you can test this on your end.
                    mrlogik
                    NinjaTrader Ecosystem Vendor - Purelogik Trading

                    Comment


                      #11
                      Hello everyone,

                      This issue has been designated as a bug and is being tracked with the ticket ID NTEIGHT-12118.

                      When a fix is implemented in a new build of NinjaTrader, you can reference the ticket ID in the Release Notes page of the Help Guide.

                      Release Notes - https://ninjatrader.com/support/help...ease_notes.htm
                      JimNinjaTrader Customer Service

                      Comment


                        #12
                        Hello Jim,

                        Has this bug been fixed or am I missing something? I am facing the exact same issue, protective orders created using Set commands are being cancelled.
                        I already opened a new thread on this as I did find this one until today.

                        Hi NinjaTraders, I am using Managed approach for order submission - Submitting EnterLongLimit order on 15 minute dataseries so that order is cancelled if not filled before the close of the bar on which it was submitted. This is working very well - as expected. However, along with EnterLongLimit order, strategy is sending Stop


                        Thank you,

                        Comment


                          #13
                          Hello Paco0,

                          NTEIGHT-12118 was fixed in NinjaTrader 8 version 8.0.11.1. I have repeated the test case for this issue and we are not seeing the same symptoms we reported back in 2017. What you are encountering may be a separate issue. Please continuing to work with NinjaTrader_Chelsea to provide context to reproduce the behavior you are witnessing on our end so we can assist further.

                          Please let me know if you have any questions.
                          JimNinjaTrader Customer Service

                          Comment

                          Latest Posts

                          Collapse

                          Topics Statistics Last Post
                          Started by sightcareclickhere, Today, 01:55 PM
                          0 responses
                          1 view
                          0 likes
                          Last Post sightcareclickhere  
                          Started by Mindset, 05-06-2023, 09:03 PM
                          9 responses
                          258 views
                          0 likes
                          Last Post ender_wiggum  
                          Started by Mizzouman1, Today, 07:35 AM
                          4 responses
                          18 views
                          0 likes
                          Last Post Mizzouman1  
                          Started by philmg, Today, 01:17 PM
                          1 response
                          8 views
                          0 likes
                          Last Post NinjaTrader_ChristopherJ  
                          Started by cre8able, Today, 01:01 PM
                          1 response
                          9 views
                          0 likes
                          Last Post NinjaTrader_ChelseaB  
                          Working...
                          X