Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Substituting Onbarupdate

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

    Substituting Onbarupdate

    Is it possible to delete :
    protected override void OnBarUpdate()

    Then from a timer in OnMarketdepth, run something, not a function but something that runs code, so I don't have to run every incoming tick for onbarupdate?

    Tinkerz

    protected override void OnMarketDepth(MarketDepthEventArgs e)
    {
    if (Timecounter<DateTime.Now.TimeOfDay.TotalMilliseco nds)
    {
    Timecounter= (DateTime.Now.AddMilliseconds(500).TimeOfDay.Total Milliseconds);

    TriggerUpdate
    }
    }


    protected override void TriggerUpdate()
    {
    ///was OnBarUpdate() now a timed loop
    }

    #2
    Hello Tinkerz,

    You will not be able to delete OnBarUpdate(), but can leave it empty if you don't want any processing during this event. The event will still happen even if there is no code to execute.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      ok thanks I have to leave it in,

      Can I still call another event like i suggested?

      Comment


        #4
        Yes, you can have custom events. See the reference sample below for help with this:
        Using custom events to output the current Level II data book
        Ryan M.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Unsuitable, Today, 07:26 PM
        0 responses
        1 view
        0 likes
        Last Post Unsuitable  
        Started by jvanelli, Today, 06:36 PM
        1 response
        6 views
        0 likes
        Last Post jeronymite  
        Started by twitch251, Today, 05:14 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Started by robforee2, Today, 05:07 PM
        0 responses
        3 views
        0 likes
        Last Post robforee2  
        Started by blar58, Today, 03:16 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Melissa  
        Working...
        X