等级: 新手上路
- 注册:
- 2021-6-16
- 曾用名:
|
楼主 |
发表于 2021-6-16 13:32
|
显示全部楼层
//input:xxx('10');
INPUT:D1X_KD(1,0,1000,1),DA1_KD(0,0,8,1);
INPUT:M1X_KD(120,0,1000,1)MA1_KD(8,0,8,1);
INPUT:M2X_KD(120,0,1000,1),MA2_KD(8,0,8,1);
INPUT:D1X_PD(1,0,1000,1),DA1_PD(8,0,8,1);
INPUT:M1X_PD(15,0,1000,1),MA1_PD(8,0,8,1);
INPUT:MYZQ(1,1,1000,1);
D1BARS:=600;
NUM1:=1000,LINETHICK0;
H11:=STKINDIEX('','MACDHL.H1',0,21,1,NUM1);//MIN引用H1
H12:=STKINDIEX('','MACDHL.H1',0,21,2,NUM1);//MIN引用
H13:=STKINDIEX('','MACDHL.H1',0,21,3,NUM1);//MIN引用
H14:=STKINDIEX('','MACDHL.H1',0,21,4,NUM1);//MIN引用
H15:=STKINDIEX('','MACDHL.H1',0,21,5,NUM1);//MIN引用
H16:=STKINDIEX('','MACDHL.H1',0,21,6,NUM1);//MIN引用
H17:=STKINDIEX('','MACDHL.H1',0,21,7,NUM1);//MIN引用
H18:=STKINDIEX('','MACDHL.H1',0,21,8,NUM1);//MIN引用
H19:=STKINDIEX('','MACDHL.H1',0,21,9,NUM1);//MIN引用
H110:=STKINDIEX('','MACDHL.H1',0,21,10,NUM1);//MIN引用
H112:=STKINDIEX('','MACDHL.H1',0,21,12,NUM1);//MIN引用
H115:=STKINDIEX('','MACDHL.H1',0,21,15,NUM1);//MIN引用
H120:=STKINDIEX('','MACDHL.H1',0,21,20,NUM1);//MIN引用
H125:=STKINDIEX('','MACDHL.H1',0,21,25,NUM1);//MIN引用
H130:=STKINDIEX('','MACDHL.H1',0,21,30,NUM1);//MIN引用
H140:=STKINDIEX('','MACDHL.H1',0,21,40,NUM1);//MIN引用
H150:=STKINDIEX('','MACDHL.H1',0,21,50,NUM1);//MIN引用
H160:=STKINDIEX('','MACDHL.H1',0,21,60,NUM1);//MIN引用}
H1120:=STKINDIEX('','MACDHL.H1',0,21,120,NUM1);//MIN引用
COND111:=CROSS(HIGH,H11);//1MIN上穿
COND112:=CROSS(HIGH,H12);//2MIN上穿
COND113:=CROSS(HIGH,H13);//3MIN上穿
COND114:=CROSS(HIGH,H14);//4MIN上穿
COND115:=CROSS(HIGH,H15);//5MIN上穿
COND116:=CROSS(HIGH,H16);//6MIN上穿
COND117:=CROSS(HIGH,H17);//7MIN上穿
COND118:=CROSS(HIGH,H18);//8MIN上穿
COND119:=CROSS(HIGH,H19);//9MIN上穿
COND1110:=CROSS(HIGH,H110);//10MIN上穿
COND1112:=CROSS(HIGH,H112);//12MIN上穿
COND1115:=CROSS(HIGH,H115);//15MIN上穿
COND1120:=CROSS(HIGH,H120);//20MIN上穿
COND1125:=CROSS(HIGH,H125);//25MIN上穿
COND1130:=CROSS(HIGH,H130);//30MIN上穿
COND1140:=CROSS(HIGH,H140);//40MIN上穿
COND1150:=CROSS(HIGH,H150);//50MIN上穿
COND1160:=CROSS(HIGH,H160);//60MIN上穿
COND11120:=CROSS(HIGH,H1120);//120MIN上穿
L11:=STKINDIEX('','MACDHL.L1',0,21,1,NUM1);//MIN引用L1
L12:=STKINDIEX('','MACDHL.L1',0,21,2,NUM1);//MIN引用
L13:=STKINDIEX('','MACDHL.L1',0,21,3,NUM1);//MIN引用
L14:=STKINDIEX('','MACDHL.L1',0,21,4,NUM1);//MIN引用
L15:=STKINDIEX('','MACDHL.L1',0,21,5,NUM1);//MIN引用
L16:=STKINDIEX('','MACDHL.L1',0,21,6,NUM1);//MIN引用
L17:=STKINDIEX('','MACDHL.L1',0,21,7,NUM1);//MIN引用
L18:=STKINDIEX('','MACDHL.L1',0,21,8,NUM1);//MIN引用
L19:=STKINDIEX('','MACDHL.L1',0,21,9,NUM1);//MIN引用
L110:=STKINDIEX('','MACDHL.L1',0,21,10,NUM1);//MIN引用
L112:=STKINDIEX('','MACDHL.L1',0,21,12,NUM1);//MIN引用
L115:=STKINDIEX('','MACDHL.L1',0,21,15,NUM1);//MIN引用
L120:=STKINDIEX('','MACDHL.L1',0,21,20,NUM1);//MIN引用
L125:=STKINDIEX('','MACDHL.L1',0,21,25,NUM1);//MIN引用
L130:=STKINDIEX('','MACDHL.L1',0,21,30,NUM1);//MIN引用
L140:=STKINDIEX('','MACDHL.L1',0,21,40,NUM1);//MIN引用
L150:=STKINDIEX('','MACDHL.L1',0,21,50,NUM1);//MIN引用
L160:=STKINDIEX('','MACDHL.L1',0,21,60,NUM1);//MIN引用
L1120:=STKINDIEX('','MACDHL.L1',0,21,120,NUM1);//MIN引用
COND221:=CROSS(L11,LOW);//1MIN下穿
COND222:=CROSS(L12,LOW);//2MIN下穿
COND223:=CROSS(L13,LOW);//3MIN下穿
COND224:=CROSS(L14,LOW);//4MIN下穿
COND225:=CROSS(L15,LOW);//5MIN下穿
COND226:=CROSS(L16,LOW);//6MIN下穿
COND227:=CROSS(L17,LOW);//7MIN下穿
COND228:=CROSS(L18,LOW);//8MIN下穿
COND229:=CROSS(L19,LOW);//9MIN下穿
COND2210:=CROSS(L110,LOW);//10MIN下穿
COND2212:=CROSS(L112,LOW);//12MIN下穿
COND2215:=CROSS(L115,LOW);//15MIN下穿
COND2220:=CROSS(L120,LOW);//20MIN下穿
COND2225:=CROSS(L125,LOW);//25MIN下穿
COND2230:=CROSS(L130,LOW);//30MIN下穿
COND2240:=CROSS(L140,LOW);//40MIN下穿
COND2250:=CROSS(L150,LOW);//50MIN下穿
COND2260:=CROSS(L160,LOW);//60MIN下穿
COND22120:=CROSS(L1120,LOW);//120MIN下穿}
{VARIABLE:N1[19]=0;
IF COND111 THEN N1[1]:=1;
IF COND112 THEN N1[2]:=2;
IF COND113 THEN N1[3]:=3;
IF COND114 THEN N1[4]:=4;
IF COND115 THEN N1[5]:=5;
IF COND116 THEN N1[6]:=6;
IF COND117 THEN N1[7]:=7;
IF COND118 THEN N1[8]:=8;
IF COND119 THEN N1[9]:=9;
IF COND1110 THEN N1[10]:=10;
IF COND1112 THEN N1[11]:=12;
IF COND1115 THEN N1[12]:=15;
IF COND1120 THEN N1[13]:=20;
IF COND1125 THEN N1[14]:=25;
IF COND1130 THEN N1[15]:=30;
IF COND1140 THEN N1[16]:=40;
IF COND1150 THEN N1[17]:=50;
IF COND1160 THEN N1[18]:=60;
IF COND11120 THEN N1[19]:=120;}
VARIABLE:A1[19]=0;
IF COND111 THEN A1[1]:=1;
IF COND112 THEN A1[2]:=2;
IF COND113 THEN A1[3]:=3;
IF COND114 THEN A1[4]:=4;
IF COND115 THEN A1[5]:=5;
IF COND116 THEN A1[6]:=6;
IF COND117 THEN A1[7]:=7;
IF COND118 THEN A1[8]:=8;
IF COND119 THEN A1[9]:=9;
IF COND1110 THEN A1[10]:=10;
IF COND1112 THEN A1[11]:=12;
IF COND1115 THEN A1[12]:=15;
IF COND1120 THEN A1[13]:=20;
IF COND1125 THEN A1[14]:=25;
IF COND1130 THEN A1[15]:=30;
IF COND1140 THEN A1[16]:=40;
IF COND1150 THEN A1[17]:=50;
IF COND1160 THEN A1[18]:=60;
IF COND11120 THEN A1[19]:=120;
nn1:LARGE(A1,19,1),NODRAW;
nn2:SMALL(A1,19,2),NODRAW;
CDC:UBOUND(A1),nodraw;
HH:hhV(A1,CDC),NODRAW;//定义一个序列变量,相当于是一个数组
LL:llV(A1,CDC),NODRAW;//定义一个序列变量,相当于是一个数组
for i=1 to 19 DO
msgout(islastbar,NUMTOSTR(A1,0))
{
IF ISLASTBAR THEN BEGIN
MSGOUT(COND111,'1M11');
MSGOUT(COND112,'2M11');
MSGOUT(COND113,'3M11');
MSGOUT(COND114,'4M11');
MSGOUT(COND115,'5M11');
MSGOUT(COND116,'6M11');
MSGOUT(COND117,'7M11');
MSGOUT(COND118,'8M11');
MSGOUT(COND119,'9M11');
MSGOUT(COND1110,'10M11');
MSGOUT(COND1112,'12M11');
MSGOUT(COND1115,'15M11');
MSGOUT(COND1120,'20M11');
MSGOUT(COND1125,'25M11');
MSGOUT(COND1130,'30M11');
MSGOUT(COND1140,'40M11');
MSGOUT(COND1150,'50M11');
MSGOUT(COND1160,'60M11');
//MSGOUT(COND11120,'120M11');
MSGOUT(1,'END'&'/'&NUMTOSTR(BARPOS,0)&'/'&STKNAMe);
END
//
补充内容 (2021-6-16 13:33):
多周期信号,有可能在临近周期上出现的信号是同时的,所以需要找出最大的周期或者最小的周期 |
|