Stock Portfolio Organizer

The ultimate porfolio management solution.

Shares, Margin, CFD's, Futures and Forex
EOD and Realtime
Dividends and Trust Distributions
And Much More ....
Find Out More Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

Advanced Adaptive Indicators
Advanced Pattern Exploration
Neural Networks
And Much More ....
Find Out More Here

Weight + Volume + Move-Adjusted Moving Average for eSignal (EFS)

Rating:
0 / 5 (Votes 0)
Tags:
eSignal, moving average

This is a moving average adjusted by both volume and size of a move. All credit to the original author.

You can read more about it here

Indicator / Formula

Copy & Paste Friendly
/*********************************************************
By Alexis C. Montenegro © September 2006                  
Use and/or modify this code freely. If you redistribute it
please include this and/or any other comment blocks and a 
description of any changes you make.                      
**********************************************************/

var fpArray = new Array();

function preMain() {
    setPriceStudy(true);
    setStudyTitle("WEVOMO");
    setCursorLabelName("WEVOMO",0);
    setDefaultBarFgColor(Color.blue,0);
    setPlotType(PLOTTYPE_LINE,0);
    setDefaultBarThickness(1,0);
    var x=0;
    fpArray[x] = new FunctionParameter("Type", FunctionParameter.STRING);
    with(fpArray[x++]){
        addOption("MOMA");
        addOption("VOMA");
        addOption("VOMOMA");
        addOption("WEVOMO");
        setDefault("WEVOMO");
	}
    fpArray[x] = new FunctionParameter("Length", FunctionParameter.NUMBER);
	with(fpArray[x++]){
        setLowerLimit(1);		
        setDefault(10);
    }
	fpArray[x] = new FunctionParameter("Source", FunctionParameter.STRING);
	with(fpArray[x++]){
        addOption("open"); 
        addOption("high");
        addOption("low");
        addOption("close");
        addOption("hl2");
        addOption("hlc3");
        addOption("ohlc4"); 
        setDefault("close"); 
    }
	fpArray[x] = new FunctionParameter("Symbol", FunctionParameter.STRING);
    with(fpArray[x++]){
        setDefault();
	}
	fpArray[x] = new FunctionParameter("Interval", FunctionParameter.STRING);
	with(fpArray[x++]){
        setDefault();
    }
    fpArray[x] = new FunctionParameter("Params", FunctionParameter.BOOLEAN);
	with(fpArray[x++]){
        setName("Show Parameters");
        setDefault(false);
    }
}

var bInit = false;
var xWEVOMO   = null;

function main(Type,Length,Source,Symbol,Interval,Params){
    if(bInit == false){
        if(Symbol == null) Symbol = getSymbol();
        if(Interval == null) Interval = getInterval();
        var vSymbol = Symbol+","+Interval;
        xWEVOMO = getSeries(efsInternal("calcAvg",Type,Length,eval(Source)(sym(vSymbol))));
        setShowTitleParameters(eval(Params));
        bInit = true;
    }
    return xWEVOMO;
}

var xVol = null;
var xAvg = null;

function calcAvg(type,length,source){
    if(getCurrentBarCount()<=length+1) return;
    if(xVol==null) xVol = volume();
    if(xAvg==null) xAvg = wma(length,source);
    var SumVol = 0;
    var Value1 = 0;
    var MOMA = 0;
    var VOMA = 0;
    for (var i=0; i<length; i++){
        SumVol += xVol.getValue(-i);
        Value1 += Math.abs(source.getValue(-i)-source.getValue(-(i+1)));
    }
    if(SumVol<=0 || Value1<=0) return;
    for (var i=0; i<length; i++){
        MOMA += source.getValue(-i)*(Math.abs(source.getValue(-i)-source.getValue(-(i+1)))/Value1);
        VOMA += source.getValue(-i)*(xVol.getValue(-i)/SumVol);
    }
    var WEMA = xAvg.getValue(0);
    if(MOMA==null||VOMA==null||WEMA==null) return;
    if(type=="WEVOMO"){
        var ret = (WEMA+VOMA+MOMA)/3;
    }else if(type=="VOMOMA"){
        var ret = (VOMA+MOMA)/2;
    }else if(type=="VOMA"){
        var ret = VOMA;
    }else if(type=="MOMA"){
        var ret = MOMA;
    }
    return ret;
}

1 comments

1. actais

Not working.

Leave Comment

Please login here to leave a comment.

Back