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

How to calculate last Bar of Historical EoD Data?

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

    How to calculate last Bar of Historical EoD Data?

    Hello Support,
    Indicators are not calculated on the last Bar of an EoD Historical Data Series. Firing onBarUpdate() ends on Bars.Count - 2
    Click image for larger version  Name:	Missing_Indicator_Data_on_last_Bar.png Views:	0 Size:	5.0 KB ID:	1177642
    I searched the Forum for solutions, found similar questions (like this), but all these seems (also) related to Intraday Data.
    I learned, that a Bar close is only fired when a new Bar (or Tick) will start - even on historical Data. But historical Bars are 'as is'. They don't grow or change like started and unfinished Realtime Bars.
    I also learned, that State.Historical data processes OnBarUpdate() only on the close of each historical bar even if this property is set to OnEachTick or OnPriceChange.

    But what's on session pauses like evenings or weekends (to preparing Trades for the next Session)? Indicators shoud also include the last available Bar (Bars.Count -1)

    I tried -1 as barsBack, sessionIterator.GetNextSession(Time[0]) and Update(), played with Trading Hours and EndDate as ChartSeries Parameters - all without success.
    So please help: how do I get calculated the last Bar (Bars.Count - 1) on historical EoD Data?

    Best Regards
    t

    #2
    Hello Trandy,

    For a plot to update, it has to be receiving data and the Value series for the plot has to get set to a number for that number to be plotted.

    Yes, Calculate must be OnPriceChange or OnEachTick to update OnBarUpdate() before the bar closes and set the value that gets plotted on the chart.

    When a session breaks, there is no data to drive the chart, however the plot would be updated to the last price change, and would still be on the currently building bar.

    With the Kinetick End of Day Free data, there would be no updating data intra-bar, so unfortunately it would not be possible to trigger OnBarUpdate to update the plot for that last bar using the calculated data for that bar.
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by nleitman, Today, 11:46 AM
    7 responses
    18 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by cmtjoancolmenero, Today, 01:09 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by DanielRaz, Today, 12:54 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by Russ Moreland, 04-24-2024, 12:54 PM
    2 responses
    18 views
    0 likes
    Last Post JosephDavidsona  
    Started by truepenny, Today, 03:45 AM
    5 responses
    27 views
    0 likes
    Last Post NinjaTrader_RyanS  
    Working...
    X