{参数: 红绿灯:10,10,25}
INPUT:红绿灯(10,10,25);
a1:=前M个波谷位置(2,0.1,1);
a2:=前M个波峰位置(1,0.1,1);
光标位置:=系统参数(1);
cldis:=a1[系统参数(1)];
chdis:=a2[系统参数(1)];
tcl:=光标位置-cldis;
tch:=光标位置-chdis;
K1:=IF(tcl>tch,tcl,tch);
PH:=H;
PL:=L;
P1:=IF(tcl>tch,PL[tcl+0],PH[tch+0]);
N:=if(sysparam(1)=datacount,20,datacount-sysparam(1)+1);
K0:=IF(tcl>tch,TROUGHBARS(2,0.1,1),PEAKBARS(1,0.1,1));
K2:=BArslAST(K0=0);
K4:=DATACOUNT-N{+1};
KK:=REF(BARPOS,k2),linethick0;
P2:=if(KK>=K4,1,-1);
PB1:=crOSS(P2,0);
KTONOW1:=BARSLAST(PB1);
HH:=REF(HIGH,KTONOW1);
LLOW:=ref(LOW,KTONOW1);
H1:=STRTONUM(NUMTOSTR(HH,3));
L1:=STRTONUM(NUMTOSTR(LLOW,3));
VERTLINE(数据位置=K1),COLORYELLOW,LINEDOT;
{DRAWTEXT(数据位置=K1,SYSPARAM(4)*0.95,'转\n \n折\n \n点'),COLORYELLOW;}
LL:=IF(H1<1.038*L1,IF(tcl>=tch,0.038*L1,0.038*H1),IF(H1>L1*1.112 AND tcl>=tch,H1-L1,0.112*H1));
IF tcl>=tch THEN BEGIN
画分段线(数据位置>K1,L1+LL*1.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,L1+LL*1.5,'(1) '+数字转化为字符串(L1+LL*1.5,3)),COLORYELLOW;
画分段线(数据位置>K1,L1+LL*2.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,L1+LL*2.5,'(2) '+数字转化为字符串(L1+LL*2.5,3)),COLORYELLOW;
画分段线(数据位置>K1,L1+LL*3.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,L1+LL*3.5,'(3) '+数字转化为字符串(L1+LL*3.5,3)),COLORYELLOW;
画分段线(数据位置>K1,L1+LL*4.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,L1+LL*4.5,'(4) '+数字转化为字符串(L1+LL*4.5,3)),COLORYELLOW;
画分段线(数据位置>K1,L1+LL*5.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,L1+LL*5.5,'(5) '+数字转化为字符串(L1+LL*5.5,3)),COLORYELLOW;
画分段线(数据位置>K1,L1+LL*6.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,L1+LL*6.5,'(6) '+数字转化为字符串(L1+LL*6.5,3)),COLORYELLOW;
END;
IF tcl<tch THEN BEGIN
画分段线(数据位置>K1,H1-LL*1.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,H1-LL*1.5,'(1) '+数字转化为字符串(H1-LL*1.5,3)),COLORYELLOW;
画分段线(数据位置>K1,H1-LL*2.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,H1-LL*2.5,'(2) '+数字转化为字符串(H1-LL*2.5,3)),COLORYELLOW;
画分段线(数据位置>K1,H1-LL*3.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,H1-LL*3.5,'(3) '+数字转化为字符串(H1-LL*3.5,3)),COLORYELLOW;
画分段线(数据位置>K1,H1-LL*4.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,H1-LL*4.5,'(4) '+数字转化为字符串(H1-LL*4.5,3)),COLORYELLOW;
画分段线(数据位置>K1,H1-LL*5.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,H1-LL*5.5,'(5) '+数字转化为字符串(H1-LL*5.5,3)),COLORYELLOW;
画分段线(数据位置>K1,H1-LL*6.5),COLOR00CCFF,LINEDOT;
显示文字(数据位置=K1,H1-LL*6.5,'(6) '+数字转化为字符串(H1-LL*6.5,3)),COLORYELLOW;
END;
当前月:=FRACPART(ROUND(当前日期/100)/100)*100;
月:=MONTH;日:=DAY;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='1',c,NUMTOSTR(当前月,0)+'月时间之窗:5(小寒)、6、15、20(大寒)、21、*25\n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='2',c,NUMTOSTR(当前月,0)+'月时间之窗:4(立春)、6、15、18(雨水)21\n \n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='3',c,NUMTOSTR(当前月,0)+'月时间之窗:5(惊蛰)、6、15、*20(春分)、21\n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='4',c,NUMTOSTR(当前月,0)+'月时间之窗:4(清明)、6、15、20(谷雨)21\n \n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='5',c,NUMTOSTR(当前月,0)+'月时间之窗:5(立夏)、6、*12、15、21(小满)\n \n \n \n \n'),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='6',c,NUMTOSTR(当前月,0)+'月时间之窗:5(芒种)、6、*14、21(夏至)\n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='7',c,NUMTOSTR(当前月,0)+'月时间之窗:7(小暑)、8、15、*19、23(大暑)\n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='8',c,NUMTOSTR(当前月,0)+'月时间之窗:*6、7(立秋)、8、18、23(处暑)\n \n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='9',c,NUMTOSTR(当前月,0)+'月时间之窗:7(白露)、8、15、*18、23(秋分)\n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='10',c,NUMTOSTR(当前月,0)+'月时间之窗:8(寒露)、15、23(霜降)、*31\n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='11',c,NUMTOSTR(当前月,0)+'月时间之窗:7(立冬)、8、15、22(小雪)23、*28\n \n \n \n \n \n '),COLOR00FFFF,ALIGN5;
{-股票公式网站 }
DRAWTEXT(SYSPARAM(2)=BARPOS and NUMTOSTR(当前月,0)='12',c,NUMTOSTR(当前月,0)+'月时间之窗:7(大雪)、8、15、22(冬至)23、*31\n \n \n \n \n \n '),COLOR00FFFF,ALIGN5;
DRAWTEXTEX(c,1,1,10,'板块:'+BLKNAME),COLORYELLOW;
DRAWTEXTEX(c,1,1,60,'总股本:'+NUMTOSTR(FINANCE(1)/10000 ,2 )+'亿'+' 流通A股:'+ NUMTOSTR(FINANCE(7)/10000,2)+'亿'),COLORYELLOW;
DRAWTEXTEX(c,1,1,110,
'每股收益:'+ NUMTOSTR(FINANCE(33),2)+' 市盈率:'+NUMTOSTR(DYNAINFO(39),2)+' 净资产:'+NUMTOSTR(FINANCE(34),2)+' 净资产收益率:'+NUMTOSTR(FINANCE(37),2)),COLORYELLOW;
DRAWTEXTEX(c,1,1,160,'上涨家数:'+NUMTOSTR(INDEXADV,0)+' 下跌家数:'+NUMTOSTR(INDEXDEC,0)),COLORYELLOW;
{DRAWTEXTEX(c,1,1,160,'主营业务增长率:'+NUMTOSTR(FINANCE(53),2 )+'%'+' 税后利润增长率:'+NUMTOSTR(FINANCE(54),2 )+'%'+' 净资产增长率:'+NUMTOSTR(FINANCE(55),2 )+'%'),COLOR808080;}
DRAWTEXTEX(c,1,1,210,'五日换手:'+NUMTOSTR(SUM(((vol/CAPITAL)*100),5),2)+' 五日涨跌:'+NUMTOSTR((c-ref(c,5))/ref(c,5)*100,2)+'%'),COLORYELLOW;
DRAWTEXTEX(c,1,1,260,'获利比率:'+NUMTOSTR(WINNER(c)*100,2)+'%'+' 20天相对强度:'+NUMTOSTR(c/ref(c,20)/(indexc/ref(indexc,20)),2)),COLORYELLOW;
DRAWTEXTEX(c,1,1,350,'阻力2:'+NUMTOSTR(((ref(h,1)+ref(l,1)+ref(o,1)+ref(c,1))/4+(ref(h,1)-ref(l,1))),2)
+' ('+NUMTOSTR(ref(c,1)+(ref(h,1)-ref(l,1)),2)+')'),COLORYELLOW;
DRAWTEXTEX(c,1,1,400,'阻力1:'+NUMTOSTR(((ref(h,1)+ref(l,1)+ref(o,1)+ref(c,1))/4*2-ref(l,1)),2)+' (昨最高价:'+NUMTOSTR(ref(h,1),2)+')'),COLORYELLOW;
DRAWTEXTEX(c,1,1,450,'支撑1:'+NUMTOSTR(((ref(h,1)+ref(l,1)+ref(o,1)+ref(c,1))/4*2-ref(h,1)),2)+' (昨最低价:'+NUMTOSTR(ref(l,1),2)+')'),COLORYELLOW;
DRAWTEXTEX(c,1,1,500,'支撑2:'+NUMTOSTR(((ref(h,1)+ref(l,1)+ref(o,1)+ref(c,1))/4-(ref(h,1)-ref(l,1))),2)
+' ('+NUMTOSTR(ref(c,1)-(ref(h,1)-ref(l,1)),2)+')'),COLORYELLOW;
dk:=EMA(C,红绿灯);
STICKLINE(DK<=C AND CLOSE>=OPEN,HIGH,LOW,0.1,1),COLORRED;
STICKLINE(DK<=C AND CLOSE>=OPEN,CLOSE,OPEN,8,1),COLORRED;
STICKLINE(DK<=C AND CLOSE<OPEN,HIGH,LOW,0.1,0),COLORRED;
STICKLINE(DK<=C AND CLOSE<OPEN,CLOSE,OPEN,8,0),COLORRED;
STICKLINE(DK>C AND CLOSE>=OPEN,HIGH,LOW,0.1,1),COLORGREEN;
STICKLINE(DK>C AND CLOSE>=OPEN,CLOSE,OPEN,8,1),COLORGREEN;
STICKLINE(DK>C AND CLOSE<OPEN,HIGH,LOW,0.1,0),COLORGREEN;
STICKLINE(DK>C AND CLOSE<OPEN,CLOSE,OPEN,8,0),COLORGREEN;
m5:ma(c,5);m10:ma(c,10);m20:ma(c,20);m30:ma(c,30);m60:ma(c,60),COLORRED;
{SAR(4,2,20),CIRCLEDOT;}