Announcement

Collapse
No announcement yet.

Pivot calculation is wrong

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

  • Pivot calculation is wrong

    I have plotted PivotPoint.efs that is supplied with eSignal on symbol GBP@TDFX A0-FX and it is incorrectly calculating the Pivot point.

    If we look at yesterday ( Jan 30th 2008) 1 hour chart the High=1.9958 Low=1.9824 Close=1.9837 so the calculation should be :

    (H+L+C)/3 = 1.9873

    But it is calculating and displaying the pivot as 1.9893

    Can you check it out and advise whats going wrong.

    thanks

    Here is the PivotPoint.efs code:

    /************************************************** ****************************************
    Copyright © eSignal, a division of Interactive Data Corporation. 2005. All rights reserved.
    This sample eSignal Formula Script (EFS) may be modified and saved under a new filename;
    however, eSignal is no longer responsible for the functionality once modified.
    eSignal reserves the right to modify and overwrite this EFS file with each new release.
    @version 3.0 by Alexis Montenegro for eSignal
    ************************************************** *****************************************/

    function preMain() {
    setPriceStudy(true);
    setStudyTitle("Pivot Point");
    setCursorLabelName("Pivot Point");
    // Pivot Point
    setDefaultBarStyle(PS_SOLID);
    setDefaultBarFgColor(Color.RGB(0,0,0));
    setDefaultBarThickness(1);
    }

    var bInit = false;
    var xHigh = null;
    var xLow = null;
    var xClose = null;
    var vPP = null;

    function main() {

    if(isMonthly() || isWeekly())
    return;

    if(bInit == false){
    xHigh = high(inv("D"));
    xLow = low(inv("D"));
    xClose = close(inv("D"));
    bInit = true;
    }

    var vHigh = xHigh.getValue(-1);
    var vLow = xLow.getValue(-1);
    var vClose = xClose.getValue(-1);
    if(vHigh == null || vLow == null || vClose == null)
    return;

    vPP = (vHigh+vLow+vClose)/3;

    return (vPP);
    }
    Last edited by Wiggle; 01-31-2008, 10:55 AM.

  • #2
    Re: Pivot calculation is wrong

    Wiggle
    The PivotPoint.efs uses the HLC values of the daily bar to calculate the Pivots. As far as I can see the daily bar for GBP@TDFX A0-FX for Januray 30 is showing the following values (see first screenshot enclosed below)
    High 1.9958
    Low 1.9841
    Close 1.9882
    The result of the sum of the three values (5.9681) divided by 3 is 1.98937 which is what is reported by the efs (see second screenshot)
    Alex







    Originally posted by Wiggle
    I have plotted PivotPoint.efs that is supplied with eSignal on symbol GBP@TDFX A0-FX and it is incorrectly calculating the Pivot point.

    If we look at yesterday ( Jan 30th 2008) 1 hour chart the High=1.9958 Low=1.9824 Close=1.9837 so the calculation should be :

    (H+L+C)/3 = 1.9873

    But it is calculating and displaying the pivot as 1.9893

    Can you check it out and advise whats going wrong.

    thanks

    Here is the PivotPoint.efs code:

    /************************************************** ****************************************
    Copyright © eSignal, a division of Interactive Data Corporation. 2005. All rights reserved.
    This sample eSignal Formula Script (EFS) may be modified and saved under a new filename;
    however, eSignal is no longer responsible for the functionality once modified.
    eSignal reserves the right to modify and overwrite this EFS file with each new release.
    @version 3.0 by Alexis Montenegro for eSignal
    ************************************************** *****************************************/

    function preMain() {
    setPriceStudy(true);
    setStudyTitle("Pivot Point");
    setCursorLabelName("Pivot Point");
    // Pivot Point
    setDefaultBarStyle(PS_SOLID);
    setDefaultBarFgColor(Color.RGB(0,0,0));
    setDefaultBarThickness(1);
    }

    var bInit = false;
    var xHigh = null;
    var xLow = null;
    var xClose = null;
    var vPP = null;

    function main() {

    if(isMonthly() || isWeekly())
    return;

    if(bInit == false){
    xHigh = high(inv("D"));
    xLow = low(inv("D"));
    xClose = close(inv("D"));
    bInit = true;
    }

    var vHigh = xHigh.getValue(-1);
    var vLow = xLow.getValue(-1);
    var vClose = xClose.getValue(-1);
    if(vHigh == null || vLow == null || vClose == null)
    return;

    vPP = (vHigh+vLow+vClose)/3;

    return (vPP);
    }

    Comment


    • #3
      I agree that the daily chart shows your figures but if you look at a 60 minute chart you will see that my figures are correct for the period 00:00 - 23:59 GMT and they are vastly different to the daily ones.

      I have attached the chart
      Both figures cannot be correct.

      Last edited by Wiggle; 01-31-2008, 02:49 PM.

      Comment


      • #4
        Wiggle
        In eSignal the Forex session (which is covered by the daily bar) does not begin at 00:00 but at 14:00 PST (15:00 PDT).
        For the complete details on Forex data in eSignal you may want to review this article in the eSignal KnowledgeBase
        Alex


        Originally posted by Wiggle
        I agree that the daily chart shows your figures but if you look at a 60 minute chart you will see that my figures are correct for the period 00:00 - 23:59 GMT and they are vastly different to the daily ones.

        I have attached the chart
        Both figures cannot be correct.

        Comment


        • #5
          Hi Alex thankyou for the explanation but I can't find any bars in a 24 hr period around that day that have the same HLC values as quoted on the daily bar chart even taking into account that PST is GMT - 8 hrs.

          Can you post a screen shot of this symbol using a 60 min chart showing the correct start and end bars for that day that correlate with the daily HLC values.

          thanks
          Originally posted by Alexis C. Montenegro
          Wiggle
          In eSignal the Forex session (which is covered by the daily bar) does not begin at 00:00 but at 14:00 PST (15:00 PDT).
          For the complete details on Forex data in eSignal you may want to review this article in the eSignal KnowledgeBase
          Alex

          Comment


          • #6
            Wiggle
            As explained in the linked article the High and Low are based on the highest Bid and lowest Ask respectively.
            As far as I can see on a tick chart the lowest Ask was on January 30 at 14:14:11 and then again at 14:14:41 while the highest Bid was at 15:08:48, 15:08:49, 15:08:57 and lastly at 15:10:23 (see enclosed screenshots).
            These values match the ones reported in the daily bar.





            With regards to the Close this should be based on the Bid but I have not been able to match it on the tick chart so there seems to be a discrepancy on that value.
            Having said that the issue you reported initially was that the calculations of PivotPoint.efs were incorrect. As I explained in a previous post those calculations are based on the daily bar and as far as I can see they are correct given the values of the daily bar.
            If at this point you wish to report a discrepancy in the data then you should post that in the Data Inquiries forum which is the appropriate forum for the topic since it is not an issue related to efs.
            Alex


            Originally posted by Wiggle
            Hi Alex thankyou for the explanation but I can't find any bars in a 24 hr period around that day that have the same HLC values as quoted on the daily bar chart even taking into account that PST is GMT - 8 hrs.

            Can you post a screen shot of this symbol using a 60 min chart showing the correct start and end bars for that day that correlate with the daily HLC values.

            thanks

            Comment

            Working...
            X