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 ....
For Portfolio Manager Click Here

WiseTrader Toolbox

#1 Selling Amibroker Plugin featuring:

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

EMA - ATR volatility adjusted for Metastock
martin3
about 14 years ago
Metastock

Rating:
0 / 5 (Votes 0)
Tags:
metastock, atr

ATR volatility-adjusted, dynamic-period EMA with multiple output choice

Created By Jose Silva at MetastockTools.com

Screenshots

Files

Indicator / Formula

Copy & Paste Friendly

MetaStock -> Tools -> Indicator Builder -> New Copy and paste formula

{ ATR volatility-adjusted, dyn-period EMA v2.1 }

{ Positive sensitivity:
 EMA periodicity shortens on high ATR volatility
 - increases on low ATR volatility }
{ Negative sensitivity:
 EMA periodicity shortens on low ATR volatility
 - increases on high ATR volatility }

{ [1]EMA:         ATR volatility-adjusted EMA }
{ [2]Dyn periods: EMA periodicity used }
{ [3]ATR vlty:    ATR volatility 0~100% }
{ [4]Signals:     EMA/price crossover signals }

{ ©Copyright 2004 Jose Silva }
{ http://www.metastocktools.com }

pds:=Input("EMA avg periods",1,2520,21);
sens:=Input("ATR volatility sensitivity (+100 to -100)%",-100,100,100)/100;
pdsVlty:=Input("ATR volatility sampling periods",2,2520,126);
pdsATR:=Input("ATR periods",1,2520,10);
x:=Input("[1]Open  [2]High  [3]Low  [4]Close  [5]Vol  [6]P",1,6,4);
plot:=Input("[1]EMA,  [2]Dyn periods,  [3]ATR vlty,  [4]Signals",1,4,1);

x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C)))));
ATRvlty:=(ATR(pdsATR)-LLV(ATR(pdsATR),pdsVlty))
 /(HHV(ATR(pdsATR),pdsVlty)
 -LLV(ATR(pdsATR),pdsVlty)+.000001);
multi:=If(ATRvlty<=.5,
 10*Power(ATRvlty,3.4739)+.1,
 10*Power(ATRvlty,3.32)+.000001);
multi:=If(sens>0,1/multi,multi);
multi:=If(multi<1,1-(1-multi)*Abs(sens),
 (multi-1)*Abs(sens)+1);
pds:=pds*multi;
pds:=If(pds>Cum(IsDefined(x))-(pdsVlty+pdsATR),
 Cum(IsDefined(x))-(pdsVlty+pdsATR),pds);
pds:=If(pds<1,1,pds);
ATREma:=x*2/(pds+1)+PREV*(1-2/(pds+1));
signals:=Cross(x,ATREma)-Cross(ATREma,x);

If(plot=2,pds,If(plot=3,ATRvlty*100,
 If(plot=4,signals,ATREma)))

0 comments

Leave Comment

Please login here to leave a comment.

Back