Announcement

Collapse
No announcement yet.

SP H3 Day High vs 24hr High

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

  • SP H3 Day High vs 24hr High

    For example, 2/20/2003 SPH3 high was 849.30 for the day starting at 9:30 EST. High for the 24hr day was 851.80.

    Using:

    ...
    vSymbol = getSymbol();
    vSymbol += ",D";
    ...
    day0 = new Date(2003, 1, 21); //feb 21
    day1 = getPreviousTradingDay(day0);
    vIndex = getFirstBarIndexOfDay(day1, vSymbol);
    vH = getValueAbsolute("High", vIndex, vSymbol);

    vH value is 851.80 (NOT what I need).
    What code do I need to get the regular day high (849.30)?
    Thank you in advance.

  • #2
    add'l comment

    btw...
    this is true whether you are using Daily or 60min or 30min chart.

    Comment


    • #3
      philtong
      In the specific case of SP (and other CME products) probably the simplest solution would be to use the pit session only symbol ie SP H3=2.
      However, that does not solve your problem when it comes to instruments that do not have specific symbols for the various sessions.
      Alex

      Comment


      • #4
        Getting the high for the session...

        Phil,

        The only way I know to do this is to calculate the high as you are stepping through the daily data..

        I wrote a routine that recorded the OPEN of the day based on a Time-Template. I have converted this to record the HIGH of the day.. Check it out If it can help you great - if you have more questions, please let me know.

        Brad

        PHP Code:
        var vLastCompDay 0;
        var 
        DailyHigh 0;

        function 
        main() {
             var 
        CompDate = new Date();
             var 
        CompDay;
             var 
        CompHour;
             var 
        CompMin;
           
              
        CompDate getValue("Time"0);
              
        CompDay CompDate.getDate();
              
        CompHour CompDate.getHours();
              
        CompMin CompDate.getMinutes();
            
        //  Set the hour and min variables to the start of trading in your time zone.
             
        if ((CompDay != vLastCompDay) && (CompHour == 9) && (CompMin == 30)  ) {
               
        vLastCompDay CompDay;
              
        //  Reset Daily high to a negative number. - so next high price is going to adjust this value.
               
        DailyHigh = -99999;
             }

            
        DailyHigh Math.max(DailyHigh,high());

        Of course, this routine will continually adjust the DailyHigh variable to the actual Daily high of the current day. If the market makes new highs through the trading session, the DailyHigh number will change to these levels.

        Hope this helps..

        Brad
        Brad Matheny
        eSignal Solution Provider since 2000

        Comment


        • #5
          Correction....

          That last line should read...

          DailyHigh = Math.max(DailyHigh,high());
          Brad Matheny
          eSignal Solution Provider since 2000

          Comment

          Working...
          X