大智慧今买今卖副图指标
源码
{今买今卖及预测股价公式}
{参数}
input:N(27,1,250);
{显示买卖价}
BUYPRICE:="SHOWINV@BUYPRICE"(1);
SALEPRICE:="SHOWINV@SALEPRICE"(1);
iF BUYPRICE> 0 THEN BP:=BUYPRICE;
{显示昨低买今卖操作数据}
ppp:=0.05;{输入卖出纯利}
成本:=BP*1.006;
卖出价:成本*(1+ppp),linethick0;
买价比:(high-卖出价)/high*100,linethick0;
{四价运用}
开盘价:open,linethick0;
开盘价1:=REF(open,1);{昨天最低价}
最高价:high,linethick0;
最高价1:=REF(high,1);
最低价:low,linethick0;
最低价1:=REF(low,1);
最低价2:=REF(low,2);
收盘价:CLOSE,linethick0;
收盘价1:=REF(CLOSE,1);
{预测系数B2计算公式1}
A1:=REF(开盘价,1);
A2:=ABS((REF(收盘价,1)-A1)/A1);
A3:=ABS((REF(最高价,1)-A1)/A1);
A4:=ABS((REF(最低价,1)-A1)/A1);
B1:=ABS((A2+A3+A4)/3);
B2:开盘价*B1,linethick0;
高低比:(1-最低价/最高价)*100,linethick0;
涨跌比:B2/开盘价*100,linethick0;
{预测公式一 有用到今天开盘价}
AA:=最高价1;
BB:=最低价1;
CC:=开盘价1;
DD:=收盘价1;
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;{心理价}
FFF:=(EEE+开盘价)/2;
{显示今买最低预测价}
预测低一:=开盘价-B2;{今天预测低价一}
预测低一1:=REF(预测低一,1);{昨天预测价}
预测低一2:=REF(预测低一,2);{前天预测价}
预测低二:=(预测低一+FFF)/2;{今天预测低价二}
预测低二1:=REF(预测低二,1);{昨天预测价}
预测低二2:=REF(预测低二,2);{前天预测价}
差额一:=预测低一-low;
差额二:=预测低二-low;
差比一:=(差额一/low)*100;
差比二:=(差额二/low)*100;
{显示今日最高预测价公式}
预测高一:=开盘价+B2;{今天预测高价一}
{第二今日最高预测价公式}
预测高二:=MA(REF(HIGH,1)/REF(CLOSE,2),N)*REF(CLOSE,1);{今天预测高价二}
预测高二1:=ref(预测高二,1);{昨天预测价}
预测高二2:=ref(预测高二,2);{前天预测价}
{设定弱势预测最高价,YPP可自行调整}
YPP一:=0.985;{预测高一弱势价}
YPP二:=0.989;{预测高二弱势价}
熊价一:=预测高一*YPP一;
熊价一1:=REF(熊价一,1);
熊价二:=预测高二*YPP二;
熊价二1:=REF(熊价二,1);
平均价一:=(预测高一+预测高二)/2;
平均价二:=(熊价一+熊价二)/2;
{今日低买数据}
jpp:=0.015;
今卖一:=预测低一*(1+jpp+0.006);
今卖二:=预测低二*(1+jpp+0.006);
{测试昨最低及昨预测低卖出成功率}
check1:(high-预测低二1)/预测低二1*100,linethick0;
low1:=ref(low,1);
check2:(high-low1)/low1*100,linethick0;
{测试与今最高差比}
低一比:=(high-预测低一1)/high*100;
低二比:=(high-预测低二1)/high*100;
昨低比:=(high-最低价1)/high*100;
高二比:(1-预测低二/最高价)*100,linethick0;
DRAWTEXTREL(10,60,'
DRAWTEXTREL(320,60,'
DRAWTEXTREL(320,60,'
DRAWTEXTREL(660,60,'
DRAWTEXTREL(10,200,'
DRAWTEXTREL(10,350,'
+'%'),colorffffff,linethick1;
DRAWTEXTREL(10,550,'
+'%'),colorffffff,linethick1;
DRAWTEXTREL(10,780,'
DRAWTEXTREL(10,880,'
DRAWTEXTREL(660,780,'
DRAWTEXTREL(660,880,'
{显示昨低买今卖操作数据}
DRAWTEXTREL(320,200,'
DRAWTEXTREL(320,350,'
DRAWTEXTREL(320,550,'
DRAWTEXTREL(320,550,'
DRAWTEXTREL(320,700,'
DRAWTEXTREL(320,850,'
{显示依据预测价计算卖出价}
DRAWTEXTREL(660,200,'
DRAWTEXTREL(660,350,'
DRAWTEXTREL(660,500,'
DRAWTEXTREL(660,650,'
{显示卖出与否}
BBP1:=买价比>0 or 买价比=0;
BBP2:=买价比<0;
IF BARSTATUS=2 AND BBP1 THEN BEGIN
DRAWTEXTREL(320,350,'
END
ELSE
IF BARSTATUS=2 AND BBP2 THEN BEGIN
DRAWTEXTREL(320,350,'
END
{显示今日低买操作}
ssssu1:=预测低一>low or 预测低一=low;
ssssu2:=预测低一<low;
IF BARSTATUS=2 AND ssssu1 THEN BEGIN
DRAWTEXTREL(10,450,'
END
ELSE
IF BARSTATUS=2 AND ssssu2 THEN BEGIN
DRAWTEXTREL(10,450,'
END
ssssu3:=预测低二>low or 预测低二=low;
ssssu4:=预测低二<low;
IF BARSTATUS=2 AND ssssu3 THEN BEGIN
DRAWTEXTREL(10,650,'
END
ELSE
IF BARSTATUS=2 AND ssssu4 THEN BEGIN
DRAWTEXTREL(10,650,'
END
{昨日低买操作结果}
lssssu1:=预测低一1>最低价1 or 预测低一1=最低价1;
lssssu2:=预测低一1<最低价1;
IF BARSTATUS=2 AND lssssu1 THEN BEGIN
DRAWTEXTREL(10,450,'
END
ELSE
IF BARSTATUS=2 AND lssssu2 THEN BEGIN
DRAWTEXTREL(10,450,'
END
lssssu3:=预测低二1>最低价1 or 预测低二=最低价1;
lssssu4:=预测低二1<最低价1;
IF BARSTATUS=2 AND lssssu3 THEN BEGIN
DRAWTEXTREL(10,650,'
END
ELSE
IF BARSTATUS=2 AND lssssu4 THEN BEGIN
DRAWTEXTREL(10,650,'
END
{今买今卖操作结果}
jm1:=今卖一>最高价 or 今卖一=最高价;
jm2:=今卖一<最高价;
IF BARSTATUS=2 AND jm1 THEN BEGIN
DRAWTEXTREL(320,850,'
END
ELSE
IF BARSTATUS=2 AND jm2 THEN BEGIN
DRAWTEXTREL(320,850,'
END
jm3:=今卖二>最高价 or 今卖二=最高价;
jm4:=今卖二<最高价;
IF BARSTATUS=2 AND jm3 THEN BEGIN
DRAWTEXTREL(320,850,'
END
ELSE
IF BARSTATUS=2 AND jm4 THEN BEGIN
DRAWTEXTREL(320,850,'
END
{昨今日四价涨跌比}
su1:=最低价>最低价1;
su2:=最低价=最低价1;
su3:=最低价<最低价1;
IF BARSTATUS=2 AND su1 THEN BEGIN
DRAWTEXTREL(660,780,'
END
ELSE
IF BARSTATUS=2 AND su2 THEN BEGIN
DRAWTEXTREL(660,780,'
END
ELSE
IF BARSTATUS=2 AND su3 THEN BEGIN
DRAWTEXTREL(660,780,'
END
su4:=最高价>最高价1;
su5:=最高价=最高价1;
su6:=最高价<最高价1;
IF BARSTATUS=2 AND su4 THEN BEGIN
DRAWTEXTREL(660,780,'
END
ELSE
IF BARSTATUS=2 AND su5 THEN BEGIN
DRAWTEXTREL(660,780,'
END
ELSE
IF BARSTATUS=2 AND su6 THEN BEGIN
DRAWTEXTREL(660,780,'
END
su7:=开盘价>开盘价1;
su8:=开盘价=开盘价1;
su9:=开盘价<开盘价1;
IF BARSTATUS=2 AND su7 THEN BEGIN
DRAWTEXTREL(660,880,'
END
ELSE
IF BARSTATUS=2 AND su8 THEN BEGIN
DRAWTEXTREL(660,880,'
END
ELSE
IF BARSTATUS=2 AND su9 THEN BEGIN
DRAWTEXTREL(660,880,'
END
suu1:=收盘价>收盘价1;
suu2:=收盘价=收盘价1;
suu3:=收盘价<收盘价1;
IF BARSTATUS=2 AND suu1 THEN BEGIN
DRAWTEXTREL(660,880,'
END
ELSE
IF BARSTATUS=2 AND suu2 THEN BEGIN
DRAWTEXTREL(660,880,'
END
ELSE
IF BARSTATUS=2 AND suu3 THEN BEGIN
DRAWTEXTREL(660,880,'
END
{显示预测高价}
ssuu1:=预测高一<high or 预测高一=high;
ssuu2:=预测高一>high;
IF BARSTATUS=2 AND ssuu1 THEN BEGIN
DRAWTEXTREL(660,350,'
END
ELSE
IF BARSTATUS=2 AND ssuu2 THEN BEGIN
DRAWTEXTREL(660,350,'
END
ssuu3:=预测高二<high or 预测高二=high;
ssuu4:=预测高二>high;
IF BARSTATUS=2 AND ssuu3 THEN BEGIN
DRAWTEXTREL(660,500,'
END
ELSE
IF BARSTATUS=2 AND ssuu4 THEN BEGIN
DRAWTEXTREL(660,500,'
END
ssuu5:=平均价一<high or 平均价一=high;
ssuu6:=平均价一>high;
IF BARSTATUS=2 AND ssuu5 THEN BEGIN
DRAWTEXTREL(660,650,'
END
ELSE
IF BARSTATUS=2 AND ssuu6 THEN BEGIN
DRAWTEXTREL(660,650,'
END
ssu1:=熊价一<high or 熊价一=high;
ssu2:=熊价一>high;
IF BARSTATUS=2 AND ssu1 THEN BEGIN
DRAWTEXTREL(660,350,'
END
ELSE
IF BARSTATUS=2 AND ssu2 THEN BEGIN
DRAWTEXTREL(660,350,'
END
ssu3:=熊价二<high or 熊价二=high;
ssu4:=熊价二>high;
IF BARSTATUS=2 AND ssu3 THEN BEGIN
DRAWTEXTREL(660,500,'
END
ELSE
IF BARSTATUS=2 AND ssu4 THEN BEGIN
DRAWTEXTREL(660,500,'
END
ssu5:=平均价二<high or 平均价二=high;
ssu6:=平均价二>high;
IF BARSTATUS=2 AND ssu5 THEN BEGIN
DRAWTEXTREL(660,650,'
END
ELSE
IF BARSTATUS=2 AND ssu6 THEN BEGIN
DRAWTEXTREL(660,650,'
END;