vtwangk 发表于 2016-9-27 16:11:58

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);
}
//+------------------------------------------------------------------+

lnyksq 发表于 2016-9-28 07:44:46

的的顶顶顶顶顶的顶顶顶顶顶的顶顶顶顶顶

情人的情人 发表于 2020-1-5 15:41:33

过来看看的

286331 发表于 2020-3-8 14:46:23

路过,支持一下啦

小三 发表于 2020-6-12 14:28:54

小手一抖,积分到手!

leftme 发表于 2020-7-21 20:28:48

学习了,不错

狗官烨宝 发表于 2020-7-30 15:25:59

学习了,不错

千山 发表于 2020-8-16 15:23:19

学习了,不错

阅乐芙月 发表于 2020-8-21 12:09:36

学习了,不错

yang644 发表于 2021-7-7 14:22:05

顶下
页: [1] 2
查看完整版本: PPCI指标