File Name: WeeklyMidpointOnIntraday.efs

Description:
Draws the previous week’s midpoint on intra-day charts.

Formula Parameters:


Notes:


Download File:
WeeklyMidpointOnIntraday.efs




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

function preMain() {
    
setPriceStudy(true);
    
setStudyTitle("Weekly Midpoint ");
    
setDefaultBarFgColor(Color.lime);
    
setCursorLabelName("Wk Midpoint");
}

var 
vMid null;
var 
vMid1 null;

function 
main() {    
    var 
vI getInterval();
    if (
vI == "M" || vI == "W" || vI == "D") return;

    var 
vSymbol getSymbol() + ",W";

    var 
vDay0 getDay();
    var 
vDay1 getDay(-1);
    if (
vDay0 != vDay1) {
        
vMid1 vMid;
        var 
vBarTime getValue("time");
        if(
vBarTime != null) {
            
vIndex getFirstBarIndexOfDay(vBarTimevSymbol);
            if(
vIndex != null) {
                
vH getValueAbsolute("High"vIndexvSymbol);
                
vL getValueAbsolute("Low",  vIndexvSymbol);
                if(
vH != null && vL != null) {
                    
vMid = (vH vL) / 2;
                    return 
vMid1;
                }
            } 
        }
    }

    return 
vMid1;