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 rhyminkevin, Today, 04:58 PM
            4 responses
            52 views
            0 likes
            Last Post dp8282
            by dp8282
             
            Started by iceman2018, Today, 05:07 PM
            0 responses
            5 views
            0 likes
            Last Post iceman2018  
            Started by lightsun47, Today, 03:51 PM
            0 responses
            7 views
            0 likes
            Last Post lightsun47  
            Started by 00nevest, Today, 02:27 PM
            1 response
            14 views
            0 likes
            Last Post 00nevest  
            Started by futtrader, 04-21-2024, 01:50 AM
            4 responses
            50 views
            0 likes
            Last Post futtrader  
            Working...
            X