[MT4指标]均线震荡过滤指标
主图指标,均线震荡过滤指标
mt4指标类型:趋势指标
是否能用在mt4手机版上:否
是否含有未来函数:无
//+------------------------------------------------------------------+
//| Die St鋜ke des Corrected Average (CA) besteht darin, |
//| dass der aktuelle Wert der Zeitreihe einen von der momentanen |
//| Volatilit鋞 abh鋘gigen Schwellenwert 黚erschreiten muss, |
//| damit der Filter steigt bzw. f鋖lt, wodurch Fehlsignale |
//| in trendschwachen Phasen vermieden werden. |
//| -A.Uhl- |
//+------------------------------------------------------------------+
//|Germany, 23.03.2007
#property copyright "A.Uhl, ? RickD 2006, Alexander Piechotta"
#property link "http://onix-trade.net/forum/"
//----
#define major 1
#define minor 0
//----
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 Gold
//----
extern int MA.Period=35;
extern int MA.method=MODE_SMA;
extern int MA.applied_price=PRICE_CLOSE;
//----
double MABuf;
double CABuf;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void init()
{
IndicatorBuffers(2);
SetIndexStyle(2, DRAW_LINE, STYLE_SOLID,1);
SetIndexDrawBegin(0, MA.Period);
//
SetIndexBuffer(0, CABuf);
SetIndexBuffer(1, MABuf);
IndicatorShortName("Corrected Average (CA) ("+MA.Period+")");
}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void deinit()
{}
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
void start()
{
int counted=IndicatorCounted();
if (counted < 0) return(-1);
if (counted > 0) counted--;
int limit=Bars-counted;
double v1, v2, k;
//----
for(int i=limit-1; i>=0; i--)
{
MABuf=iMA(NULL, 0, MA.Period, 0, MA.method, MA.applied_price, i);
if (i==Bars-1)
{
CABuf=MABuf;
continue;
}
v1=MathPow(iStdDev(NULL, 0, MA.Period, 0, MA.method, MA.applied_price, i), 2);
v2=MathPow(CABuf[i+1] - MABuf, 2);
//----
k=0;
if (v2 < v1 || v2==0) k=0; else k=1 - v1/v2;
CABuf=CABuf[i+1] + k*(MABuf-CABuf[i+1]);
}
}
//+------------------------------------------------------------------+i-CAi.jpg
发表于:2017-04-27 15:05只看该作者
2楼
666666666666666666
韬客社区www.talkfx.co
发表于:2017-05-13 17:05只看该作者
3楼
韬客社区www.talkfx.co
发表于:2017-09-05 04:53只看该作者
5楼
路过
韬客社区www.talkfx.co