Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Processing Last-Price Chart

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

    Processing Last-Price Chart

    Hi,

    I'm trying to process the price movements on a last-price chart on NT8, so I'm using " OnMarketData " and checking whether the ticks/events equals "MarketDataType.Last". If so, I process it.

    The problem is that price on the chart makes movements not because of "last-price ticks" but other type. I've tried processing both Last and Bid ticks, but then I've realized not every Bid move chart price, so again my code doesn't process same movements as price chart.

    Actually I've checked that there are movements on price that doesn't fit with any MarketDataEvent catched on OnMarketData, so I guess there is another way of detecting these price movements?

    So, in short, my question is how could I process in my code exactly the same movements that price-chart shows? Am I right using OnMarketData for both Simulation and Real-Time?

    Thanks in advance.
    Last edited by manugarc; 08-29-2016, 07:44 AM. Reason: Clarify NT Version

    #2
    Hello manugarc, and thank you for your question.

    The easiest and most accurate approach, if you are attempting to backtest OnMarketData events, is to use the Playback Connection. You can find more about this here,



    If this is not an option for you, for instance if you are trying to backtest strategies quickly through the strategy analyzer or in a chart with a live data feed, I would like to ask, are you using the Tick Replay feature and High Fill Resolution?

    The Tick Replay feature was designed to provide more granular tick related information, and can be helpful if you need to know the most recent last price, last volume, best ask price, or best bid price that occurred "inside" of your primary bar input series without needing to program a custom tick series. You can learn more about this new NinjaTrader 8 feature if you did not already know about it here,



    I recommend reviewing the table in the "How the Tick Replay Engine Works" section, this will give you the most intuitive understanding of the Market Data Updates timing so that you will know exactly when these events will occur in Historical Data.

    To enable Tick Replay :

    • Make sure NT8 Control Center -> Tools > Options > Market Data > "Show Tick Replay" is checked
    • Make sure all Sub-indicators and Sub-strategies are initialized before State.Historical, e.g. during State.Configure or (for a strategy) after having called AddChartIndicator()

    Please note these caveats
    • Tick Replay ONLY replays the Last market data event, and only stores the best inside bid/ask price at the time of the last trade event. You can think of this as the equivalent of the bid/ask price at the time a trade was reported. As such, historical bid/ask market data events (i..e, bid/ask volume) DO NOT work with Tick Replay. To obtain those values, you need to use a historical bid/ask series separately from TickReplay through OnBarUpdate()

      More information on historical bid/ask series:

      http://ninjatrader.com/support/helpG..._ask_serie.htm
    • Due to the nature of how some unique bars build, Tick Replay is NOT available for all bar types. For example, the default Renko and LineBreak bars which use RemoveLastBar() are not compatible with Tick Replay. Other custom bar types which use similar methods encounter the same limitation

    If you are backtesting a strategy, High Fill Resolution allows you to pull in additional historical data that will be more granular then what you are using for the strategy backtest to be used to give you more data points of which to fill orders. The difference between this and Tick Replay, is that where Tick Replay only replays last market events, High Fill Resolution will give you more data points to work with.


    You can learn more about Fill Resolution here,





    Together, the PlayBack Connection, Tick Replay, and High Fill Resolution will give you a powerful toolkit for backtesting strategies that rely on Market Data.


    Please let us know if there are any other ways we can help.
    Jessica P.NinjaTrader Customer Service

    Comment


      #3
      Thank you Jessica, I appreciate your helful answer. I got some errors while activating Tick Replay, so I installed the most recent Beta version and now I can't even open a chart, so I'll try to solve it in another thread (to keep this one clean and focused on the original issue) and come back to let you know about my progress.

      Comment


        #4
        Thanks again Jessica, I had forgotten to check the checkbox on every chart, now it seems to work perfectly. I have new questions/problems after last update, but I'm asking them on separate threads.

        Just one last question about this thread: Will this configuration work as well on live data just like on simulation? (Using in simulation PlayBack Connection & Tick Replay).

        EDIT: To clarify my question: I mean if I need to check in the code whether it's running on simulation or live data to use other methods depending on one or other situation, or I can just run this same code on live data.
        Last edited by manugarc; 09-06-2016, 03:41 PM.

        Comment


          #5
          Since strategies see Playback Connection data as though it were live data, it is reasonable to expect a strategy to perform live the same way it does with the Playback Connection. Provided you have no code that is sensitive to State == State.Historical, it is safe to assume that high fill resolution and tick replay can get your strategy performing generally the way it does with live data. The guarantee with these is not as high as with the Playback Connection.

          Each of these three tools has a use case it is ideally suited for.

          • The playback connection is useful to see how your strategy will perform live
          • Using high fill resolution will help you correctly optimize your strategy
          • Using tick replay will save you time and effort developing strategies and avoid complications such as secondary tick series to look at intra-bar data

          Using all three of these together, you should be able to quickly develop strategies with a high degree of confidence in their performance.
          Jessica P.NinjaTrader Customer Service

          Comment


            #6
            Absolutely clear answer. Unsurpassable

            Thank you Jessica.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Christopher_R, Today, 12:29 AM
            0 responses
            6 views
            0 likes
            Last Post Christopher_R  
            Started by sidlercom80, 10-28-2023, 08:49 AM
            166 responses
            2,234 views
            0 likes
            Last Post sidlercom80  
            Started by thread, Yesterday, 11:58 PM
            0 responses
            3 views
            0 likes
            Last Post thread
            by thread
             
            Started by jclose, Yesterday, 09:37 PM
            0 responses
            7 views
            0 likes
            Last Post jclose
            by jclose
             
            Started by WeyldFalcon, 08-07-2020, 06:13 AM
            10 responses
            1,414 views
            0 likes
            Last Post Traderontheroad  
            Working...
            X