N:=27; PP:=0.03;
{预测当天最低价公式}
A1:=REF(O,1);
A2:=ABS((REF(C,1)-A1)/A1);
A3:=ABS((REF(H,1)-A1)/A1);
A4:=ABS((REF(L,1)-A1)/A1);
B1:=ABS((A2+A3+A4)/3);
B2:=O*B1;
预测低一:=O-B2;
预测高一:=O+B2;
{预测当天股价公式}
开盘价1:=OPEN;
开盘价2:=REF(OPEN,1);
最高价1:=HIGH;
最高价2:=REF(HIGH,1);
最低价1:=LOW;
最低价2:=REF(LOW,1);
收盘价1:=CLOSE;
收盘价2:=REF(CLOSE,1);
AA:=最高价2;
BB:=最低价2;
CC:=开盘价2;
DD:=收盘价2;
EE:=(AA+BB+CC+2*DD)/5;
AAA:=EE+(AA-BB);
BBB:=2*EE-BB;
CCC:=2*EE-AA;
DDD:=EE-(AA-BB);
上升突破价:=AAA;
上升阻力价:=BBB;
下跌支撑价:=CCC;
下跌反转价:=DDD;
EEE:=(EE+上升突破价+上升阻力价+下跌支撑价+下跌反转价)/5;
心理价:=EEE;
FFF:=(EEE+开盘价1)/2;
GGG:=(预测低一+FFF)/2;
预测低二:=GGG;
{预测今日最高价公式}
预测高二:=MA(REF(HIGH,1)/REF(CLOSE,2),N)*REF(CLOSE,1);
DRAWTEXT_FIX(1,0.04,0.35,0,'预测低一:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.10,0.35,0,CONST(预测低一)),COLORYELLOW;
DRAWTEXT_FIX(1,0.04,0.70,0,'预测高一:'),COLORGREEN;
DRAWNUMBER_FIX(1,0.10,0.70,0,CONST(预测高一)),COLORGREEN;
DRAWTEXT_FIX(1,0.18,0.35,0,'预测低二:'),COLORYELLOW;
DRAWNUMBER_FIX(1,0.24,0.35,0,CONST(预测低二)),COLORYELLOW;
DRAWTEXT_FIX(1,0.18,0.70,0,'预测高二:'),COLORGREEN;
DRAWNUMBER_FIX(1,0.24,0.70,0,CONST(预测高二)),COLORGREEN;
买回价:=预测低二*1.015;
卖出价:=买回价*(1+PP);
DRAWTEXT_FIX(1,0.04,0.01,0,'卖出价:'),COLORMAGENTA,LINETHICK1;
DRAWNUMBER_FIX(1,0.10,0.0`,0,CONST(卖出价)),COLORMAGENTA;
DRAWTEXT_FIX(1,0.18,0.01,0,'买回价:'),COLORMAGENTA,LINETHICK1;
DRAWNUMBER_FIX(1,0.24,0.01,0,CONST(买回价)),COLORMAGENTA;
(ISLASTBAR=1,RGB(90,90,90),RGB(90,90,90),0,'',0);
总额:=AMOUNT;
买:=IF(O=C AND (C-REF(C,1))/REF(C,1)*100>9.8,AMOUNT,AMOUNT/((H-L)*2-ABS(O-C))*(C-L));
买%:=买/AMOUNT*100;
流入:=AMOUNT*买%/10000000000;
流出:=AMOUNT/100000000-流入;
净流:=流入-流出;
总额3:=SUM(AMOUNT,3);
流入3:=SUM(流入,3);
流出3:=SUM(流出,3);
净流3:=SUM(流入-流出,3);
总额5:=SUM(AMOUNT,5);
流入5:=SUM(流入,5);
流出5:=SUM(流出,5);
净流5:=SUM(流入-流出,5);
总额10:=SUM(AMOUNT,10);
流入10:=SUM(流入,10);
流出10:=SUM(流出,10);
净流10:=SUM(流入-流出,10);
画:=CONST(FINDHIGH(总额10,0,190,1));
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,30,0),ABS(画),DRAWNULL),RGB(0,30,50),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,27,26),CONST(总额),DRAWNULL),RGB(150,10,0),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,26,25),CONST(流入*100000000),DRAWNULL),RGB(250,0,250),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,25,24),CONST(流出*100000000),DRAWNULL),RGB(0,255,255),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,20,19),CONST(总额3),DRAWNULL),RGB(150,10,0),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,19,18),CONST(流入3*100000000),DRAWNULL),RGB(250,0,250),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,18,17),CONST(流出3*100000000),DRAWNULL),RGB(0,255,255),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,13,12),CONST(总额5),DRAWNULL),RGB(150,10,0),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,12,11),CONST(流入5*100000000),DRAWNULL),RGB(250,0,250),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,11,10),CONST(流出5*100000000),DRAWNULL),RGB(0,255,255),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,6,5),CONST(总额10),DRAWNULL),RGB(150,10,0),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,5,4),CONST(流入10*100000000),DRAWNULL),RGB(250,0,250),0,DRAWNULL);
DRAWBAND(IF(BETWEEN(CURRBARSCOUNT,4,3),CONST(流出10*100000000),DRAWNULL),RGB(0,255,255),0,DRAWNULL);
DRAWTEXT(CURRBARSCOUNT=30,画*1,'总额亿'),COLORRED;
DRAWTEXT(CURRBARSCOUNT=30,画*0.73,'流入亿'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=30,画*0.50,'流出亿'),COLORCYAN;
DRAWTEXT(CURRBARSCOUNT=30,画*0.25,'净流亿'),COLOR0099FF;
DRAWTEXT(CURRBARSCOUNT=26,画*1,'1日'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=19,画*1,'3日'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=12,画*1,'5日'),COLORMAGENTA;
DRAWTEXT(CURRBARSCOUNT=5,画*1,'10日'),COLORMAGENTA;
DRAWNUMBER(CURRBARSCOUNT=23,画*1,CONST(总额/100000000)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=23,画*0.75,CONST(流入)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=23,画*0.50,CONST(流出)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=23,画*0.25,CONST(净流)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=16,画*1,CONST(总额3/100000000)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=16,画*0.75,CONST(流入3)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=16,画*0.50,CONST(流出3)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=16,画*0.25,CONST(净流3)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=9,画*1,CONST(总额5/100000000)), COLORDDFFFF;
DRAWNUMBER(CURRBARSCOUNT=9,画*0.75,CONST(流入5)), COLORDDFFFF;
DRAWNUMBER(CURRBARSCOUNT=9,画*0.50,CONST(流出5)), COLORDDFFFF;
DRAWNUMBER(CURRBARSCOUNT=9,画*0.25,CONST(净流5)), COLORDDFFFF;
DRAWNUMBER(CURRBARSCOUNT=2,画*1,CONST(总额10/100000000)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=2,画*0.75,CONST(流入10)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=2,画*0.50,CONST(流出10)),COLORYELLOW;
DRAWNUMBER(CURRBARSCOUNT=2,画*0.25,CONST(净流10)),COLORYELLOW;
|