Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multi series data and the right bar index

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

    multi series data and the right bar index

    I have 2 additional time frames for the same instrument loaded.
    Index 0 - the main one is the chart loaded. can be anything
    Index 1 - Ticks if available, otherwise minutes
    Index 2 - 60 min relevant for my strategy logic

    I have Calculated = Calculate.OnEachTick (dont think it has an effect though)

    Q1) should I keep some order of loading the data based on resolution. the higher index has the higher granularity ?

    Q2) I am trying to calculate the Highs[2][1]

    if (BarsInProgress == 2 && IsFirstTickOfBar)
    HighofLastBar = Highs[2][1]

    But the problem is that only the Highs[2][0] gives me the right value. the Highs[2][1] gives me the value of 2 bars ago.

    what am I missing ?

    #2
    Hello dadarara,

    Thank you for the post.

    For your first question, this can depend on your trading goals for the most part. It can be helpful to stagger the series from largest to smallest, or the opposite way around depending on the effect you are trying to achieve. For example, plotting many changes would require a smaller granularity primary series but trading on a more granular series does not carry the same requirement as you can add a second series and use that.

    From your description, it is hard to say why the value is incorrect at that time but I do see you are using IsFirstTickOfBar and you noted you are using Calculate.OnEachTick but it didn't seem to have an effect. Are you currently running this in historical or real-time?

    The OnEachTick setting will not work historically so that would change the way this logic processes historically. In realtime you would see OnEachTick begin working. Knowing the specifics of the test you are asking about will help me understand what should be happening better.

    Can you also provide a specific example for primary that we can work through on this?

    I look forward to being of further assistance.


    Comment


      #3
      Jesse

      I am checking it historically.
      So that means that IsFirstTickOfBar should have no effect , right ?
      So the IF statement above is the same as : if (BarsInProgress == 2) ????

      also, if this is Historical run, than it calculates on the bar close ? if so its understood why the index [2][1] is not working. it should be the [2][0] as this is at the end of the bar I am checking.

      I appreciate if you can confirm the above.

      Comment


        #4
        Hello dadarara,

        Yes, this property is only variable when the script can process OnEachTick or OnPriceChange. With historical data that is being calculated OnBarClose this would remain true. Using a print, in this case, will help to know what the condition should equate to and what values are being used.

        Your condition uses && in addition to historically IsFirstTickOfBar being true so you are essentially only checking if BarsInProgress == 2. In real-time or whenever the IsFirstTickOfBar property can toggle to false, you will see this condition become variable.

        Historically your script does use OnBarClose.

        In regard to why the BarsAgo is equating to that value, I would need a more specific example including the primary series to understand why that may be the case. On your end, you could utilize Prints or plotting to better visualize the data your script is using to understand this.

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by NullPointStrategies, Today, 05:17 AM
        0 responses
        20 views
        0 likes
        Last Post NullPointStrategies  
        Started by argusthome, 03-08-2026, 10:06 AM
        0 responses
        119 views
        0 likes
        Last Post argusthome  
        Started by NabilKhattabi, 03-06-2026, 11:18 AM
        0 responses
        63 views
        0 likes
        Last Post NabilKhattabi  
        Started by Deep42, 03-06-2026, 12:28 AM
        0 responses
        41 views
        0 likes
        Last Post Deep42
        by Deep42
         
        Started by TheRealMorford, 03-05-2026, 06:15 PM
        0 responses
        45 views
        0 likes
        Last Post TheRealMorford  
        Working...
        X