Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Multi bar series and order cancels

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

    Multi bar series and order cancels

    Hi,

    I'm wondering if I'm doing something dopey or not.

    My usual approach to strategy development is to first start with static historical data, move to sim101 and then to a live trading account. A good deal of my development work requires looking inside bars, so of course I use multi bar series. Usually I have, say, a Range bar as the primary series, and then add a 1 Tick secondary series. This lets me backtest on a tick by tick basis and works quite well. The strategy inevitably works nicely on sim101 also.

    The problem is when I go live. Pretty much every time the script won't work as is, because once an order is submitted, a cancel order goes out on the very next tick, because orders get cancelled automatically if not filled on the next bar, and with that 1 Tick series present, the next tick is the next bar.

    I'm avoiding getting into keeping orders alive for longer than one bar, so what I do is basically rewrite the strategy by removing the secondary series and go COBC = false. This works, but now I have to keep track of and revise two separate strategy files.

    Any comments or suggestions?

    #2
    Coolmoss,

    Are you using the following syntax for order entry?

    EnterLong(int barsInProgressIndex, int quantity, string signalName)

    The barsInProgressIndex would allow you to submit an order against another time frame.

    Here is a help guide entry on Multi-series order handling : http://www.ninjatrader.com/support/h...r_handling.htm
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      Hi Adam,

      You know, I may have been making a mistake here. Can you please verify this: if multiple data series are present in a strategy, (say 10 range is primary and 1 tick is secondary) and the entry order is submitted on the primary (10 range) series, and I'm NOT using syntax including the barsinprogress on the entry order, then even though the order was submitted on the primary series, the secondary tick series will cause the order to be canceled at end of bar (which is the next tick for a 1 tick bar).

      But, if I use the barsinprogress syntax, the the order will be canceled (if not filled of course) at the end of the range (or primary) bar, not the tick bar?

      If so, that's just fantastic!

      Also, an unrelated question: if a custom timer event is employed (like in the sample code in the forum) will that only work on running a live strategy, or will a timer work on historical/backtested data also?

      thanks so much for your help

      Comment


        #4
        Coolmoss,

        Are you using the BarsInProgress filter before you enter the order? Generally, the bars in progress an order is submitted against would keep it tagged to that series, so it would wait until the bar closes for that series, not the other.

        Which reference sample are you referring to? A time filter will work on historical data. Something like DateTime.Now would not however.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          I wasn't using the bars in progress filter on the primary series, so maybe that's what I need to do.

          Thanks for info on the timer events.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          651 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          370 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          109 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          574 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          577 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X