Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

IsFirstBarOfSession problems on TickReplay charts

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

    IsFirstBarOfSession problems on TickReplay charts

    In OnBarUpdate, IsFirstBarOfSession is not supposed to require a null reference check.

    BUT, when this method is used in an indicator on a TickReplay chart, even if there IS a null reference check, there will be null reference exceptions as the chart loads.

    The error occurs when the ChartBars.ToIndex exceeds the CurrentBar. Checking to make sure that is not the case seems to eliminate the error.

    Sample code attached. Run on a tick replay chart and see what happens if you disable the filter for that condition. This indicator is intended to be placed in a folder called Bands.
    Attached Files

    #2
    Hello Ricam,

    Thank you for reporting this item.

    We will test this further on our end.

    Comment


      #3
      Wondering if maybe OnBarUpdate is being called during State.Terminated. I haven't checked, but I do know that OnRender can be called, which will be problematic.

      Comment


        #4
        Ricam,

        I am able to reproduce the IsFirstTickOfBar item, but can you provide an example of testing OnRender and OnBarUpdate for State.Terminated?

        Comment


          #5
          I think you could test for that by putting a conditional print statement inside the OnBarUpdate and OnRender methods

          if(State == State,Terminated) Print something.

          The important thing is that you were able to reproduce the error.. excellent. Thanks.

          Comment


            #6
            Ricam,

            I thought you might have a specific use case. I have not seen either called during the terminated state.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Segwin, 05-07-2018, 02:15 PM
            14 responses
            1,788 views
            0 likes
            Last Post aligator  
            Started by Jimmyk, 01-26-2018, 05:19 AM
            6 responses
            837 views
            0 likes
            Last Post emuns
            by emuns
             
            Started by jxs_xrj, 01-12-2020, 09:49 AM
            6 responses
            3,293 views
            1 like
            Last Post jgualdronc  
            Started by Touch-Ups, Today, 10:36 AM
            0 responses
            12 views
            0 likes
            Last Post Touch-Ups  
            Started by geddyisodin, 04-25-2024, 05:20 AM
            11 responses
            62 views
            0 likes
            Last Post halgo_boulder  
            Working...
            X