zhukejiang 发表于 2017-5-25 16:15:36

发个根据均线的评分系统供大家参考交流

均线系统以MA(10,20,60)为例,根据K线与均线的相对位置关系、均线与均线之间的排列、K线与均线之间的排列。评分系统代码如下:
MA10:MA(CLOSE,10),COLORYELLOW,NOTEXT;
MA20:MA(CLOSE,20),COLORMAGENTA,NOTEXT;
MA60:MA(CLOSE,60),COLORGRAY,NOTEXT;

A10:=MA10-REF(MA10,1);
A20:=MA20-REF(MA20,1);
A60:=MA60-REF(MA60,1);

//K线与均线的相对位置关系
B1:=IF(CLOSE>MA10,1,0)+IF(CLOSE>MA20,1,0)+IF(CLOSE>MA60,1,0)+
IF(CLOSE<MA10,-1,0)+IF(CLOSE<MA20,-1,0)+IF(CLOSE<MA60,-1,0);
//均线与均线排列关系
B2:=IF(MA10>MA20 AND A10>0 AND A20>0,1,0)+IF(MA10<MA20 AND A10<0 AND A20<0,-1,0)+
IF(MA20>MA60 AND A20>0 AND A60>0,1,0)+IF(MA20<MA60 AND A20<0 AND A60<0,-1,0);
//K线与均线排列关系
B3:=(IF(CLOSE>MA10 AND A10>0 AND REF(A10,1)>0,1,0)+IF(CLOSE<MA10 AND A10<0 AND REF(A10,1)<0,-1,0)+
IF(CLOSE>MA20 AND A20>0 AND REF(A20,1)>0,1,0)+IF(CLOSE<MA20 AND A20<0 AND REF(A20,1)<0,-1,0)+
IF(CLOSE>MA60 AND A60>0 AND REF(A60,1)>0,1,0)+IF(CLOSE<MA60 AND A60<0 AND REF(A60,1)<0,-1,0)
);
PF:=B1+B2+B3;//评分

PD:=4;//评分标准

M10:IF(PF>-PD AND PF<PD,MA10,NULL),COLORYELLOW;
MD10:IF(PF>=PD,MA10,NULL),COLORRED;
MK10:IF(PF<=-PD,MA10,NULL),COLORGREEN;

DRAWICON((REF(PF,1)>=PD AND PF<PD),HIGH, 'ICO7');//多头转震荡
DRAWICON((REF(PF,1)>-PD AND PF<=-PD),HIGH, 'ICO5');//震荡转空头

DRAWICON((REF(PF,1)<=-PD AND PF>-PD),LOW, 'ICO6');//空头转震荡
DRAWICON((REF(PF,1)<PD AND PF>=PD),LOW, 'ICO4');//震荡转多头


说明:根据这个评分系统,分数最大为8,最小为-8,以4和-4作为趋势和震荡的零界点。参数可以自行修改。

39n119e 发表于 2017-5-28 20:46:09

好,终于看到技术贴了。
页: [1]
查看完整版本: 发个根据均线的评分系统供大家参考交流