PPCI指标
计算公式:(高点+低点)/2-加权移动平均线基本思路是衡量K线波动中枢对均线的偏离程度,转他人。看了一下,做均值回归或者发散指标均可,短线为宜,回测注意,因为涉及高低点对回测数据质量要求较高。
源代码:
------------------------------
//+------------------------------------------------------------------+
//| PCCI.mq4
//|
//+------------------------------------------------------------------+
#property copyright "Copyright 2002, Finware.ru Ltd."
#property link "http://www.125808047.com/"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Blue
//---- buffers
double PCCIBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator line
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,PCCIBuffer);
SetIndexDrawBegin(0,39);
//----
return(0);
}
//+------------------------------------------------------------------+
//| PCCI |
//+------------------------------------------------------------------+
int start()
{
int i,counted_bars=IndicatorCounted();
double value1;
//----
if(Bars<=38) return(0);
//---- initial zero
if(counted_bars<39)
for(i=1;i<=0;i++) PCCIBuffer=0.0;
//----
i=Bars-39-1;
if(counted_bars>=39) i=Bars-counted_bars-1;
while(i>=0)
{
value1 =
0.36423990*Close
+0.33441085*Close
+0.25372851*Close
+0.14548806*Close
+0.03934469*Close
-0.03871426*Close
-0.07451349*Close
-0.06903411*Close
-0.03611022*Close
+0.00422528*Close
+0.03382809*Close
+0.04267885*Close
+0.03120441*Close
+0.00816037*Close
-0.01442877*Close
-0.02678947*Close
-0.02525534*Close
-0.01272910*Close
+0.00350063*Close
+0.01565175*Close
+0.01895659*Close
+0.01328613*Close
+0.00252297*Close
-0.00775517*Close
-0.01301467*Close
-0.01164808*Close
-0.00527241*Close
+0.00248750*Close
+0.00793380*Close
+0.00897632*Close
+0.00583939*Close
+0.00059669*Close
-0.00405186*Close
-0.00610944*Close
-0.00509042*Close
-0.00198138*Close
+0.00144873*Close
+0.00373774*Close
+0.01047723*Close
-0.00022625*Close;
PCCIBuffer=(High+Low)/2-value1;
i--;
}
return(0);
}
//+------------------------------------------------------------------+
的的顶顶顶顶顶的顶顶顶顶顶的顶顶顶顶顶 过来看看的 路过,支持一下啦 小手一抖,积分到手! 学习了,不错 学习了,不错 学习了,不错 学习了,不错 顶下
页:
[1]
2