• 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

Understanding Order Flow

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

    Understanding Order Flow

    Is there a link which explains how NT goes about entering/cancelling orders that a strategy generates?

    I am really wanting to understand the flow and timing of how this works, including when each method, OnBarClose and OnEachTick is used.

    #2
    Hello Trader_Mark,

    Thank you for your note.

    I have provided a link on OnOrderUpdate as well as order methods,

    https://ninjatrader.com/support/help...rderupdate.htm
    https://ninjatrader.com/support/help...er_methods.htm

    If you have any specific questions please let us know.
    Alan P.NinjaTrader Customer Service

    Comment


      #3
      Thank you for the links. Again, I am trying to understand the order that NT does everything once a strategy says conditions are currently true for placing an order.

      If my strategy is set to Calculate.OnEachTick, does my description in the picture accurately show what is happening? If so, why do I never see an entry order attempted until the next bar actually opens even if the conditions for an entry are true on the current bar? Can/should the order be placed before the bar closes and thus is there waiting when the next bar does open?
      Attached Files

      Comment


        #4
        Hello Trader_Mark,

        Historical orders when a strategy enabled are going to appear exactly as if Calculate was set to OnBarClose.

        When using backtesting the strategy will run exactly the same as if CalculateOnBarClose is set to true. This is true whenever the strategy runs on historical type data. The reason for this is because the only info known historically is the Bar open, High, Low and close and not all of the ticks that make up the bar. You can also get extremely misleading results if you are using a bar that changes shape such as renko bar type as the finished bar does not show the true range of price movement.

        Please see Discrepancies: Real-Time vs Backtest section of our helpguide.
        https://ninjatrader.com/support/help...ime_vs_bac.htm

        Adding a secondary data series of a smaller time duration would allow your strategy to enter/exit intra bar and give you results closer to market replay.

        Please see Backtesting NinjaScript Strategies with an intrabar granularity for a reference example on how you’d set this up.
        http://ninjatrader.com/support/forum...ead.php?t=6652

        Please let us know if you need further assistance.
        Alan P.NinjaTrader Customer Service

        Comment


          #5
          I never said anything about backtesting. I am running the strategy live. With Calculate.OnEachTick set, should the order(s) be placed even before the current bar closes?

          Comment


            #6
            Hello Trader_Mark,

            When running the strategy on live data, with calculate on each tick set to true, should your conditions become true, an order would be sent on the current bar.

            Please see the following section of our helpguide,
            http://ninjatrader.com/support/helpG...?calculate.htm

            Please let us know if you need further assistance.
            Alan P.NinjaTrader Customer Service

            Comment


              #7
              Originally posted by NinjaTrader_AlanP View Post
              When running the strategy on live data, with calculate on each tick set to true, should your conditions become true, an order would be sent on the current bar.
              Alan,

              Yes, but what happens is the order gets cancelled as soon as the current bar closes - so no chance to get filled.

              Remember, the order is placed on the current bar, I am wanting it to get filled or cancelled on the next bar.

              To recap, it is a range bar chart, bars will be 1 point in range. The strategy places an order 1 tick above/below the bars maximum size, so it can't be filled on the current bar by design. I want the buy or sell stop order sitting there waiting when the next bar opens.

              Comment


                #8
                Hello Trader_Mark,

                If you'd like a order placed 1 tick above or below the current bars high/low, then you should run the strategy with Calculate set to OnBarClose, and have your strategy logic refer to the previous bar.

                Please let us know if you need further assistance.
                Alan P.NinjaTrader Customer Service

                Comment


                  #9
                  Originally posted by NinjaTrader_AlanP View Post
                  Hello Trader_Mark,

                  If you'd like a order placed 1 tick above or below the current bars high/low, then you should run the strategy with Calculate set to OnBarClose, and have your strategy logic refer to the previous bar.

                  Please let us know if you need further assistance.
                  Is that the only way because that creates other issues, like rejected orders due to price moving past the stop order price before the stop order gets submitted (hence why I want it placed prior to the new bar)?

                  Comment


                    #10
                    Hello Trader_Mark,

                    There may be other ways, you could use EnterLongStopMarket, using the syntax,
                    EnterLongStopMarket(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double stopPrice, string signalName)
                    https://ninjatrader.com/support/help...stopmarket.htm

                    Then run the strategy with calculate on each tick, have the order submitted on the current bar, but prevent the order from being modified on the next bar, which would achieve what you're looking to do as well.

                    Or under the other approach, you could write logic to not submit the order if the stop price was not valid, thus preventing rejected orders.

                    Please let us know if you need further assistance.
                    Alan P.NinjaTrader Customer Service

                    Comment

                    Latest Posts

                    Collapse

                    Topics Statistics Last Post
                    Started by joemiller, Today, 07:33 AM
                    0 responses
                    6 views
                    0 likes
                    Last Post joemiller  
                    Started by isnercrypto, Today, 06:42 AM
                    0 responses
                    4 views
                    0 likes
                    Last Post isnercrypto  
                    Started by Coursocied67, Today, 04:02 AM
                    0 responses
                    5 views
                    0 likes
                    Last Post Coursocied67  
                    Started by TheGameOfProbabilities, 07-18-2019, 06:56 AM
                    7 responses
                    37 views
                    0 likes
                    Last Post DaveS
                    by DaveS
                     
                    Started by claxxical, Yesterday, 10:00 PM
                    0 responses
                    11 views
                    0 likes
                    Last Post claxxical  
                    Working...
                    X