Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Order Flow Cumulative Delta error

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

    Order Flow Cumulative Delta error

    I'm trying to use Order Flow Cumulative Delta indicator in my strategy, following the documentation here.
    I'm calling the OrderFlowCumulativeDelta() method by reference, cumulativeDelta.

    I wish the syntax was explained. It's hard to discern what the params are.

    My strategy has 3 data series:
    • Primary (0): 15sec
    • 1-second (1)
    • 1-tick (2)
    When I follow what is in the documentation, I get "Error on calling 'OnBarUpdate' method on bar -1: Index was outside the bounds of the array" because of using cumulativeDelta.BarsArray[2] instead of just BarsArray[2].

    Code:
    cumulativeDelta.Update(cumulativeDelta.BarsArray[2].Count - 1, 1);
    This is the only code that works for me:

    Code:
    cumulativeDelta.Update(BarsArray[2].Count - 1, 1);
    But that's confusing because I thought your documentation uses referenceName.BarsArray[X] because that specifies which of the indicator's internal BarsArray to update... Maybe I'm wrong.

    Any help would be appreciated. Thanks!!
    ​

    #2
    Hello iantriestrading,

    As long as you copied and pasted the syntax exactly as shown in the help guide that will be the correct structure however your 1 tick series is being added in the wrong order so it won't match the sample directly. In your case you would need to use BarsInProgress 2 for the condition that calls Update and pass BarsArray[2] to the update method.

    Comment


      #3
      Hey Jesse,

      So you mean this, right?

      Code:
      if (BarsInProgress == 2) {
          cumulativeDelta.Update(BarsArray[2].Count - 1, 1);​
      }

      Comment


        #4
        Hello iantriestrading,

        Right.

        The primary series is always BIP 0, the first added series would be 1 so the tick series which is second added in your script is 2.

        The orderflow items rely on being called for the tick series and the series you want to use it with. The sample shows how to do that while adding just a tick series so that would be index 1. In your script you have an additional series so that would be index 2 in that use case.

        Comment


          #5
          Thanks Jesse!

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          110 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          59 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          37 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          41 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          78 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X