log in     sign up for free
 
Winning streaks lead to complacency, and complacency leads to sloppy trading.
Jack D. Schwager
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time Data
 

Buy

MetaStock

     (special offer)
 
 
 

Buy

EOD data for MetaStock

     (special offer)
 
 
 

Buy

Realtime data for MetaStock

     (special offer)
 
 
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Exponential Moving Average - %Price Change - Filtered

Formula for: MetaStock

indicator


 

 

Views:  1326

Added: June 23, 2007
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: MetaStock, indicator
 
Your Ad Here
Exponential Moving Average, price-change filtered. Ignores prices outside min/max % price-change zone.

 

 



Code:

Exponential Moving Average - %Price Change - Filtered

{ Filtered Exponential Moving Average v1.1 }
{ EMA ignores prices outside min/max % zone }
{ EMA periodicity shortens on low bar count }
{ (c) Copyright 2004 Jose Silva }
{ http://www.metastocktools.com }

{ User inputs }
pds:=Input("EMA periods",1,2520,21);
minCh:=Input("Minimum % price change",
0,100,2)/100;
maxCh:=Input("Maximum % price change",
0,100,5)/100;
x:=Input("use Open=1 High=2 Low=3 Close=4 WClose=5 P=6",1,6,4);
shift:=Input("EMA vertical shift %",
-100,100,0)/100+1;
plot:=Input("[1]EMA, [2]Crossover signals",
1,2,1);

{ Price field selection }
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),If(x=6,P,C)))));

{ Price filter }
change:=Abs(x/Ref(x,-1)-1);
filter:=change>=minCh AND change<=maxCh;
x:=ValueWhen(1,filter,x);

{ Reduce periodicity on low bar count }
pds:=If(pds>Cum(IsDefined(x)),
Cum(IsDefined(x)),pds);

{ EMA formula }
Ema:=x*2/(pds+1)+PREV*(1-2/(pds+1));

{ EMA shift }
Ema:=Ema*shift;

{ EMA crossover signals }
signals:=Cross(x,Ema)-Cross(Ema,x);

{ Plot EMA on price chart }
If(plot=2,signals,Ema)


 






Author: Jose Silva
Source: http://www.metastocktools.com

 

View similar (indicator for MetaStock):

Front Weighted 36 Day Moving Average
Directional Breakout
rris RSI w / Volume
CandleCode II and Candle Strength Index
Elder's Impulse
Volume Accumulation Percentage
Stochastic RSI - Tema Smoothed
Chande's VIDYA 21,5 Indicator
Short Volume Wave
Chande's Vidya Using P Variable - Version II
...
 
 
all formulas for MetaStock
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012