Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 rocketman7, Today, 02:12 AM
            5 responses
            22 views
            0 likes
            Last Post rocketman7  
            Started by trilliantrader, 04-18-2024, 08:16 AM
            7 responses
            28 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by samish18, 04-17-2024, 08:57 AM
            17 responses
            66 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Started by briansaul, Today, 05:31 AM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_Jesse  
            Started by PaulMohn, Today, 03:49 AM
            1 response
            12 views
            0 likes
            Last Post NinjaTrader_BrandonH  
            Working...
            X