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

Last Historical Bar?

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

  • ninZa
    replied
    Can you clarify the meaning of "scroll point"? A screenshot with your notes on it will easily explain.

    Leave a comment:


  • marty087
    replied
    HI Guys,

    I would like to do exactly what Freen has requested here.

    Bertrand, I tried your solution.... am I missing something here because your suggested code still only allows the indicator to load if it is the last bar on the chart. "Bars.Count" returns the same value as "Count" for me. So therfore your code will skip every bar until we are at Count - 2 which is when all historical bars are already loaded. What if we want the indicators code to only initiate once the CurrrentBar has arrived at the current scroll point of the chart?

    Leave a comment:


  • NinjaTrader_Bertrand
    replied
    Hi Frederik, try doing your calcs then in a condition like this :

    if (Bars.Count - 2 == CurrentBar && Historical)
    {
    do calcs on last historical bar
    }

    Leave a comment:


  • FREEN
    started a topic Last Historical Bar?

    Last Historical Bar?

    Any suggestion on how to trigger OnBarUpdate on last historical bar only?

    Bars.LastHistorical or Bars.Loaded properties would be handy properties for this purpose.

    The indicator I´m working with uses Infinite lookback and performs all historical calculations (0 -> CurrentBar looping) on each bar - hence last historical/current bar update only would make loading faster.

    Kindly, Fredrik
    Last edited by FREEN; 11-09-2011, 04:25 AM.

Latest Posts

Collapse

Topics Statistics Last Post
Started by RideMe, 04-07-2024, 04:54 PM
5 responses
28 views
0 likes
Last Post NinjaTrader_BrandonH  
Started by f.saeidi, Today, 08:13 AM
1 response
4 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by DavidHP, Today, 07:56 AM
1 response
5 views
0 likes
Last Post NinjaTrader_Erick  
Started by kujista, Today, 06:23 AM
3 responses
9 views
0 likes
Last Post kujista
by kujista
 
Started by Mindset, Yesterday, 02:04 AM
2 responses
18 views
0 likes
Last Post NinjaTrader_RyanS  
Working...
X