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 junkone, Today, 11:37 AM
            0 responses
            2 views
            0 likes
            Last Post junkone
            by junkone
             
            Started by quantismo, 04-17-2024, 05:13 PM
            5 responses
            34 views
            0 likes
            Last Post NinjaTrader_Gaby  
            Started by proptrade13, Today, 11:06 AM
            1 response
            6 views
            0 likes
            Last Post NinjaTrader_Clayton  
            Started by love2code2trade, 04-17-2024, 01:45 PM
            4 responses
            34 views
            0 likes
            Last Post love2code2trade  
            Started by cls71, Today, 04:45 AM
            2 responses
            10 views
            0 likes
            Last Post eDanny
            by eDanny
             
            Working...
            X