• 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

Closed Orders

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

    Closed Orders

    I accidentally disabled a strategy that had an opened position, stop and limit order. When I enabled it again, it cancelled the stop and limit order. How can I prevent that? Is this normal behavior?

    Thanks!!

    #2
    Hello GibbsB613,

    Thanks for writing in to our Support team.

    This is most likely occurring due to certain exit conditions you have defined in your strategy and the logic you have defined for setting your profit target and stop loss values. Could you provide me a sample of your code pertaining to the order entry logic so that I can investigate this further?

    Also, can you clarify if the orders were cancelled after you disabled your strategy or only when you re-enabled it?

    I look forward to your reply.
    Alan S.NinjaTrader Customer Service

    Comment


      #3
      As stated in my original post:

      When I enabled it again, it cancelled the stop and limit order.

      What part of the code do you need to see?

      Thanks!!

      Comment


        #4
        Hello GibbsB613,

        Thanks for your reply.

        I would need to see any sections pertaining to setting stop losses or profit targets and any entry/exit logic to enter/exit a position.

        I look forward to your reply.
        Alan S.NinjaTrader Customer Service

        Comment


          #5
          else if (State == State.Configure)
          {
          AddDataSeries(Data.BarsPeriodType.Minute, 240);
          SetProfitTarget("", CalculationMode.Pips, 250);
          SetStopLoss("", CalculationMode.Pips, 50, false);
          }

          This is how they are set. The exit logic is moot since it never gets to execute. But just as an FYI, I dont have any exit logic, I adjust my stop and limit and allow them to be hit. The entry is just MA crossovers.

          Thanks!!!

          Comment


            #6
            Hello GibbsB613,

            Thanks for your reply.

            Please send me your log and trace files so that I can investigate this further.

            You can do this by going to the Control Center-> Help-> Mail to Platform Support.

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

            Please reference this forum thread by including this link in the body of the email and make the subject ATTN Alan S:
            http://www.ninjatrader.com/support/f...ad.php?t=99083

            I look forward to your reply.
            Alan S.NinjaTrader Customer Service

            Comment


              #7
              Hello GibbsB613,

              Thank you for sending me those files and for your patience.

              This behavior is occurring because you are using StartBehavior.WaitUntilFlat. With this StartBehavior, the strategy will check for any active orders previously generated by the strategy on your account and cancel those first. You can find documentation on StartBehavior.WaitUntilFlat here:
              http://ninjatrader.com/support/helpG...#WaitUntilFlat

              I would recommend using using StartBehavior.ImmediatelySubmit - using this will check for previously generated orders and attempt to match the active strategy order when the order action, order type, quantity, limit price, and stop price are exactly identical. You can find detailed documentation on StartBehavior.ImmediatelySubmit here:
              http://ninjatrader.com/support/helpG...ediatelySubmit

              Please let me know if I may be of any further assistance.
              Alan S.NinjaTrader Customer Service

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by uiwislth, Yesterday, 11:25 PM
              0 responses
              4 views
              0 likes
              Last Post uiwislth  
              Started by Steve L, Yesterday, 10:04 PM
              0 responses
              3 views
              0 likes
              Last Post Steve L
              by Steve L
               
              Started by marianfed, Yesterday, 09:47 PM
              0 responses
              4 views
              0 likes
              Last Post marianfed  
              Started by hir04068, Yesterday, 09:29 PM
              0 responses
              2 views
              0 likes
              Last Post hir04068  
              Started by iq200, 03-11-2018, 07:49 PM
              24 responses
              1,017 views
              0 likes
              Last Post mrlucky1x  
              Working...
              X