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

How to Obtain Accurate Historical Tick Data

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

    #16
    Originally posted by bltdavid View Post

    So, if you want more than 12 months of back testing using historical tick data, you'll need to get it from a source other than NinjaTrader.

    And those sources charge for it.
    Thank you very much for bltdavid,

    I only want to use minute candlestick bars for back testing strategies.

    Now that I understand how the back testing software create minute bars, I believe my back testing will be accurate enough for my testing and I don't need tick data based on how I trade.

    Can Ninja Trader provide more then 12 month of back testing data for minute bars?

    Thanks,

    Comment


      #17
      Originally posted by bltdavid View Post
      If you've been using NT for many years, presumably you were smart all those years and enabled the check box "Save chart data as historical" and/or used Historical Data Manager to download the tick data before the NT admins retired it.
      Thanks bltdavid for the response and time,

      WOW, so you are saying that if I had started using Ninja Trader 5 years ago when I first started trading, I could have just click "enabled the check box "Save chart data as historical" and/or used Historical Data Manager to download the tick data" on the /NQ, /ES, /CL, or any other market I wanted to eventually test strategies, I would already have 5 years of tick data stored on my computer automatically?

      I wish had known this years ago. That would have been awesome.

      Comment


        #18
        Originally posted by simple_goodoboy View Post
        My confusion was from this statement "During a backtest you can select conservative or liberal fill algorithms which will produce different results. Fills are determined based on 4 data points, OHLC of a bar since that is the only information that is known during a backtest."http://ninjatrader.com/support/helpGuides/nt7/discrepancies_real_time_vs_bac.htm

        My initial thoughts was so the only data available during a back test is OHLC prices literally. However, I was not thinking about how NT strategy analyzer code uses the OHLC data to strategically create the bar (my cause time base bars) and try to match the back test code entry with the bar.
        Quite understandable.

        I think what we (the readers) are supposed to derive from that statement is that OHLC is available, but IMHO the implication they really mean for us to see is what they failed to say:

        Depth of market (aka Level II data) is not available to the back tester.

        In live trading, entry and exit limit orders are missed all the time because of the effects of the order book. Let's say you have a profit target of 55.45, and price starts to rise and eventually the Ask price is also 55.45 -- and then price drops and you are not filled on your target.

        What happened?

        The depth of market bit your ass, that's what. Your sell limit order sitting at 55.45 was one of many sell orders, all queued up on a first-come first-serve basis, waiting for a matching buyer to buy at the Ask price of 55.45.

        But your order was not first, so when additional buyers disappeared right in the middle of servicing those queued up orders, your order was left there, in the queue, it's probably moved up because some orders ahead of it where dequeued by the few buyers. Your problem was there was not enough buyers at that limit price to "eat" into the queue to at least reach your order. Did I say "eat"? I meant "fill" -- but you knew that, lol.

        It's even possible that price movement starts falling steadily from there, and does not return to 55.45 for quite some time, if at all.

        If you're trading this live, you'd be pissed that your limit price was touched but your profit target was not filled. (Btw, this is the purpose of "Chase" and "Chase if touched" for ATM strategies, see Auto Chase).

        But when back testing, the internal fill algorithm would probably show your profit target as filled at 55.45.

        WTF you say? Yep, that's real-time vs backtesting, no Level II data.

        Anyways, my point is: it is a well-educated trader that knows how the level II data impacts trades, and therefore, it is my educated guess that, when they say, only OHLC data is available (like, when back testing) then we are left surmising that certain fill and/or non-fill events you'd experience in live trading cannot be duplicated by the back testing software ... because there is no depth of market (Level II) data.

        They don't explicitly say no Level II data, it is implicit because they say only OHLC data is available. Yeah, I know I know, if you're saying that the NinjaTrader help guide is confusing on that point, absolutely, I'll be voting YES with ya, pardner.

        That's my 2˘ anyways.

        Btw, if you want depth of market data in your back testing, then you will want to run your strategy normally, like on a chart, but connect to Market Replay.
        Last edited by bltdavid; 02-27-2017, 06:12 PM.

        Comment


          #19
          Thanks bltdavid for your response and comments.

          This is very good conversation as I am reading the help files for learning. I have been discretionary trading for about 3 years part time, so a lot of what you mentioned below, I have seen, but never understood the theory of why that happens.

          Question:
          1. Does Ninja Trader back testing capabilities offer Historical OHLC Minute Data?
          2. See the attachment please. What is the benefit of having Historical Bid/Ask Minute Data during back testing?


          Originally posted by bltdavid View Post
          Ask price is also 55.75 -- and then price drops and you are not filled on your target
          What happened?
          The depth of market bit your ass, that's what. Your sell limit order sitting at 55.45 was one of many other orders, all queued up on a first-come first-serve basis, waiting for a matching buyer to buy at the Ask price of 55.45.
          Lol, that’s funny. I have experienced this sooo many times. It is not good feeling when this happen. And I am happy to know Ninja Trader have option of Auto Chase


          Originally posted by bltdavid View Post
          But when back testing, the internal fill algorithm would probably show your profit target as filled at 55.45.
          WTF you say? Yep, that's real-time vs backtesting, no Level II data.
          Very very interesting! I am learning. So what I will do when back testing so I am as conservative as possible is select conservative fill algorithms option when back testing. This way I make sure the price goes through my order for fill to occur. So for this example my profit target set at 55.45, would have to go to 55.46 for a fill to occur.

          What is your comments on conservative fill algorithms option?

          Originally posted by bltdavid View Post
          only OHLC data is available (like, when back testing) then we are left surmising that certain fill and/or non-fill events you'd experience in live trading cannot be duplicated by the back testing software ... because there is no depth of market (Level II) data.
          That makes good sense you mentioned. An analogy of the statement only OHLC data is available when running the Strategy Analyzer back testing is: think of it like when I manual (painful and tedious) back test using just a 3 minute candle chart and I just visually look for my trading method entry, stop, and target prices on the chart and assume I was filled at each price. Then I just manually record that entry stop target and P/L in my spread sheet. I don’t know in a live market if those prices were actually filled or slippage occurred, or if price touched but not filled.

          Is this a safe analogy to use when thinking of the back testing software and only OHLC data is available? I think so.

          Thanks for the 5 cents comments. Great read and good discussion.

          Yes, I plan to run an auto strategy in Market Replay for 2 days and then compare in Strategy Analyzer for those 2 days to see the difference with my own experience and education.

          Thank you very much and I await your comments.
          Attached Files
          Last edited by simple_goodoboy; 02-24-2017, 10:12 PM.

          Comment


            #20
            Originally posted by bltdavid View Post
            Anyways, my point is: it is a well-educated trader that knows how the level II data impacts trades, and therefore, it is my educated guess that, when they say, only OHLC data is available (like, when back testing) then we are left surmising that certain fill and/or non-fill events you'd experience in live trading cannot be duplicated by the back testing software ... because there is no depth of market (Level II) data.
            bltdavid,

            I have an interesting question for you.

            Does the Strategy Analyzer code or algorithm know (or programmed) the real price movement direction (price moved up or down) once the bar opened at Market Opened?

            Here is my concern with an example regarding back testing with only OHLC data is available, what if the profit target, entry, and stop loss is within the same 3 min bar? For example and lets assume, if live price movement opened the bar and price drops down to fill a buy limit order, and continuous down ward to stop loss order in the same bar, this will be accurate. If back testing this same example, will price movement at bar open perform the same way?

            Let’s set up an example so I make sure I observe the problem.

            Previous Bar Executes limit buy order on bar Close

            Limit buy order Entry = 53.52
            Sell Limit order Profit target = 53.60
            Stop loss market order = 53.45
            Next Bar in process
            Open = 53.57
            High = 53.64
            Close = 53.55
            Low = 53.42

            The problem or question related to if the back testing software functionality knows which direction price moves after Market Open similar to live price movement? For example 1) On market open 53.57, did price go to High of 53.64 first and then down to and fill limit buy order at 53.52 and then trigger stop loss market order of 53.45, which will cause a loss OR 2)On market open 53.57, did price go to fill limit buy order at 53.52, then reverse up to profit target of 53.60 sell limit order and returning a profit.

            Is the back testing software smart enough provide the OHLC data and smart enough to know the real price movement (up or down) once the bar starts creating?

            This is a good question cause I use (sometimes) profit target of 8 ticks on 1st contract and that can happen in the same bar. But I believe this goes back to the discussion of what makes up a 3 minute bar that I use. And that is three 1 minute bars and that means within one 1 minute bar the entry, stop loss, and/or profit target was occurred in the same bar. I think this depends on the distance from entry to stop loss and distance from entry to profit target I am using. I think I need some sleep.

            Oh, maybe the OHCL prices of each bar have a Timestamp attached and the strategy analyzer code uses this timestamp to compare which direction to move after bar market open price occurred. I hope this is the case, if so this will answer my question or concern.

            I hope I make sense.

            Thanks,
            Last edited by simple_goodoboy; 02-25-2017, 01:16 AM.

            Comment


              #21
              Originally posted by simple_goodoboy View Post
              Question:
              1. Does Ninja Trader back testing capabilities offer Historical OHLC Minute Data?
              Yes. NinjaTrader historical data servers in Denver offer many years of historical minute data for all instruments. My understanding is that this accumulated minute data is almost never deleted by the NT admins.
              Originally posted by simple_goodoboy View Post
              2. See the attachment please. What is the benefit of having Historical Bid/Ask Minute Data during back testing?
              None, that I know of, unless your strategy is written to somehow use that data.

              The 4 prices in the OHLC of each bar (real-time or historical bars) are representative of the Last price, not Bid or Ask price.

              Originally posted by simple_goodoboy View Post
              Very very interesting! I am learning. So what I will do when back testing so I am as conservative as possible is select conservative fill algorithms option when back testing. This way I make sure the price goes through my order for fill to occur. So for this example my profit target set at 55.45, would have to go to 55.46 for a fill to occur.

              What is your comments on conservative fill algorithms option?
              Sounds reasonable. I'm not sure I have much of an opinion, but ...

              One way to test this is to run your strategy in Sim101, then when the day is over, run strategy analyzer (twice) and compare results.

              That is, after the market closes, run SA twice, once with each fill algorithm, then compare entries and exits you had in Sim101 real-time data vs the SA results using chosen fill algorithm w/historical data.

              You'll either find it makes little to no difference (for that specific strategy on that specific bartype), or one fill algo mimics real life entries and exits better than the other.
              Last edited by bltdavid; 02-26-2017, 02:29 PM.

              Comment


                #22
                Originally posted by simple_goodoboy View Post
                Does the Strategy Analyzer code or algorithm know (or programmed) the real price movement direction (price moved up or down) once the bar opened at Market Opened?
                I don't think it knows, per se, because I don't think it has any data to tell it how price moved intra-bar for that 1-minute historical bar. (The back tester could consult the tick historical data during that precise 1-minute period, to know how price moved intra-bar, but that would make the back tester slower and unnecessarily complex, IMHO, of course)

                I presume the back testing algorithm can safely ignore the volatility intra-bar, because if you have OHLC you can surmise quite a lot about general price movement, which I suspect is enough (for most purposes).

                I'm more familiar with NT7, and things could have changed in NT8, too.

                For example, I think, NT7 back tester has maximum 1-second granularity, whereas NT8 has sub-second granularity. This could support NT8 back tester knowing more about intra-bar price movement than NT7.

                I should admit I don't know for sure.
                I've never seen their code.
                I'm just making educated guesses.

                This is probably a better question for NinjaTrader support.

                Originally posted by simple_goodoboy View Post
                Here is my concern with an example regarding back testing with only OHLC data is available, what if the profit target, entry, and stop loss is within the same 3 min bar?

                [..snip..]

                Limit buy order Entry = 53.52
                Sell Limit order Profit target = 53.60
                Stop loss market order = 53.45
                Next Bar in process
                Open = 53.57
                High = 53.64
                Close = 53.55
                Low = 53.42

                For example,

                1) On market open 53.57, did price go to High of 53.64 first and then down to and fill limit buy order at 53.52 and then trigger stop loss market order of 53.45, which will cause a loss OR

                2) On market open 53.57, did price go to fill limit buy order at 53.52, then reverse up to profit target of 53.60 sell limit order and returning a profit.
                This one is also a good question for NinjaTrader support.

                Comment


                  #23
                  The forum has lots of threads concerning your question:



                  I found that one by doing this search:

                  Comment


                    #24
                    Hello Simple_goodoboy,

                    In the case where the same bar contains the price levels of the entry, stop and profit target, does the backtest algorithm know which levels traded first.

                    With order fill resolution set to Standard in the backtest, NinjaTrader will assume the high traded before the low if the high is closer to the open than the low, and vis versa.

                    For a more accurate back-test using the strategy analyzer, setting Order Fill Resolution to High would allow you to set a secondary series, such as a tick series, which would remove the guess or assumption the standard test takes-(whatever is closer to the opening price traded first).

                    Please see Understanding Historical Fill Processing


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

                    Comment


                      #25
                      Originally posted by NinjaTrader_AlanP View Post
                      Hello Simple_goodoboy,

                      In the case where the same bar contains the price levels of the entry, stop and profit target, does the backtest algorithm know which levels traded first.

                      With order fill resolution set to Standard in the backtest, NinjaTrader will assume the high traded before the low if the high is closer to the open than the low, and vis versa.

                      For a more accurate back-test using the strategy analyzer, setting Order Fill Resolution to High would allow you to set a secondary series, such as a tick series, which would remove the guess or assumption the standard test takes-(whatever is closer to the opening price traded first).

                      Please see Understanding Historical Fill Processing


                      Please let us know if you need further assistance.
                      Thank you for the response. I am confused on this problem or concern.

                      Does NT7 use this type of Standard or Fill Resolution to High Historical Fill Algorithm ? Or is this only with NT8?

                      Comment


                        #26
                        Hello Simple_Goodoboy,

                        I apologize those links are for NinjaTrader 8. NinjaTrader 7 does not have this functionality and thus, your backtest results could be skewed as the backtest only uses OHLC values and does not take into account what traded first within the bar.

                        However, you should see the following reference example for adding a secondary data series for which would give you intrabar granularity and thus mimic High Order Fill resolution and thus give you more realistic backtest results. Please see the following link.

                        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 us know if you need further assistance
                        Alan P.NinjaTrader Customer Service

                        Comment


                          #27
                          Originally posted by NinjaTrader_AlanP View Post
                          Hello Simple_Goodoboy,

                          I apologize those links are for NinjaTrader 8. NinjaTrader 7 does not have this functionality and thus, your backtest results could be skewed as the backtest only uses OHLC values and does not take into account what traded first within the bar.

                          However, you should see the following reference example for adding a secondary data series for which would give you intrabar granularity and thus mimic High Order Fill resolution and thus give you more realistic backtest results. Please see the following link.

                          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 us know if you need further assistance
                          Thank you so much for responding.

                          Let me make sure I understand this correctly please.

                          Questions:
                          1. So when a 3 minute bar opens in live, price actually goes to Low of the bar before going upwards to the High. Are you stating that in back testing using Strategy Analyzer, there is a chance the price can go to High of the bar first, and then to Low of the bar?

                          2. If yes, this is pretty confuses. Why is there a chance this could happen? Like you said this can skew back test results alot.

                          3. How does the back test simulation know to go up or down first?

                          3. May I please have a solution to obtain as accurate as possible back test results besides buying historical tick data? Because I use 3 min bars and only enter limit orders if price does not go up/down 20 ticks from entry. And there is a chance in back test the 20 ticks happens first, before filling the limit order.


                          Thank you for the response. I am just trying to learn

                          Comment


                            #28
                            Originally posted by NinjaTrader_AlanP View Post
                            Hello Simple_Goodoboy,

                            your backtest results could be skewed as the backtest only uses OHLC values and does not take into account what traded first within the bar.

                            However, you should see the following reference example for adding a secondary data series for which would give you intrabar granularity and thus mimic High Order Fill resolution and thus give you more realistic backtest results. Please see the following link.

                            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 us know if you need further assistance
                            AlanP,

                            Will intrabar granularity make my back test more accurate if I execute strategy on bar close and then enter limit order?

                            My worry is the once I enter the limit order price will not go the actually direction on the next bar?

                            For example, if bar close execute strategy for a long signal and limit buy order is set, I am concern on the next bar price will go up first and not down. When in reality price actually went down first and then high.

                            Will setting up intrabar granularity during the back test help for this case?

                            Thanks

                            Comment


                              #29
                              Hello simple_goodoboy,

                              Adding a secondary data series and submitting an order to that series would take into account whether the bar trade up or down first.

                              Please see the following link for addition information,


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

                              Comment


                                #30
                                Originally posted by NinjaTrader_AlanP View Post
                                Hello simple_goodoboy,

                                Adding a secondary data series and submitting an order to that series would take into account whether the bar trade up or down first.

                                Please see the following link for addition information,


                                Please let us know if you need further assistance.
                                Thank you so much AlanP,

                                I will study about adding a secondary data series to obtain a more accurate back test. And ask more questions here if needed.

                                Thanks,

                                Comment

                                Latest Posts

                                Collapse

                                Topics Statistics Last Post
                                Started by love2code2trade, 04-17-2024, 01:45 PM
                                4 responses
                                31 views
                                0 likes
                                Last Post love2code2trade  
                                Started by cls71, Today, 04:45 AM
                                2 responses
                                10 views
                                0 likes
                                Last Post eDanny
                                by eDanny
                                 
                                Started by proptrade13, Today, 11:06 AM
                                0 responses
                                4 views
                                0 likes
                                Last Post proptrade13  
                                Started by kulwinder73, Today, 10:31 AM
                                1 response
                                10 views
                                0 likes
                                Last Post NinjaTrader_Erick  
                                Started by RookieTrader, Today, 09:37 AM
                                3 responses
                                15 views
                                0 likes
                                Last Post NinjaTrader_ChelseaB  
                                Working...
                                X