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

Confusing multi-timeframe behaviour

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

    Confusing multi-timeframe behaviour

    Hello everyone. I hope that some one help me to understand what I do wrong with historical data analyses.

    So the scenario is following:
    I do have main data series, which is 1 min timeframe bars.
    Also I have secondary data series, which is 1 tick timeframe.
    In order to understand how this behave inside I wrote simple script which print me tick's data and respective bar's data.
    As an example I got the following:
    Date and Time of a Tick; Price of the Tick; Current 1Min bar number
    1T bar: Time 27.08.2020 18:11:03; Close 3496,63; 1M bar Number 100
    1T bar: Time 27.08.2020 18:11:03; Close 3496,46; 1M bar Number 100
    1T bar: Time 27.08.2020 18:11:03; Close 3496,45; 1M bar Number 100
    .
    .
    .

    1T bar: Time 27.08.2020 18:11:56; Close 3495,14; EMA 3495,34110709542; 1M bar Number 100
    1T bar: Time 27.08.2020 18:11:56; Close 3495,2; EMA 3495,31288567633; 1M bar Number 100

    1M bar: 101 Time 27.08.2020 18:12:00; Open 3496,63; High 3496,7; Low 3494,93; Close 3495,2

    And the result you see above is CONFUSING! This is far away from how realtime bars do shape.
    As you may see first and last Ticks prices are respectively Open and Close of the bar they shape. So they belong to this bar. But at the same time bar's number is different to what we see near by each tick.
    So it means that while ticks of a new (not shaped yet) bar appear, the current bar is still the previous one.. This is ok for OnBarClose Calculation setting but, I think, not acceptable for Calculate.OnEachTick or OnPriceChange.

    My goal is to work with history of 1 min bars, where most recent bar is an actual one ( accessible via Close[0], Open[0] etc) and changing untile closed. I was expecting that second data series could help me but it doesnt.. there is no any lets say "temporary" actual bar.. seems I have to construct it myself somehow.

    Any comment/advise ?

    thanks a lot in advance

    Andrei


    #2
    Hello Andrei, thanks for your post.

    Please turn on Tick Replay for higher historical data accuracy. When Tick Replay is on the ticks will be replayed historically as if they came in live instead of processing after the primary bar series:

    https://ninjatrader.com/support/help...ick_replay.htm

    Please let me know if I can provide any further information.
    Chris L.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChrisL View Post
      Hello Andrei, thanks for your post.

      Please turn on Tick Replay for higher historical data accuracy. When Tick Replay is on the ticks will be replayed historically as if they came in live instead of processing after the primary bar series:

      https://ninjatrader.com/support/help...ick_replay.htm

      Please let me know if I can provide any further information.
      Hmm... I already read this and the following hld me from trying Tock Reply - Tick Replay was NOT designed to provide accuracy in backtesting concerning order fills and execution and should NOT be used to expect the exact sequence of executions as running a strategy on live data. For greater order-fill resolution and accuracy in strategy backtesting, you can use the High Fill Resolution in the Strategy Analyzer. Furthermore you cannot combine both Tick Replay and High Order Fill resolution.

      Anyway.. I'll try it. Will it work with imported historical tick data ? I mean with the data imported from 3rd party source

      Comment


        #4
        Hello Andrei, thanks for your reply.

        The Tick Replay system will not improve order fill accuracy. Submitting your orders to the 1 tick series will ensure the backfill system is using the most granular OHLC prices to determine if an order should fill or not e.g.

        EnterLongLimit(int barsInProgressIndex, bool isLiveUntilCancelled, int quantity, double limitPrice, string signalName)

        If the 1 tick series is the only additional series, barsInProgressIndex will be set to 1.

        Please let me know if I can provide any further information.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by f.saeidi, Today, 12:14 PM
        7 responses
        16 views
        0 likes
        Last Post f.saeidi  
        Started by Russ Moreland, Today, 12:54 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by philmg, Today, 12:55 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by TradeForge, 04-19-2024, 02:09 AM
        2 responses
        32 views
        0 likes
        Last Post TradeForge  
        Started by aprilfool, 12-03-2022, 03:01 PM
        3 responses
        329 views
        0 likes
        Last Post NinjaTrader_Adrian  
        Working...
        X