Announcement

Collapse
No announcement yet.

PivotPoint Formulas: Time of Change

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

  • PivotPoint Formulas: Time of Change

    The standard eSignal PivotPoint formulas change pivot levels at the beginning of each day. That's fine for a daily chart, but for intraday periods (15 min, 5 min. etc.), I'd like to adjust the time of the pivot change to occur at the end of the regular session each day.

    I'm trying to create two formulas:
    1. For equities: The pivot change occurs at 1:00 PM Pacific Time.
    2. For index futures: The pivot change occurs at 1:15 PM Pacific Time.

    Does anyone have a PivotPoint formula already tweaked for the end of regular session? Or, can anyone advise re. how to adjust the existing code?

    (Attached is the PivotPointAll formula that I'm working with. It's the standard eSignal version 2.0 except that I've modified it to display S3 and R3 as well.)

    Thanks in advance.
    Attached Files

  • #2
    Attached is the new PivotPoint formula that I'm working with. This one corrects an issue related to calculation of pivots for all-session ES and NQ symbols, but it still makes the pivot change on the first bar of the new day, and not on the first bar of the after hours session on the current day.

    Still looking for a fix. Any ideas?
    Attached Files

    Comment


    • #3
      Hi Lancer,

      I'm trying to do a similar same thing to you but I have taken a different approach. I'm setting up trading times so that my system only kicks in during the hours I specify. It allows me to specify when the start/end of the day is (so I can set Pivots) as well as only allowing trade entries during certain times.




      There is another thread about restricting times...



      You can either use time templates, or instead of using 'ES M3' use 'ES M3=2'

      Cheers

      mmillar

      Comment


      • #4
        Thanks for the reply mmillar. Just to clarify, time templates are 24 hr. to display all regular session and after hours data.

        What I'm trying to do is to take a specific EFS pivots formula and modify it so that the pivot change occurs on the first bar of the current day's post-market session and not on the first bar of the next day. When trading in post-market, pivot lines are based on the current day's HLC; after the close of the current day's regular session, the prior day's HLC is old history. I'm trying to tweak the pivots formula to plot this.

        Any EFS code ideas?

        Comment


        • #5
          Bump.

          Comment


          • #6
            Hello Lancer,

            I have a possible solution for you to test. This formula, pivotpointall regular session hlc2.efs, will check for the hour of 13:00 and recalculate the new pivots based on the current day's regular session. See lines 112-118 and 128-131. The pivots will also calculate at the first bar of each day and will be based on the previous day's regular session data.
            Jason K.
            Project Manager
            eSignal - an Interactive Data company

            EFS KnowledgeBase
            JavaScript for EFS Video Series
            EFS Beginner Tutorial Series
            EFS Glossary
            Custom EFS Development Policy

            New User Orientation

            Comment


            • #7
              Thanks Jason, I gave that formula a try, but it does not pick up the correct High, Low, and Close. I'm not sure where the formula is getting the HLC values, but for every symbol checked, it was way off (e.g. the High was shown less than the true High, the Low was shown lower than the true Low, and the Close was shown higher than the true Close). Since HLC values are what all pivot lines are calculated from, no lines are where they should be. It did make the change at the 13:00 bar though. Can you identify the problem?

              Attached is the formula I'm working with.

              In edit: It is now Sun PM, and looking at live ES #F data, I have no HLC or pivot lines for today within the visible chart area; they should be extending from Friday 13:00 using Friday HLC.
              Attached Files
              Last edited by Lancer; 06-01-2003, 05:28 PM.

              Comment


              • #8
                Hi Lancer,

                I see the problem and attached a fix. Because we are using a 24-hour time template, we have to check for Sundays and adjust the vIndex accordingly. See lines 119-124.

                However, we have a new issue on Mondays. The way the getValueAbsolute() function works, we can only get it to return Friday’s (offset of -1) or Monday's data (offset of 0) on Mondays. Your formula is currently displaying Friday's HLC until 13:00. Do you want it to display Sunday's HLC on Monday?
                Attached Files
                Jason K.
                Project Manager
                eSignal - an Interactive Data company

                EFS KnowledgeBase
                JavaScript for EFS Video Series
                EFS Beginner Tutorial Series
                EFS Glossary
                Custom EFS Development Policy

                New User Orientation

                Comment


                • #9
                  Jason, thanks for taking a look at that.

                  From Friday 13:00 to Monday 13:00, the HLC and pivots should be based on Friday's HLC (regular session close at 13:00). After 13:00 on Monday, it changes to using Monday's HLC. And so on through the week. That's the formula for equities. For index futures, the RTH (regular session) close is at 13:15 each day. Sunday's HLC is ignored.

                  So not to be confusing, getting back to my original post, what I'm trying to do is create two formulas:
                  1. For equities: The pivot change occurs at 1:00 PM Pacific Time.
                  2. For index futures: The pivot change occurs at 1:15 PM Pacific Time.

                  Thank you.

                  Comment


                  • #10
                    Bump.

                    Comment


                    • #11
                      Hi Lancer,

                      This should work for you. Make a copy of the previous formula with a new name and change the logic that starts at line 109 where we check for the end of the session to the example below.

                      PHP Code:
                          //check for end of session.
                          
                      var vEOS false;
                          if (
                      vEndOfDayFound == false) {
                              var 
                      vBarHour getHour()*100;
                              var 
                      vBarMin getMinute();
                              var 
                      vBarTime vBarHour vBarMin;
                              if (
                      vBarTime >= 1315vEOS true;
                          } 
                      Jason K.
                      Project Manager
                      eSignal - an Interactive Data company

                      EFS KnowledgeBase
                      JavaScript for EFS Video Series
                      EFS Beginner Tutorial Series
                      EFS Glossary
                      Custom EFS Development Policy

                      New User Orientation

                      Comment


                      • #12
                        Jason,

                        A major problem with the prior version of the pivots formula and this version too is that if the symbol is changed, or the current symbol reloaded during the regular session, the pivots will calculate differently on charts of different time periods.

                        For example, the pivots display properly on a 13 min chart, but on a 3 min. chart, the formula wants to place the line for the prior day's Close at the current bar Close, etc., with all pivots calculated incorrectly from that.

                        Any solution?

                        Here is the file to work with:
                        Attached Files

                        Comment


                        • #13
                          Bump.

                          Jason, there's definitely something wrong with the pivots formula; (attached in prior post).

                          At the time the formula is supposed to recalculate pivots, it does, but then all pivots go to zero. The symbol has to be reloaded to get the pivots back up to normal values, but then the High, Low, Close lines are often off considerably. As is, the formula results are just completely unreliable.

                          In edit: Odd thing is that it behaves differently on charts with different intraday time periods. A 15 min chart might display all pivots at zero, while at the same time a 5 min chart might have High Low Close misplaced, but not at zero.
                          Last edited by Lancer; 06-18-2003, 03:17 PM.

                          Comment


                          • #14
                            Bump.

                            Comment


                            • #15
                              Hello Lancer,

                              So far I've not been able to reproduce the problems you're seeing. I've changed symbols, intervals and time templates multiple times. I haven't seen any problems with zero lines or miscalculated HLC pivots. Here's what I'm seeing with build 602.
                              Please review the questions I have for you below the images.





                              Questions:
                              1. Are there specific symbols that generate these errors?
                              2. What time template are you using and are there specific time templates that get the errors?
                              3. What build number are you using?
                              4. Is there a specific day of the week that generates the errors?
                              5. Are you able to reproduce any of the errors today? If so, please give me a detailed step-by-step example of what you do that generates the error with the time template, symbol and interval. Post some images of the errors here.
                              Jason K.
                              Project Manager
                              eSignal - an Interactive Data company

                              EFS KnowledgeBase
                              JavaScript for EFS Video Series
                              EFS Beginner Tutorial Series
                              EFS Glossary
                              Custom EFS Development Policy

                              New User Orientation

                              Comment

                              Working...
                              X