Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily Bar Look Ahead Bias

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

    Daily Bar Look Ahead Bias

    Hi,

    I am in the process of developing intraday strategies which many reference daily bars and not sure if I am running into look ahead bias issues w/daily bars. Can you please confirm whether or not the following statements include references to the currently closed daily bar which hasn't happened yet?

    Expect to see WoodiesPivots for the last fully closed daily bar:
    CrossAbove(Close, WoodiesPivots(HLCCalculationModeWoodie.DailyBars, 20).R2[0],1);

    Expect to see the closing price of the last fully closed daily bar:
    CrossAbove(Close, Closes[1][1],1);

    Expect to return the lowest closing price of the last fully closed daily bar or the bar before that (2 days ago):
    CrossAbove(Close, MIN(Closes[1],[2])[0],1);​

    Also, for the WoodiePivots, does your response apply to all piviot indicators using DailyBars (Fibonacci, etc).

    Thanks in advance.

    r/

    Erik
    Last edited by sumobull; 07-24-2024, 10:57 PM.

    #2
    Hello sumobull,

    Thank you for your post.

    0 bars ago is the most recently closed bar, 1 bar ago is the previously closed bar, etc.

    That said, there isn't enough information provided to know if the statements are "referencing" the currently closed daily bar. What is the primary series this data series is applied to? What is the secondary series (you are referencing the Closes[][] series which implies an added data series)?

    WoodiesPivots(HLCCalculationModeWoodie.DailyBars, 20).R2[0] will get the most recent R2 value calculated on Daily Bars.

    Closes[1][1] will get the Close price of the secondary series 1 bar ago (not the most recently closed bar).
    Closes[1][2] will get the Close price of the secondary series 1 bars ago.

    Please let us know if you have any further questions.

    Comment


      #3
      Hi,

      Primary series is 5min, secondary series is daily.

      Will WoodiesPivots(HLCCalculationModeWoodie.DailyBars, 20).R2[0] be calculated on the currently forming daily bar? The documentation states that it is using the priorDayHLC, so seems this statement would return pivots based on yesterday's bar, which is what I am expecting. Is this correct?

      WoodiesPivots(HLCCalculationModeWoodie priorDayHLC, int width)

      r/

      Erik

      Comment


        #4
        Hello,

        When using additional data series, OnBarUpdate() will be called for every update bar update for each series added to the script. Therefore,

        Code:
        CrossAbove(Close, WoodiesPivots(HLCCalculationModeWoodie.DailyBars, 20).R2[0],1);
        Is going to be called for both the 5 minute series and the daily series if you don't specify something like:

        Code:
        if (BarsInProgress == 1)
        CrossAbove(Close, WoodiesPivots(HLCCalculationModeWoodie.DailyBars, 20).R2[0],1);
        This would ensure that 0 bars ago in the WoodiesPivots call is referring to "0 bars ago" on the secondary series.




        Will WoodiesPivots(HLCCalculationModeWoodie.DailyBars, 20).R2[0] be calculated on the currently forming daily bar?
        This depends on your Calculate setting. If you are using Calculate.OnBarClose, the strategy will only update on the most recently closed bar. If you want the strategy to calculate/update on the currently forming bar, you will need to use OnPriceChange or OnEachTick.

        The priorDayHLC parameter in the indicator only determines how the prior range High, Low, Close values are calculated.

        Comment


          #5
          Hi, I am looking at OnBarClose. Re the WoodiesPivots, how is it calculating the prior day HLC? If I change session templates the pivot points change. Is the indicator looking at the pricing that falls within the session template from the previous day and excluding bars outside the session times to calculate the HLC? Looks like the code for the WoodiesPivots isn't provided, unless I am missing it in the Script Explorer.

          Comment


            #6
            Hello sumobull,

            Unfortunately the code for the WoodiesPivots isn't open source and unknown to us on the support team, so I can't provide clarity on how exactly it performs it's calculations.

            However, I would expect that changing the session templates would affect the pivot point calculations. Changing the session templates will changing the amount of data you are providing to the indicator for its calculation.

            Comment

            Latest Posts

            Collapse

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