Announcement

Collapse
No announcement yet.

Pivot Point

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

  • Pivot Point

    I wonder if anyone has any advice on how to exclude certain days from this Pivotpoint EFS? I've tried the "getDay()" command but the parameters are confusing. All I'd like to do is exclude Saturday and Sunday prior to the indie start time.
    Any advice would be much appreciated,

    Angus.
    Attached Files

  • #2
    EFS

    Here's the EFS:

    PHP Code:
      function preMain() {

        
    setPriceStudy(true);

        
    setStudyTitle("HiLo");

        
    setCursorLabelName("ETH High"0);

        
    setCursorLabelName("ETH Low"1);

        
    setPlotType(PLOTTYPE_FLATLINES,0);

        
    setPlotType(PLOTTYPE_FLATLINES,1);

        
    setDefaultBarFgColor(Color.blue,0);

        
    setDefaultBarFgColor(Color.red,1);

        
    setStudyTitle("New Trading Day Marker W/HLC and Pivot Points");

        
    setShowCursorLabel(false);

        

        var 
    fp = new FunctionParameter("nHr"FunctionParameter.STRING);

        
    fp.setName("Set Hour");    

        
    fp.setDefault("17");

    }



    var 
    vHr null;

    var 
    newDay true;

    var 
    dayCntr 0;

    var 
    vClose;

    var 
    vHigh;

    var 
    vLow;

    var 
    BarCntr 0;

    var 
    bartotal 0;

    var 
    PP null;



    function 
    main(nHr) {



        var 
    nState getBarState();

        var 
    vInt getInterval();

        if (
    vInt == "D" || vInt == "W" || vInt == "M" || vInt == "1") return;

        

        if (
    nState == BARSTATE_NEWBAR) {

            if (
    newDay == false && getDay() != getDay(-1) && getDay(-1) != nullnewDay true;

            if (
    newDay == true) {

                var 
    barHr getHour()+"";

                if (
    barHr != null && barHr 10barHr "0"+barHr;

                if(
    barHr >= nHr ) {

                    
    drawLineRelative(0,0,0,99999,PS_DOT1Color.blue"NewDay"+dayCntr);

                    
    drawShapeRelative(05Shape.DIAMONDnullColor.blueShape.RELATIVETOBOTTOM"NewDay"+dayCntr);

                    
    //if (getBarState() == BARSTATE_NEWBAR)

                    
    if ( barHr nHr vClose close(-1)

                        
    BarCntr +=1;

                        
    vHigh high();

                        
    vLow low();

                        for (
    01440/vInt ; ++i) {

                            
    vHigh Math.max(high(-i), vHigh);

                            
    vLow Math.min(low(-i), vLow);

                            
    PP = ((vClose+vHigh+vLow)/3)

                            
    R1 = (2*PP)-vLow

                            S1 
    = (2*PP)-vHigh

                            R2 
    = (PP-S1)+R1

                            S2 
    PP-(R1-S1)

                            
    MPR1 = (PP+R1)/2

                            MPS1 
    = (PP+S1)/2

                            MPR2 
    = (R1+R2)/2

                            MPS2 
    = (S1+S2)/2

                            R3 
    = (2*PP)+(vHigh-(2*vLow))

                            
    S3 = (2*PP)-((2*vHigh)-vLow)

                            
    MPR3 = (R2+R3)/2

                            MPS3 
    = (S2+S3)/2

                            
    //drawLineRelative(-1440/vInt, vHigh, 0, vHigh, PS_SOLID, 2, Color.red, "High");

                            //drawLineRelative(-1440/vInt, vLow, 0, vLow, PS_SOLID, 2, Color.green, "Low");

                            //drawLineRelative(-1440/vInt, vClose, 0, vClose, PS_SOLID, 2, Color.black, "Close");

                            
    drawLineRelative(1440/vIntR30R3PS_DASH2Color.lime"R3"+BarCntr);

                            
    drawLineRelative(1440/vIntMPR30MPR3PS_DASH1Color.green"MPR3"+BarCntr);

                            
    drawLineRelative(1440/vIntR20R2PS_DASH1Color.lime"R2"+BarCntr);

                            
    drawLineRelative(1440/vIntMPR20MPR2PS_DASH1Color.green"MPR2"+BarCntr);

                            
    drawLineRelative(1440/vIntR10R1PS_DASH1Color.lime"R1"+BarCntr);

                            
    drawLineRelative(1440/vIntMPR10MPR1PS_DASH1Color.green"MPR1"+BarCntr);

                            
    drawLineRelative(1440/vIntPP0PPPS_SOLID1Color.magenta"PP"+BarCntr);

                            
    drawLineRelative(1440/vIntMPS10MPS1PS_DASH1Color.maroon"MPS1"+BarCntr);

                            
    drawLineRelative(1440/vIntS10S1PS_DASH1Color.red"S1"+BarCntr);

                            
    drawLineRelative(1440/vIntMPS20MPS2PS_DASH1Color.maroon"MPS2"+BarCntr);

                            
    drawLineRelative(1440/vIntS20S2PS_DASH1Color.red"S2"+BarCntr);

                            
    drawLineRelative(1440/vIntMPS30MPS3PS_DASH1Color.maroon"MPS3"+BarCntr);

                            
    drawLineRelative(1440/vIntS30S3PS_DASH2Color.red"S3"+BarCntr);

                            
    dayCntr += 1;

                            
    newDay false;   

                        }

                    }

                }

        return 
    PP;

        }


    Comment


    • #3
      Anyone??

      Comment


      • #4
        Does anyone from eSignal ever browse these forums and offer advice?????

        Comment


        • #5
          Re: Pivot Point

          Angus
          To do what you want you need to use the getDay() method of the Date Object and not the getDay() function (for the description and syntax of the Date Object and its methods see the link to the corresponding article in the EFS KnowledgeBase).
          FWIW this is a JavaScript object so you can find detailed information about it also in the Core JavaScript guide which is also included in the EFS KnowledgeBase.
          Additionally run a search in the EFS Studies forum for the keywords day of the week and you should find some examples of how to use the Date Object for this very purpose as this topic has been covered before
          If you are unfamiliar with programming in JavaScript then you may want to review the JavaScript for EFS video series and the Core JavaScript Reference Guide mentioned before. Those will provide you with a thorough introduction to programming in JavaScript which is at the foundation of EFS. Then go through the EFS KnowledgeBase and study the Help Guides and Tutorials which will provide you with the specifics of EFS.
          Alex


          Originally posted by Angus F
          I wonder if anyone has any advice on how to exclude certain days from this Pivotpoint EFS? I've tried the "getDay()" command but the parameters are confusing. All I'd like to do is exclude Saturday and Sunday prior to the indie start time.
          Any advice would be much appreciated,

          Angus.

          Comment


          • #6
            Re: Re: Pivot Point

            Alex,

            Thankyou for your reply. I'll post my progress as it's made.
            Your advice is much appreciated.

            Angus.

            Comment

            Working...
            X