龙听期货论坛's Archiver

龙听 发表于 2018-12-24 14:48

大智慧均线速度公式源码[大智慧公式]

[code]
INPUT:AI(1.250.5);P2(1.250.30);}
A1:=5;
P2:=30;
A2:=ref(A1,1);
J1:(A1-A2)/A2*100;
MJ1:MA(J1,3);
A3:=MA(CLOSE,P2);
A4:=ref(A3,1);
J2:(A3-A4)/A4*100;
MJ2:=MA(J2,10);
A5:=MA(C,10);
A6:=ref(A5,1);
J3:=(A5-A6)/A6*100;
MJ3:=MA(J3,5);
{向上拐点:IF(COUNT(CROSS(J1,0),3)>=1 AND MJ1>MJ3 AND MJ3>ref(MJ3,1) AND J3>=0 AND J1>ref(J1,1),5,0) ,COLORRED,LINETHICK2;
向下拐点:IF(CROSS(0,J1)>=1 AND MJ3<ref(MJ3,1) AND MJ2<ref(MJ2,2) AND MJ3<MJ2,-5,0),COLORGREEN,LINETHICK2;}
0,COLORWHITE;
STICKLINE(J1>0 AND J2>0,J1,0,2,0),COLORRED;
STICKLINE(J1<0 AND J2>0,0,J1,2,0),COLORYELLOW;
STICKLINE(J1>0 AND J2<0,J1,0,2,0),COLORMAGENTA;
STICKLINE(J1<0 AND J2<0,0,J1,2,0),COLORGREEN;
DRAWICON(CROSS(J1,MJ1) AND COUNT(MJ1<-1,3)>=1 ,J1*1.5,1);
DRAWICON(CROSS(MJ1,J1) AND COUNT(MJ1>1,3)>=1,J1*1.8,2);
[/code]

龙听 发表于 2018-12-24 14:48

源码解析:


输出INPUT:AI(1.250.5)
P2(1.250.30)
A1赋值:5
P2赋值:30
A2赋值:昨日A1
输出J1:(A1-A2)/A2*100
输出MJ1:J1的3日简单移动平均
A3赋值:收盘价的P2日简单移动平均
A4赋值:昨日A3
输出J2:(A3-A4)/A4*100
MJ2赋值:J2的10日简单移动平均
A5赋值:收盘价的10日简单移动平均
A6赋值:昨日A5
J3赋值:(A5-A6)/A6*100
MJ3赋值:J3的5日简单移动平均
0,画白色
CXH赋值:STRTONUM(STRRIGHT(DATESTR(CURRENTDATE),1))
输出WARNING('HTTP://WWW.CXH99.COM',CURRENTTIME>180000 AND (CXH=2 OR CXH=7))
DRAWTEXTREL(10 ,10 ,'指标公式')
当满足条件J1>0ANDJ2>0时,在J1和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画红色
当满足条件J1<0ANDJ2>0时,在0和J1位置之间画柱状线,宽度为2,0不为0则画空心柱.,画黄色
当满足条件J1>0ANDJ2<0时,在J1和0位置之间画柱状线,宽度为2,0不为0则画空心柱.,画洋红色
当满足条件J1<0ANDJ2<0时,在0和J1位置之间画柱状线,宽度为2,0不为0则画空心柱.,画绿色
当满足条件J1上穿MJ1ANDCOUNT(MJ1<-1,3)>=1时,在J1*1.5位置画1号图标
当满足条件MJ1上穿J1ANDCOUNT(MJ1>1,3)>=1时,在J1*1.8位置画2号图标

页: [1]