Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Quantity and GAPs

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

    Order Quantity and GAPs

    I want to backtest an EOD strategy and asking myself how to handle GAPs when calculating the order quantity. When OnBarUpdate() is executed, the Open-Price of the next bar is not yet available. A quantity calculation based on Close[0] may be wrong in case of GAPs. Is there a way to pass the amount of money instead of the quantity to the order functions. A limit is not a solution, because the trade shall be executed even if the limit is not reached again.

    #2
    tbmuc,

    Which order functions are you using?

    What do you mean by "pass the money instead of quantity" here?

    I look forward to helping you resolve your issue.
    Adam P.NinjaTrader Customer Service

    Comment


      #3
      I ' m using e.g. EnterLong and want to buy Stocks for a fixed amount, e.g. 10000$.
      When I calculate quantity=10000/Close[0] and there is a GAP of 3%, the quantity shall be reduced by 3%.
      Im looking e.g. for a funktion, that has a currency as pasameter EnterLong(10000$);

      Comment


        #4
        tbmuc,

        Unfortunately there is no way to currently do this. You would need to perform the calculation for the quantity using some other method.

        You could try using a COBC = false strategy and then separate logic by tick and by closing of the bar, then submit an order on the 1st tick of a new bar, checking for Close[0] then.



        Please let me know if I may assist further.
        Adam P.NinjaTrader Customer Service

        Comment


          #5
          Does that work for backtesting long periods (e.g. EOD data)?

          Comment


            #6
            tbmuc,

            Unfortunately you would need intraday data for this.

            You can submit orders to different Bars objects. This allows you the flexibility of submitting orders to different timeframes. Like in live trading, taking entry conditions from a 5min chart means executing your order as soon as possible instead of waiting until the next 5min bar starts building. You can achieve this by


            Please let me know if I may assist further.
            Adam P.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            633 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            364 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            105 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            567 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            568 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X