Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Real Time Order Execution Issue

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

    Strategy Real Time Order Execution Issue

    I worked on Strategy based on a sample ninja script of scaling out method available here on Ninja smaple strategies.
    I made some changes for order entry to be current bid/ ask price offset by 1 tick.
    The strategy worked fine for most of the time apart from the fact that sometimes it automatically cancels my orders. It places the order and after couple of seconds the order gets cancelled. I was wondering what the resaon could be. Is there a timeline that if the order doesn't get executed it cancels itself? Could it be something else.
    I have just one strategy working on one instrument and nothing else...
    Thanks

    #2
    Hi funky200881,

    The default behavior of orders is that they're cancelled unless they're filled on the bar they're submitted to. Orders are kept alive provided that they are re-submitted on each call of the OnBarUpdate() method. If the order is not re-submitted, the order is then cancelled.

    You can also use the advanced overlord available with all Enter and Exit methods, that allows you to set liveUntilCancelled property = true.

    EnterLongLimit(int barsInProgressIndex, bool liveUntilCancelled, int quantity, double limitPrice, string signalName)
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thankd for the information Ryan...Its really helpful...
      I have another query...
      The strategy uses Bollinger Bands as an indicator... i want to add something where strategy works differently on trending market and ranging market...what can I add that will change the action based on state of Bollinger band...
      Or to make it simple what can I do to incorporate the Bollinger_TripleState_v4indicator criteria into the strategy...

      Comment


        #4
        You're welcome. I'm glad to assist here.

        what can I add that will change the action based on state of Bollinger band...
        For this you have to be objective on what is the "state" of a Bollinger band. A Bollinger Band is only a value, so there's no inherent state associated with it. You could use Rising() or Falling(), for example, which check a value against its previous value.

        Bollinger_TripleState_v4indicator criteria into the strategy.
        Unfortunately I'm not familiar with this indicator so I'm not sure how it arrives at the state changes using it either. If you have the source code, you could copy the appropriate conditions of a specific state into your entry conditions as they pertain to long or short order.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          I was thinking about adding the rising and falling before...
          the only reservation I have is that it might keep adding positions in a trending market... anyways i will try it...
          so basically i will have 3 conditions here...rising, falling or nothing....based on all three i will add my further sub conditions and actions...

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          646 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          367 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          569 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X