等级: 免费版
- 注册:
- 2021-7-10
- 曾用名:
|
N1:=3; //N1需要和STKINDIEX 函数里面参数对应。调整N1就是调整周期,但是需要和STKINDIEX里面参数一致。
N2:=3;
IF N1 = 3 THEN zq0:='15分钟';
IF N2 = 3 THEN zq:='15分钟';
IF N2 = 5 THEN zq:='60分钟';
EMAIL:='405868954@qq.com';
T:=STKINDIEX('','cs.T',0,N1,0,500);
cs1:=STKINDIEX('','cs.cs1',0,N2,0,500);
cs2:=STKINDIEX('','cs.cs2',0,N2,0,500);
cs3:=STKINDIEX('','cs.cs3',0,N2,0,500);
cs4:=STKINDIEX('','cs.cs4',0,N2,0,500);
MA3:=STKINDIEX('','cs.MA3',0,N2,0,500);
cs5:=STKINDIEX('','cs.cs5',0,N1,0,500);
cs6:=STKINDIEX('','cs.cs6',0,N1,0,500);
cs7:=STKINDIEX('','cs.cs7',0,N1,0,500);
cs8:=STKINDIEX('','cs.cs8',0,N1,0,500);
SKK:STKINDIEX('','cs.SKK',0,N1,0,500),NODRAW;
S:STKINDIEX('','cs.S',0,N1,0,500),NODRAW;
A1:STKINDIEX('','cs.A1',0,N1,0,500),NODRAW;
A2:STKINDIEX('','cs.A2',0,N1,0,500),NODRAW;
A:(SKK+S)/2;
STICKLINE(CROSS(cs1,0.5) and t=time,0,100,0,0),COLORRED;
STICKLINE(CROSS(cs2,0.5) and t=time,0,100,0,0),COLORGREEN;
IF CROSS(cs1,0.5) THEN
QS:='上升趋势';
IF CROSS(cs2,0.5) THEN
QS:='下降趋势';
txt21:=STRCAT(STRCAT(STKLABEL,STRCAT(',',zq)),STRCAT(',','卖空止盈(红)'));
txt22:=STRCAT(STRCAT('K:',NUMTOSTR(REF(SKK,1),2)),',');
SENDMAIL(CROSS(REF(cs1,1),0.5) ,EMAIL,txt21,txt22);
txt31:=STRCAT(STRCAT(STKLABEL,STRCAT(',',zq)),STRCAT(',','买多止盈(绿)'));
txt32:=STRCAT(STRCAT('K:',NUMTOSTR(REF(SKK,1),2)),',');
SENDMAIL(CROSS(REF(cs2,1),0.5) ,EMAIL,txt31,txt32); //趋势结束
DRAWICON(CROSS(cs3,0.5) and t=time,SKK*1.2,8);
DRAWICON(CROSS(cs4,0.5) and t=time,SKK*1.2,9);
txt41:=STRCAT(STRCAT(STKLABEL,STRCAT(',',zq)),STRCAT(',','激进卖空止盈(红)'));
txt42:=STRCAT(STRCAT(STRCAT('收盘价:',NUMTOSTR(REF(C,1),2)),','),STRCAT(STRCAT(STRCAT('均线:',NUMTOSTR(REF(MA3,1),2)),','),STRCAT(STRCAT(STRCAT('K:',NUMTOSTR(REF(SKK,1),2)),','),STRCAT('S:',NUMTOSTR(REF(S,1),2)))));
SENDMAIL(CROSS(REF(cs3,1),0.5) ,EMAIL,txt41,txt42);
txt51:=STRCAT(STRCAT(STKLABEL,STRCAT(',',zq)),STRCAT(',','激进买多止盈(绿)'));
txt52:=STRCAT(STRCAT(STRCAT('收盘价:',NUMTOSTR(REF(C,1),2)),','),STRCAT(STRCAT(STRCAT('均线:',NUMTOSTR(REF(MA3,1),2)),','),STRCAT(STRCAT(STRCAT('K:',NUMTOSTR(REF(SKK,1),2)),','),STRCAT('S:',NUMTOSTR(REF(S,1),2)))));
SENDMAIL(CROSS(REF(cs4,1),0.5) ,EMAIL,txt51,txt52);//激进结束
DRAWICON(cs5 AND cs6 AND t=time,SKK,4);
DRAWICON((cs5 AND cs6 AND (SKK>50 || S>50)) and t=time,SKK*1.1,4);
txt1:=STRCAT(STRCAT(STKLABEL,STRCAT(',',zq0)),STRCAT(',','卖出信号'));
txt2:=STRCAT(STRCAT(STRCAT(zq,qs),','),STRCAT(STRCAT(STRCAT('最高价:',NUMTOSTR(REF(H,1),2)),','),STRCAT(STRCAT(STRCAT('K:',NUMTOSTR(REF(SKK,1),2)),','),STRCAT('S:',NUMTOSTR(REF(S,1),2)))));
SENDMAIL(REF(cs7,1) AND REF(cs8,1) ,EMAIL,txt1,txt2);
DRAWICON(cs7 AND cs8 AND t=time,SKK,5);
DRAWICON((cs7 AND cs7 AND (SKK<50 || S<50)) and t=time,SKK*1.1,5);
txt11:=STRCAT(STRCAT(STKLABEL,STRCAT(',',zq0)),STRCAT(',','买入信号'));
txt12:=STRCAT(STRCAT(STRCAT(zq,qs),','),STRCAT(STRCAT(STRCAT('最低价:',NUMTOSTR(REF(L,1),2)),','),STRCAT(STRCAT(STRCAT('K:',NUMTOSTR(REF(SKK,1),2)),','),STRCAT('S:',NUMTOSTR(REF(S,1),2)))));
SENDMAIL(REF(cs5,1) AND REF(cs6,1) ,EMAIL,txt11,txt12);
服务器不给开通25端口,所以能不能把上面的代码改一下SENDMAIL直接用python发送,谢谢
|
|