Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using tick by tick strategy: How could I call High, Low, Close of yesterday's bar?

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

    Using tick by tick strategy: How could I call High, Low, Close of yesterday's bar?

    Long time not programming, so I've forgotten some tips.

    I have a tick by tick strategy, but I need to call past daily data, the typical High, Close...etc. Any idea?



    I'm thinking the following: Using the daily data for the strategy but OnBarClose == False, so I can read tick by tick, but I have one trouble. If I had to turn off and once again turn on the strategy, I'm not sure that configuration can read the historical tick by tick before.

    I'm really struggling with this. Any suggestion would be really nice.

    Thanks
    Last edited by pstrusi; 11-04-2021, 04:34 PM.

    #2
    Hello pstrusi,

    Thanks for your post.

    Please note that the reply below was for NinjaTrader8 which I missed that you posted in Ninjatrader7 forum, I left this here because this is an area that is an advantage in NinjaTrader8 that is not available in NinjaTrader7. I will add a new post for NinjaTrader7 to retrigger an e-mail response to you.

    "If I had to turn off and once again turn on the strategy, I'm not sure that configuration can read the historical tick by tick before" That is correct. Historical bars are read as complete bars an do not contain the ticks that made them up.

    ( The following is what you could do in NinjaTrader8)
    You can enable Tick Replay for the data series and this will allow your historical data to be processed tick by tick. This means that you have to have the tick data or your data provider must be able to provide historical tick data.

    From the help guide, "Tick replay is a property that can be optionally enabled on NinjaScript indicators and strategies which will ensure that the market data (bid/ask/last) that went into building a bar is loaded in the exact sequence of market data events. This guarantees that your indicators and strategies are historically calculated tick-per-tick exactly as they would have been if the indicator/strategy was running live during a period. Tick replay can be enabled for indicators used in Charts, Market Analyzers, and Strategies."

    Here are references for enabling/using Tick Replay: https://ninjatrader.com/support/help...ick_replay.htm
    Last edited by NinjaTrader_PaulH; 11-05-2021, 07:37 AM. Reason: Unintentionally posted a NinjaTrader8 reply, modified to explain that error.

    Comment


      #3
      Hello pstrusi,

      Sorry for the incorrect platform reply in post #2.

      As previously advised you are correct historical will only be bar by bar and the ticks that make up the bar are unknown.

      In NinjaTrader7 you would need to add a 1 tick series to your script and then access that data.

      However, if all you need is the daily High, Low and Close you would not need to do that. You could add daily bars to your strategy and then access the Highs, Lows, Closes of the added daily bar series. Or, if you did not want to add daily bars you could use Bars.GetDailyBar(): https://ninjatrader.com/support/help...?getdaybar.htm The consideration as to which would relate to the trading session you are using and/or if you need the daily settlement price that you would get from a daily bar (if your provider sets the daily close as the settlement price).


      Comment


        #4
        Paul, thank you very much for your suggestions, it sounds like a solution.

        Kind regards
        PS

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        556 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        324 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        545 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        547 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X