区间涨跌幅度买卖【源码 主图 贴图】介绍
区间涨跌幅度买卖【源码 主图 贴图】
选择时间的高点或低点研判区间涨跌幅度,结合相应的技术进行买卖。
{通达信版本}
{RQ1(1990,3000,2010),RQ2(1,12,1),RQ3(1,31,1),RQA 1990 3000 2010 RQB 0 12 1 RQC 0 31 1 GE 0 5 0 GF 0 5 0}
RQG:=(RQ1-1900)*10000+RQ2*100+RQ3;
AH:=REF(H,BARSLAST(DATE<=RQG )),NODRAW;
高价:IF(DATE>=RQG AND GE>=1,AH,DRAWNULL),COLOR0000EE,LINETHICK3;
RQD:=(RQA-1900)*10000+RQB*100+RQC;
DJ:=REF(L,BARSLAST(DATE<=RQD )),NODRAW;
低价:IF(DATE>=RQD AND GF>=1,DJ,DRAWNULL),COLOREEEE00,LINETHICK3;
FU:=C-低价;
低到当前幅度%:FU/低价*100,NODRAW,COLOR00FFFF;
FUGA:=高价-低价;
高到低价幅度%:FUGA/高价*100,NODRAW,COLOR00FFFF;
高价A:=IF(DATE>=RQG AND GE>=1,AH*0.97,DRAWNULL);
高价B:=IF(DATE>=RQG AND GE>=1,AH*0.95,DRAWNULL);
高价C:=IF(DATE>=RQG AND GE>=2,AH*0.92,DRAWNULL);
高价D:=IF(DATE>=RQG AND GE>=2,AH*0.87,DRAWNULL);
高价E:=IF(DATE>=RQG AND GE>=3,AH*0.82,DRAWNULL);
高价F:=IF(DATE>=RQG AND GE>=3,AH*0.75,DRAWNULL);
高价G:IF(DATE>=RQG AND GE>=4,AH*0.67,DRAWNULL),COLOR666600;
高价H:=IF(DATE>=RQG AND GE>=4,AH*0.63,DRAWNULL);
DRAWBAND(高价,RGB(11,99,11),高价A,RGB(0,0,0));
DRAWBAND(高价A,RGB(66,66,66),高价B,RGB(0,0,0));
DRAWBAND(高价B,RGB(77,77,77),高价C,RGB(0,0,0));
DRAWBAND(高价C,RGB(88,88,88),高价D,RGB(0,0,0));
DRAWBAND(高价D,RGB(66,6,6),高价E,RGB(0,0,0));
DRAWBAND(高价E,RGB(88,7,7),高价F,RGB(0,0,0));
DRAWTEXT(DATE<=RQG AND GE>=1,高价A,'3'),COLOR208FFF;
DRAWTEXT(DATE<=RQG AND GE>=1,高价B,'5'),COLOR208FFF;
DRAWTEXT(DATE<=RQG AND GE>=2,高价C,'8'),COLOR208FFF;
DRAWTEXT(DATE<=RQG AND GE>=2,高价D,'13'),COLOR208FFF;
DRAWTEXT(DATE<=RQG AND GE>=3,高价E,'18'),COLOR208FFF;
DRAWTEXT(DATE<=RQG AND GE>=3,高价F,'25'),COLOR208FFF;
DRAWTEXT(DATE<=RQG AND GE>=3,高价G,'33'),COLOR208FFF;
DRAWTEXT(DATE<=RQG AND GE>=3,高价H,'37'),COLOR208FFF;
低价A:=IF(DATE>=RQD AND GF>=1,DJ*1.03,DRAWNULL);
低价B:=IF(DATE>=RQD AND GF>=1,DJ*1.05,DRAWNULL);
低价C:=IF(DATE>=RQD AND GF>=2,DJ*1.08,DRAWNULL);
低价D:=IF(DATE>=RQD AND GF>=2,DJ*1.13,DRAWNULL);
低价E:=IF(DATE>=RQD AND GF>=3,DJ*1.18,DRAWNULL);
低价F:=IF(DATE>=RQD AND GF>=3,DJ*1.25,DRAWNULL);
低价G:IF(DATE>=RQD AND GF>=4,DJ*1.33,DRAWNULL),COLOR999999;
低价H:=IF(DATE>=RQD AND GF>=4,DJ*1.37,DRAWNULL);
DRAWBAND(低价,RGB(80,0,0),低价A,RGB(55,11,55));
DRAWBAND(低价A,RGB(80,0,0),低价B,RGB(66,66,66));
DRAWBAND(低价B,RGB(80,0,0),低价C,RGB(77,77,77));
DRAWBAND(低价C,RGB(80,0,0),低价D,RGB(88,88,88));
DRAWBAND(低价D,RGB(80,0,0),低价E,RGB(6,55,66));
DRAWBAND(低价E,RGB(80,0,0),低价F,RGB(8,8,99));
DRAWTEXT(ISLASTBAR AND GF>=1,DJ*1.03,'3'),COLOR208FFF;
DRAWTEXT(ISLASTBAR AND GF>=1,DJ*1.05,'5'),COLOR208FFF;
DRAWTEXT(DATE<=RQD AND GF>=2,低价C,'8'),COLOR208FFF;
DRAWTEXT(DATE<=RQD AND GF>=2,低价D,'13'),COLOR208FFF;
DRAWTEXT(DATE<=RQD AND GF>=3,低价E,'18'),COLOR208FFF;
DRAWTEXT(DATE<=RQD AND GF>=3,低价F,'25'),COLOR208FFF;
DRAWTEXT(DATE<=RQD AND GF>=3,低价G,'33'),COLOR208FFF;
DRAWTEXT(DATE<=RQD AND GF>=3,低价H,'37'),COLOR208FFF;
STICKLINE(C>=O,C,O,3,0),COLOR0000FF;
STICKLINE(C>=O,H,L,0,0),COLOR0000FF;
STICKLINE(C<=O,C,O,3,0),COLORFFFF00;
STICKLINE(C<=O,H,L,0,0),COLORFFFF00;
BDGD:=C=HHV(C,6),LINETHICK0;
BDDD:=C=LLV(C,6),LINETHICK0;
N10:=BARSLAST(BDGD);
N20:=BARSLAST(BDDD);
高S:IF(N10,REF(C,N10),REF(C,N10))*1.005,POINTDOT,COLORFFFF00,LINETHICK3;
低S:IF(N20,REF(C,N20),REF(C,N20))*0.995,COLOR00FFFF,LINETHICK3,POINTDOT;
STICKLINE(C=C,O+((C-O)*0.667),(O+(C-O)*0.667),1.5,0),COLORFF0000,LINETHICK1;
STICKLINE(C=C,O+((C-O)*0.333),(O+(C-O)*0.333),1.5,0),COLORFF0000,LINETHICK1;
STICKLINE(C=C,O+((C-O)/2),(O+(C-O)/2),2,0),COLOR00FFFF,LINETHICK1;
STICKLINE(C=C,L+((H-L)/2),(L+(H-L)/2),2.5,0),COLOR208FFF,LINETHICK1;
STICKLINE(C=C,IF(C>O,H-((H-C)/2),H-((H-O)/2)),IF(C>O,H-((H-C)/2),H-((H-O)/2)),0.5,0),COLORYELLOW,LINETHICK1;
STICKLINE(C=C,IF(C<O,L+((C-L)/2),L+((O-L)/2)),IF(C<O,L+((C-L)/2),L+((O-L)/2)),0.5,0),COLORYELLOW,LINETHICK1;
AS:=(O+H+L+C)/4;
SYA:EMA(AS,5),LINETHICK1,COLORFFFFFF;
SYAA:EMA(AS,10),LINETHICK1,COLOR00FFFF;
SYAB:EMA(AS,20),LINETHICK1,COLOR208FFF;
SYAC:EMA(AS,55),LINETHICK1,COLORFFAAFF;
{添加到参数精灵中}
请设置计算参数:
时间高定位: Param#0 (调整年度)
时间高定位: Param#1 (调整月份)
时间高定位: Param#2 (调整日期)
时间低定位: Param#3 (调整年度)
时间低定位: Param#4 (调整月份)
时间低定位: Param#5 (调整日期)
时间高价位: Param#6 (幅度区间)
时间低价位: Param#7 (幅度区间)
{大智慧版本}
INPUT:KA(2010,1990,3000),KB(1,1,12),KC(1,1,31),K1(2010,1990,3000),K2(1,1,12),K3(1,1,31),DX(0,0,2),EF(0,0,2);
RQG:=(KA-1900)*10000+KB*100+KC;
高价:REF(H,BARSLAST(DATE<=RQG )),LINETHICK0,COLOR009999;
RQD:=(K1-1900)*10000+K2*100+K3;
DJ:REF(L,BARSLAST(DATE<=RQD )),LINETHICK0,COLOR55BB55;
上涨:=BARSSINCE(BACKSET(BARSTATUS=2,BARSLAST(L=DJ)+1));
下跌:=BARSSINCE(BACKSET(BARSTATUS=2,BARSLAST(H=高价)+1));
STICKLINE(C>=O,C,O,8,0),COLOR0000FF,LAYER4;
STICKLINE(C>=O,H,L,0,0),COLOR0000FF,LAYER4;
STICKLINE(C<=O,C,O,8,0),COLORFFFF00,LAYER4;
STICKLINE(C<=O,H,L,0,0),COLORFFFF00,LAYER4;
Q1:=DJ * 1.03;
Q2:=DJ * 1.05;
Q3:=DJ * 1.08;
Q4:=DJ * 1.13;
Q5:=DJ * 1.18;
Q6:=DJ * 1.25;
Q7:=DJ * 1.33;
I1:=0;
flag1:=0;
while I1<BARSLAST(DISPSTATUS=1)-BARSLAST(DISPSTATUS=2)
DO
IF REF(Q1,I1)<REF(Q1,I1+1) AND REF(Q1,I1+1)>Q1
THEN BEGIN FLAG1:=1;
S1:=I1;
I1:=BARSLAST(DISPSTATUS=1);
END
ELSE I1:=I1+1;
STICKLINE(FLAG1 AND DX>=1,REF(Q1,S1),DJ,(s1+1)*20,0),Color551155,ALIGN1,LAYER5;
STICKLINE(FLAG1 AND DX>=1,REF(Q1,S1),Q2,(s1+1)*20,0),Color444444,ALIGN1,LAYER5;
STICKLINE(FLAG1 AND DX>=1,REF(Q2,S1),Q3,(s1+1)*20,0),Color666666,ALIGN1,LAYER5;
STICKLINE(FLAG1 AND DX>=1,REF(Q3,S1),Q4,(s1+1)*20,0),Color777777,ALIGN1,LAYER5;
STICKLINE(FLAG1 AND DX>=1,REF(Q4,S1),Q5,(s1+1)*20,0),Color665506,ALIGN1,LAYER5;
STICKLINE(FLAG1 AND DX>=2,REF(Q5,S1),Q6,(s1+1)*20,0),Color777000,ALIGN1,LAYER5;
DRAWTEXT(上涨=0 AND DX>=1,DJ*1.003,''+''+NUMTOSTRN(DJ,2)),COLORYELLOW,align2;
DRAWTEXT(上涨=0 AND DX>=1,Q1,'3%'+'-'+NUMTOSTRN(Q1,2)),COLORYELLOW,align2;
DRAWTEXT(上涨=0 AND DX>=1,Q2,'5%'+'-'+NUMTOSTRN(Q2,2)),COLORYELLOW,align2;
DRAWTEXT(上涨=0 AND DX>=1,Q3,'8%'+'-'+NUMTOSTRN(Q3,2)),COLORYELLOW,align2;
DRAWTEXT(上涨=0 AND DX>=1,Q4,'13%'+'-'+NUMTOSTRN(Q4,2)),COLORYELLOW,align2;
DRAWTEXT(上涨=0 AND DX>=1,Q5,'18%'+'-'+NUMTOSTRN(Q5,2)),COLORYELLOW,align2;
DRAWTEXT(上涨=0 AND DX>=2,Q6,'25%'+'-'+NUMTOSTRN(Q6,2)),COLORYELLOW,align2;
QG1:=高价 * 0.97;
QG2:=高价 * 0.95;
QG3:=高价 * 0.92;
QG4:=高价 * 0.87;
QG5:=高价 * 0.82;
QG6:=高价 * 0.75;
QG7:=高价 * 0.67;
II1:=0;
flagG1:=0;
while II1<BARSLAST(DISPSTATUS=1)-BARSLAST(DISPSTATUS=2)
DO
IF REF(QG1,II1)>REF(QG1,II1+1) AND REF(QG1,II1+1)<QG1
THEN BEGIN FLAGG1:=1;
SS1:=II1;
II1:=BARSLAST(DISPSTATUS=1);
END
ELSE II1:=II1+1;
STICKLINE(FLAGG1 AND EF>=1,REF(QG1,SS1),高价,(sS1+5)*20,0),Color115511,ALIGN1,LAYER6;
STICKLINE(FLAGG1 AND EF>=1,REF(QG1,SS1),QG2,(sS1+5)*20,0),Color444444,ALIGN1,LAYER6;
STICKLINE(FLAGG1 AND EF>=1,REF(QG2,SS1),QG3,(sS1+5)*20,0),Color666666,ALIGN1,LAYER6;
STICKLINE(FLAGG1 AND EF>=1,REF(QG3,SS1),QG4,(sS1+5)*20,0),Color777777,ALIGN1,LAYER6;
STICKLINE(FLAGG1 AND EF>=1,REF(QG4,SS1),QG5,(sS1+5)*20,0),Color004596,ALIGN1,LAYER6;
STICKLINE(FLAGG1 AND EF>=2,REF(QG5,SS1),QG6,(sS1+5)*20,0),Color000479,ALIGN1,LAYER6;
DRAWTEXT(下跌=0 AND EF>=1,高价,''+''+NUMTOSTRN(高价,2)),COLORYELLOW,align2;
DRAWTEXT(下跌=0 AND EF>=1,QG1,'3%'+'-'+NUMTOSTRN(QG1,2)),COLORYELLOW,align2;
DRAWTEXT(下跌=0 AND EF>=1,QG2,'5%'+'-'+NUMTOSTRN(QG2,2)),COLORYELLOW,align2;
DRAWTEXT(下跌=0 AND EF>=1,QG3,'8%'+'-'+NUMTOSTRN(QG3,2)),COLORYELLOW,align2;
DRAWTEXT(下跌=0 AND EF>=1,QG4,'13%'+'-'+NUMTOSTRN(QG4,2)),COLORYELLOW,align2;
DRAWTEXT(下跌=0 AND EF>=1,QG5,'18%'+'-'+NUMTOSTRN(QG5,2)),COLORYELLOW,align2;
DRAWTEXT(下跌=0 AND EF>=2,QG6,'25%'+'-'+NUMTOSTRN(QG6,2)),COLORYELLOW,align2;
z3:=C=HHV(C,6);
Z9:=C=LLV(C,6);
Z4:=BARSLAST(Z3);
Z5:=BARSLAST(Z9);
Z6:=IF(Z4,REF(C,Z4),REF(C,Z4))*1.005;
Z7:=IF(Z5,REF(C,Z5),REF(C,Z5))*0.995;
STICKLINE(Z6,Z6,Z6,9,0),COLOR008800,LAYER4;
STICKLINE(Z7,Z7,Z7,9,0),COLOR008888,LAYER4;
Nnl:=DISPSTATUS=2;
FUGA:=高价-DJ;
高到低价幅度:=FUGA/高价*100;
FUG:=高价-C;
高到当前幅度:=FUG/高价*100;
DD:=DYNAINFO(7);
FU:=DD-DJ;
到当前幅度:=FU/DJ*100;
DRAWTEXTABS(10,10,'高到低价幅度 【'+NUMTOSTRN(高到低价幅度,2)+'%】'),Color0DEEEE;
DRAWTEXTABS(10,25,'高到当前幅度 【'+NUMTOSTRN(高到当前幅度,2)+'%】'),Color00EE00;
DRAWTEXTABS(10,40,'低到当前幅度 【'+NUMTOSTRN(到当前幅度,2)+'%】'),Color00EE00;
as:=(o+h+l+c)/4;
SYA:EMA(AS,5),LINETHICK1,COLORFFFFFF;
SYAA:EMA(AS,10),LINETHICK1,COLOR00FFFF;
SYAB:EMA(AS,20),LINETHICK1,COLOR208FFF;
SYAC:EMA(AS,55),LINETHICK1,COLORFFAAFF;
{添加到参数精灵中}
时间高定位: Param#1 (调整年度)
时间高定位: Param#2 (调整月份)
时间高定位: Param#3 (调整日期)
时间低定位: Param#4 (调整年度)
时间低定位: Param#5 (调整月份)
时间低定位: Param#6 (调整日期)
时间低价位: Param#7 (幅度区间)
时间高价位: Param#8 (幅度区间)
选择时间的高点或低点研判区间涨跌幅度,结合相应的技术进行买卖。
通达信导入公式:
副图量+KD
HS:=VOL/CAPITAL*100;
TJA:=HS<1;TJB:=HS>1;TJC:=HS>2;TJ1:=HS>3;TJ2:=HS>5;
TJ3:=HS>8;TJ4:=HS>15;TJ5:=HS>25;
换手率:VOL/CAPITAL*100,NODRAW,COLORFFFF00;
实际量:VOL/10000,NODRAW;
量:V/CONST(HHV(V,120))*100,LINETHICK0,VOLSTICK;
地量0_1:TJA,COLORFFFFFF;
低靡1_2:TJB,COLORFFFF00;
温和2_3:TJC,COLOR208FFF;
活跃3_5:TJ1,COLOR00FFFF;
带量5_8:TJ2,COLORFF00FF;
放量8_15:TJ3,COLOR00FF00;
巨量15_25:TJ4,COLORFF2900;
怪异:TJ5,COLORFF6600;
顶:82,COLORFFFF00,LINETHICK1;
顶A:92,COLOR999599,LINETHICK5;
50,COLOR888888,DOTLINE,LINETHICK1;
STICKLINE(TJA,0,量,2.2,0),COLORFFFFFF;
STICKLINE(TJB,0,量,2.2,0),COLORFFFF00;
STICKLINE(TJC,0,量,2.2,0),COLOR208FFF;
STICKLINE(TJ1,0,量,2.2,0),COLOR00FFFF;
STICKLINE(TJ2,0,量,2.2,0),COLORFF00FF;
STICKLINE(TJ3,0,量,2.2,0),COLOR00FF00;
STICKLINE(TJ4,0,量,2.2,0),COLORFF0000;
STICKLINE(TJ5,0,量,2.2,0),COLORFF6600;
低:18,COLOR208FFF,LINETHICK3;
低A:9,COLORFFF000,LINETHICK2;
DRAWTEXT(ISLASTBAR,顶,' 顶'),COLORFFFF00;
DRAWTEXT(ISLASTBAR,低,' 底'),COLOR208FFF;
LOWV:=LLV(LOW,8);
HIGHV:=HHV(HIGH,8);
RSVD:=(EMA((CLOSE-LOWV)/(HIGHV-LOWV)*100,3));
KB:=EMA(RSVD,3);
DD:=MA(KB,3);
DRAWBAND(KB,RGB(80,0,0),DD,RGB(0,88,0));
MA5:MA(量,5),COLORFFFFFF;
MA13:MA(量,13),COLOR00FFFF;
MA24:MA(量,24),COLORFF00FF;
LC := REF(CLOSE,1);
RSI1:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI20:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
LJ2:=(C-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100;
LJF2:(EMA(LJ2,3)),COLORFF22FF,LINETHICK2;
RSV1:=EMA(100*(C-LLV(LOW,18))/(HHV(H,18)-LLV(LOW,18)),3);
主A:=EMA(RSV1,3),COLOR208FFF,LINETHICK1;
DRAWTEXT(ISLASTBAR AND LJF2>REF(LJF2,1),LJF2,'▲'),COLORFF00FF;
DRAWTEXT(ISLASTBAR AND LJF2<REF(LJF2,1),LJF2,'▼'),COLOR00FF00;
106,COLORFFFFFF;
STICKLINE(CCI20>=150,101,98,1.5,0) ,COLOR508FFF;
STICKLINE(RSI1>76,104,102,1.5,0) ,COLORFFFF00;
STICKLINE(LJF2>80,106,104,1.5,0) ,COLOR0000FF;
STICKLINE(主A>87,98,95,1.5,0) ,COLORFF0000;
DIFF:EMA(CLOSE,10) - EMA(CLOSE,22),NODRAW;
QJCB:=COSTEX(C,REF(C,1));{量比指标}
CB1:=IF(C>QJCB,V,0);
CB2:=IF(C<QJCB,V,0);
HCB1:=SUM(CB1,4);
HCB2:=SUM(CB2,4);
HCBB:=HCB2/HCB1;
QDZ:=IF(HHV(HCBB,5)>4 AND CROSS(2,HCBB) AND C>=O,1,0);
DRAWICON(QDZ,88,11);
STICKLINE(CROSS(CCI20,-150),80,84,1.6,0) ,COLOR208FFF;
DRAWTEXT(CROSS(CCI20,-150),顶,'↖CCI低买'),COLOR00FFFF;
STICKLINE(CROSS(LJF2,DD) AND DIFF>REF(DIFF,1),92,95,1.5,0),COLOR1F447C;
STICKLINE(CROSS(LJF2,DD) AND DD<30,92,95,1.5,0),COLOR0000FF;
GB:IF(CROSS(LJF2,低),82,DRAWNULL),CROSSDOT,LINETHICK2,COLOR00FFFF;
MACD
DIFF:EMA(CLOSE,10)-EMA(CLOSE,22);
DEA:EMA(DIFF,7.5);
MACD:(DIFF-DEA)*2,COLORSTICK;
GMB:IF(CROSS(DIFF,DEA) AND DIFF>0,-0.02,DRAWNULL),CROSSDOT,LINETHICK4,COLOR0000FF;
GMC:IF(CROSS(DIFF,DEA) AND DIFF<0,-0.02,DRAWNULL),CROSSDOT,LINETHICK4,COLOR208FFF;
DRAWICON(CROSS(DIFF,DEA) AND DIFF>0,DEA,36);
DRAWICON(CROSS(DEA,DIFF) AND DIFF>0,DEA,37);
DRAWICON(CROSS(DIFF,DEA) AND DIFF<0,DEA,1);
gd15094