Announcement

Collapse
No announcement yet.

MAOverBoughtOverSold.efs

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

  • MAOverBoughtOverSold.efs

    File Name: MAOverBoughtOverSold.efs

    Description:
    Moving Average (default of 13) of an Over Bought/Over Sold indicator: (((high-open) + (close-low))/ ((2*(high-low)))*100

    Formula Parameters:
    nLength: Default is 13 for moving average

    Notes:


    Download File:
    MAOverBoughtOverSold.efs




    EFS Code:
    PHP Code:
    /*********************************
    Provided By : eSignal. (c) Copyright 2003
    *********************************/
    addBand(80PS_SOLID2Color.black"upper")
    addBand(20PS_SOLID2Color.black"lower")

    function 
    preMain() {
        
    setStudyTitle("Over Bought / Over Sold");
        
    setCursorLabelName("OB/OS"0);
        
    setCursorLabelName("OB/OS MA"1);
     
        
    setDefaultBarFgColor(Color.blue0);
        
    setDefaultBarFgColor(Color.red1);
        
    setDefaultBarThickness(10);
        
    setDefaultBarThickness(21);
        
        
    setStudyMax(100);
        
    setStudyMin(0);
    }

    var 
    aMA null;
    var 
    vret null;
     
    function 
    main(nLength) {
        if (
    nLength == null)
            
    nLength 13;
        
        if (
    aMA == null)
            
    aMA = new Array(13);
     
        var 
    open();
        var 
    high();
        var 
    low();
        var 
    close();
        var 
    vret = (((h-o)+(c-l))/(2*(h-l)))*100
        
        
    if (getBarState() == BARSTATE_NEWBAR) {
            
    aMA.pop();
            
    aMA.unshift(vret)
        } else {
            
    aMA[0] = vret;
        }
        
        var 
    dSum 0;
        if (
    aMA[nLength-1] != null) {
            for (
    0nLength; ++i) {
                
    dSum += aMA[i];
            }
            var 
    vMA dSum/nLength;
        } else {
            return;
        }
        
        return new Array(
    vretvMA);

    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