Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

data series current open bar granularity

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

    data series current open bar granularity

    My strategy needs to analyze price action on daily, 4-hour and 15min candle charts/dataseries, including the current open bar and all its fluctuations.
    I do these checks every 5 minutes to ensure my bias is current.
    However, it seems like Ninjatrader only updates these dataseries on each bar close, so my strategy can't ever see the current open bar's action.
    My strategy is set to calculate on each tick and I have a 1-tick data series also for intrabar granularity on orders, position management etc.

    How can my strategy see all the price movements of current open bar on a data series like 1-day?
    Last edited by iantriestrading; 03-18-2025, 09:43 AM.

    #2
    Hello iantriestrading,

    You would the bar price series to update the bar before it closes by using Calculate.OnPriceChange.
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    Note, in historical you would need to enable TickReplay.

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    You could also choose to do a BarsRequest.
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hi Chelsea, sorry but I'm on almost no sleep and I don't understand your first sentence:
      "You would the bar price series to update the bar before it closes by using Calculate.OnPriceChange."

      I also want to mention the primary series the strategy runs on is 15sec

      Comment


        #4
        Hello iantriestrading,

        The 1 day bar price series will not have a new bar on a new day until the bar updates.

        If the bar updates after the bar is closed, you would need to wait until the end of the day.

        Set Calculate to Calculate.OnPriceChange in State.Configure so this updates for every price change.

        The new bar for the new day will be accessible after it updates for each price change.
        Chelsea B.NinjaTrader Customer Service

        Comment


          #5
          Hey Chelsea,

          I just created a small test strategy which also runs on 15sec primary, and calculates on each tick, and on each tick coming in, it successfully prints the current price of the current open bar from an added daily data series.

          This is the behavior I wanted and seems to be default NT behavior.

          Something must be wrong in my full strategy then, since it doesn't seem to be updating daily on each tick like that. I'll have to investigate further but clearly this is a problem with MY code.

          Comment


            #6
            Hello iantriestrading,

            The default setting for Calculate is OnBarClose.

            If it is set to OnEachTick, this would be because you changed the code in OnStateChange State.SetDefaults or you changed this in the strategy properties and possibly saved a default template.

            I have recommend OnPriceChange as you have not stated you are collecting volume.
            Chelsea B.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by herzogvladimir2, Today, 08:10 PM
            0 responses
            2 views
            0 likes
            Last Post herzogvladimir2  
            Started by giogio1, 04-13-2025, 01:42 AM
            2 responses
            31 views
            0 likes
            Last Post giogio1
            by giogio1
             
            Started by mmenigma, 01-23-2024, 09:37 AM
            1 response
            86 views
            0 likes
            Last Post Nin8aTrender  
            Started by wbayne333, 02-22-2021, 01:18 PM
            6 responses
            409 views
            0 likes
            Last Post Nin8aTrender  
            Started by gtheaded, 07-03-2020, 03:47 PM
            3 responses
            370 views
            0 likes
            Last Post Nin8aTrender  
            Working...
            X