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 WHICKED, Today, 12:45 PM
2 responses
16 views
0 likes
Last Post WHICKED
by WHICKED
 
Started by GussJ, 03-04-2020, 03:11 PM
15 responses
3,272 views
0 likes
Last Post xiinteractive  
Started by Tim-c, Today, 02:10 PM
1 response
8 views
0 likes
Last Post NinjaTrader_ChelseaB  
Started by Taddypole, Today, 02:47 PM
0 responses
2 views
0 likes
Last Post Taddypole  
Started by chbruno, 04-24-2024, 04:10 PM
4 responses
51 views
0 likes
Last Post chbruno
by chbruno
 
Working...
X