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

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.
    Paul H.NinjaTrader Customer Service

    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).


      Paul H.NinjaTrader Customer Service

      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 JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Started by Haiasi, 04-25-2024, 06:53 PM
        2 responses
        17 views
        0 likes
        Last Post Massinisa  
        Started by Creamers, Today, 05:32 AM
        0 responses
        5 views
        0 likes
        Last Post Creamers  
        Started by Segwin, 05-07-2018, 02:15 PM
        12 responses
        1,786 views
        0 likes
        Last Post Leafcutter  
        Started by poplagelu, Today, 05:00 AM
        0 responses
        3 views
        0 likes
        Last Post poplagelu  
        Working...
        X