• 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

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.
    Patrick H.NinjaTrader Customer Service

    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.
        Patrick H.NinjaTrader Customer Service

        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.
              Patrick H.NinjaTrader Customer Service

              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

                      Latest Posts

                      Collapse

                      Topics Statistics Last Post
                      Started by pjsmith, Today, 05:21 AM
                      0 responses
                      2 views
                      0 likes
                      Last Post pjsmith
                      by pjsmith
                       
                      Started by gbux11, Today, 02:41 AM
                      2 responses
                      8 views
                      0 likes
                      Last Post MicroTrends  
                      Started by Tiang, Today, 04:23 AM
                      0 responses
                      4 views
                      0 likes
                      Last Post Tiang
                      by Tiang
                       
                      Started by TazoTodua, Today, 01:50 AM
                      0 responses
                      6 views
                      0 likes
                      Last Post TazoTodua  
                      Started by lonestar, Today, 01:42 AM
                      2 responses
                      7 views
                      0 likes
                      Last Post lonestar  
                      Working...
                      X