Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy trading off yesterday Pivots

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

    #16
    Hello GKonheiser,

    Thank you for your response.

    On the fourth the Pivot Levels are going to be the thirds, until we reach the fifth in which the fourth's levels are now it's own and the fifth's are the fourths. Because we are using the values of the previous day the current Pivot Levels are yesterday's, until we reach the next day in which the Pivot Levels for yesterday are now it's own and today's are yesterday's, again until tomorrow.

    The orders are being placed correctly based on yesterday's Pivot Levels. The day the orders are placed is the current day which means it's Pivot Levels are from the day prior.

    Please let me know if I may be of further assistance.

    Comment


      #17
      Hi Patrick,

      Am I correct in saying that Highs[1][0] refers to the day bar that is currently forming, (assuming Day bars are index 1)?

      I've now set the the calculation of the pivots based on bars[0] ie Highs[1][0] and although im not sure why it is correct (giving me the pivots based on the high low and close of yesterdays bars) it is.

      But now I have the problem i was mentioning earlier that the DrawLines are now incorrect, why would this be if they are based of the same calculation?

      Comment


        #18
        Hello GKonheiser,

        Thank you for your response.

        Can you provide the now altered code so I may test this further on my end?

        I look forward to assisting you further.

        Comment


          #19
          Please find the code attached
          Attached Files

          Comment


            #20
            Hello GKonheiser,

            Thank you for your response.

            I do not see any issue with the plot of the DrawLine()s in your script and on the chart. It could be that you are referring to the fact that the current day's bar has yet to close in historical data for the current day. On historical data we only have the Open, High, Low and Close once the bar closes. but a Daily bar has yet to close within it's intra day, so we still have yesterday's levels for today.

            Comment


              #21
              Patrick the point is this. I want to trade of the pivots that are calculated on the High, Low and Close of the previous day.

              When I set my strategy to use Bars[1][1], at 8.05 the next day it should be looking at the Bars of the Day bar just closed.

              IE If you take 21st Dec 2012 for FGBL 03-13 , the High, Low and Close for the 20th were 144.50, 144.16 and 144.32 respectively.

              So using Highs[1][1], Lows[1][1] and Closes[1][1] in the calculation done on 21st I expect the pivot to be (144.50 + 144.16 + 144.32)/3 = 144.33

              Now that is what I see when I look at the chart for the 21st, the Pivot line draw at 144.33 but when I look at the output window for the 21st the value it has for the pivot and the values are for Highs[1][1], Lows[1][1] and Closes[1][1] are the values from 19th not 20th.

              So the 2 points are if we are on 21st shouldn't Highs[1][1] be the values for the 20th NOT 19th, otherwise how would you reference the current Day Bar that is forming.

              Secondly why is the Pivot draw correctly based on the Values of the 20th while the output window is showing a different value for the pivot when it is the same calculation,


              IE At session begin on the 21st it calculates its Pivot Point for Drawline and for the trading entry price with,

              pp = Math.Round((Highs[1][1] + Lows[1][1] + Closes[1][1])/3,2);

              But the draw line is at the level I expect while the output window shows me a different value for the Pivot.

              Comment


                #22
                Hello GKonheiser,

                Thank you for your response.

                This occurs due to the fact that historical Daily bars are only the Open, High, Low and Close. So at 8:05 AM the Daily bar has yet to close. If we call the Highs[1][1] at 8:05 AM and we have CalculateOnBarClose set to True then this will not pull yesterday's High because yesterday's Daily bar is still bar index 0 as we are using CalculateOnBarClose = true. Even if we use CalcualteOnBarClose = false the historical data is still going to be CalculateOnBarClose = true, so all historical bars will pull the day before's close with the bar index 1.

                Please let me know if I may be of further assistance.

                Comment

                Latest Posts

                Collapse

                Topics Statistics Last Post
                Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                0 responses
                648 views
                0 likes
                Last Post Geovanny Suaza  
                Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                0 responses
                369 views
                1 like
                Last Post Geovanny Suaza  
                Started by Mindset, 02-09-2026, 11:44 AM
                0 responses
                108 views
                0 likes
                Last Post Mindset
                by Mindset
                 
                Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                0 responses
                572 views
                1 like
                Last Post Geovanny Suaza  
                Started by RFrosty, 01-28-2026, 06:49 PM
                0 responses
                573 views
                1 like
                Last Post RFrosty
                by RFrosty
                 
                Working...
                X