Announcement

Collapse
No announcement yet.

PivotPointAllmonthly.efs

Collapse
This topic is closed.
X
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • PivotPointAllmonthly.efs

    File Name: PivotPointAllmonthly.efs

    Description:
    Plots Monthly Pivot Points and may be used with intra-day, Daily or Weekly intervals.

    Formula Parameters:


    Notes:


    Download File:
    PivotPointAllmonthly.efs




    EFS Code:
    PHP Code:
    /*********************************
    Provided By : eSignal. (c) Copyright 2003
    *********************************/

    function preMain() {
        
    setPriceStudy(true);
        
    setStudyTitle("Monthly Pivot Points");
        
    setCursorLabelName("PP-R2"0);
        
    setCursorLabelName("PP-R1"1);
        
    setCursorLabelName("PP"2);
        
    setCursorLabelName("PP-S1"3);
        
    setCursorLabelName("PP-S2"4);
        
        
    // R2
        
    setDefaultBarStyle(PS_DASH0);
        
    setDefaultBarFgColor(Color.RGB(255,0,0), 0);
        
    setDefaultBarThickness(20);

        
    // R1
        
    setDefaultBarStyle(PS_DOT1);
        
    setDefaultBarFgColor(Color.RGB(0,0,255), 1);
        
    setDefaultBarThickness(21); 

        
    // Pivot  Point
        
    setDefaultBarStyle(PS_SOLID2);
        
    setDefaultBarFgColor(Color.RGB(0,0,0), 2);
        
    setDefaultBarThickness(22);

        
    // S1
        
    setDefaultBarStyle(PS_DOT3);
        
    setDefaultBarFgColor(Color.RGB(0,0,255), 3);
        
    setDefaultBarThickness(23);

        
    // S2
        
    setDefaultBarStyle(PS_DASH4);
        
    setDefaultBarFgColor(Color.RGB(255,0,0), 4);
        
    setDefaultBarThickness(24);
    }

    var 
    vLastPP null;
    var 
    vLastPPR1 null;
    var 
    vLastPPR2 null;
    var 
    vLastPPS1 null;
    var 
    vLastPPS2 null;
    var 
    vLastArray null;
    var 
    vSymbol null;
    var 
    vInterval null;
    var 
    vReset true;

    function 
    main() {   
        var 
    vH;
        var 
    vL;
        var 
    vC;
        var 
    vBarTime;
        var 
    vIndex;

        var 
    nState getBarState();
        if(
    vReset == true) {
            
    vLastArray null;
            
    vLastPP null;
            
    vLastPPR1 null;
            
    vLastPPR2 null;
            
    vLastPPS1 null;
            
    vLastPPS2 null;
            
    vInterval getInterval();
            
    vSymbol getSymbol();
            
    vSymbol += ",M";
            
    vReset false;
        }
        
        if(
    vInterval == null)
            return 
    null;
      
        if(
    vInterval == "M")
            return 
    null;
            
        if(
    vInterval == "T")
            return 
    null;

        var 
    vMonth0 getMonth();
        var 
    vMonth1 getMonth(-1);
        if (
    vMonth0 != vMonth1) {
        
    vBarTime getValue("time");
        var 
    vTime = new Date();
        if(
    vBarTime != null) {
            if (
    vTime.getYear() == vBarTime.getYear()) {
                
    vIndex = ((vTime.getMonth()+vBarTime.getMonth()+1) * -1)+1;
            } else {
                
    vIndex = (((vTime.getMonth()++ ((vTime.getYear() - vBarTime.getYear()) * 12)) - vBarTime.getMonth()+1) * -1)+1;
            }
            if(
    vIndex != null) {
                
    vH getValueAbsolute("High"vIndexvSymbol);
                
    vL getValueAbsolute("Low",  vIndexvSymbol);
                
    vC getValueAbsolute("Close"vIndexvSymbol);
                if(
    vH != null && vL != null && vC != null) {
                    
    vLastPP = (vH vL vC) / 3;
                    
    vLastPPR1 vLastPP vL;
                    
    vLastPPS1 vLastPP vH;
                    
    vLastPPR2 = (vLastPP vLastPPS1) + vLastPPR1;
                    
    vLastPPS2 vLastPP - (vLastPPR1 vLastPPS1);
                    
    vLastArray = new Array(vLastPPR2vLastPPR1vLastPPvLastPPS1vLastPPS2);

                    return 
    vLastArray;
                }
            } 
        }
        }

        return 
    vLastArray;

    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
Working...
X