Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsUpdate event question

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

    BarsUpdate event question

    I'm trying to create a general purpose class that will allow me to pre-process a bunch of analyzes prior to the OnBarUpdate method being called (analyzes don't fit well as indicators as the results are not aligned with a Series<T> object). What is the best method of doing this?

    Sample of what I am trying to do.

    public class HelperClass
    {
    private NinjaScriptBase ninjaScriptBase;

    public HelperClass(NinjaScriptBase nsb)
    {
    ninjaScriptBase = nsb;
    ninjaScriptBase.Bars.BarsUpdate += Bars_BarsUpdate;
    }

    private void Bars_BarsUpdate(object sender, BarsUpdateEventArgs e)
    {
    /*** RUN MY ANALYSIS ***/
    }
    }

    Does the NinjaScriptBase class just loop through all the historical data ( i.e. calls the OnBarUpdate override method )? Then when the historical data is processed it cuts over to the realtime data and fires off the BarsUpdate? Should I do the same for my class?

    #2
    It appears to work as you suspect. Although there can be an active data subscription while processing realtime bars, BarsUpdate does not appear to be called while isRealTime is false. Your idea of iterating through historical bars before relying on BarsUpdate in your code sounds like the right way to go.
    Dave I.NinjaTrader Product Management

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Shansen, 08-30-2019, 10:18 PM
    24 responses
    938 views
    0 likes
    Last Post spwizard  
    Started by Max238, Today, 01:28 AM
    0 responses
    3 views
    0 likes
    Last Post Max238
    by Max238
     
    Started by rocketman7, Today, 01:00 AM
    0 responses
    2 views
    0 likes
    Last Post rocketman7  
    Started by wzgy0920, 04-20-2024, 06:09 PM
    2 responses
    27 views
    0 likes
    Last Post wzgy0920  
    Started by wzgy0920, 02-22-2024, 01:11 AM
    5 responses
    32 views
    0 likes
    Last Post wzgy0920  
    Working...
    X