提示:
1、新版本坐标轴显示的是成交金额,但有些股票同花顺的坐标轴数据是错误的,图形没错。应该是同花顺的软件故障。
2、新计算方法使用的函数不知道没有Level2行情是否支持,有问题请回馈
-----------------------------------------
分时成交揭秘
请设置三个参数:
DD 1-4 默认1
ZUOBIAO 0-2 默认0,
(这个参数设置成2显示价格坐标,显示价格坐标时要到公式编辑里,进入曲线属性-纵坐标-数据零值,设置成昨日收盘价。设置成价格坐标后,可以叠加大盘指数)
MODE 0-1 默认0
LEVEL2 0-1 默认1
曲线属性的纵坐标里的数据零值设置成:等于零
-----------------------------------------
源码:
//Level2行情数据,经过核对逐笔数据,同花顺的这组成交量函数基本准确
LEVEL2BUY := BIGBUYCOUNT1 + BIGBUYCOUNT2 + BIGBUYCOUNT3 + BIGBUYCOUNT4;
LEVEL2SELL := BIGSELLCOUNT1 + BIGSELLCOUNT2 + BIGSELLCOUNT3 + BIGSELLCOUNT4;
//普通行情数据,使用内外盘数据计算成交量,与Level2函数略有区别
REALBUY := (OUTVOL - IF(ISNULL(REF(OUTVOL, 1)), 0, REF(OUTVOL, 1))) * NEW / 10000;//转化成金额
REALSELL := (INVOL - IF(ISNULL(REF(INVOL, 1)), 0, REF(INVOL, 1))) * NEW / 10000;
REALBUY := IF(LEVEL2=0, REALBUY, (LEVEL2BUY - IF(ISNULL(REF(LEVEL2BUY, 1)), 0, REF(LEVEL2BUY, 1))) * NEW / 10000);
REALSELL := IF(LEVEL2=0, REALSELL, (LEVEL2SELL - IF(ISNULL(REF(LEVEL2SELL, 1)), 0, REF(LEVEL2SELL, 1))) * NEW / 10000);
ZF := NEW - REF(NEW, 1);
YD1 := REALBUY > REALSELL * 5 AND ZF <= 0; //买入不上涨
YD2 := REALSELL > REALBUY * 5 AND ZF >= 0; //卖出不下跌
//dd 缩放参数
//以5%换手率为坐标的上下限,也同时是价格的上下10%
//M1 := SHGZG * 0.05 / 100 / dd ;//手
//M1 := IF(ZUOBIAO = 0, M1, M1 * 100 * PRE / 10000); //以昨日收盘价来计算上下限
//默认上下限设置成1000万元
M1 := IF(DD=1, 500, 0);
M1 := IF(DD=2, 1000, M1);
M1 := IF(DD=3, 2000, M1);
M1 := IF(DD=4, 5000, M1);
SHOWBUY := IF(REALBUY > M1, M1, REALBUY);
SHOWSELL := IF(REALSELL > M1, M1, REALSELL);
//将成交数据以0%-10%的坐标显示
//SHOWBUY := SHOWBUY / M1 * 10;
//SHOWSELL := SHOWSELL / M1 * 10;
LASTclose := PRE;
//将价格切换到上下600000的数量级坐标
Price := (NEW - LASTclose) / LASTclose * 10 * M1;
//1
PRICE := IF(ZUOBIAO=0, PRICE, (NEW - PRE) / PRE * 100);
SHOWBUY1 := IF(ZUOBIAO=0, SHOWBUY, SHOWBUY / (M1 / 10));
SHOWSELL1 := IF(ZUOBIAO=0, SHOWSELL, SHOWSELL / (M1 / 10));
//2
PRICE := IF(ZUOBIAO=2, NEW, PRICE);
SHOWBUY1 := IF(ZUOBIAO=2, SHOWBUY / (M1 / (PRE * 0.1)), SHOWBUY);
SHOWSELL1 := IF(ZUOBIAO=2, SHOWSELL / (M1 / (PRE * 0.1)), SHOWSELL);
SHOWBUY := SHOWBUY1;
SHOWSELL := SHOWSELL1;
LPRICE: price;
U10 := IF(ZUOBIAO=0, m1, 10);
U10 := IF(ZUOBIAO=2, PRE * 1.1, U10);
D10 := IF(ZUOBIAO=0, m1 * -1, -10);
D10 := IF(ZUOBIAO=2, PRE * 0.9, D10);
UP10:U10, colorred, POINTDOT;
DOWN10:D10, colorcyan, POINTDOT;
num := IF(MODE=0, 0, PRICE);
STICKLINE(YD1 = 0, NUM, NUM+ SHOWBUY, 5, 0), colorred;
STICKLINE(YD1 <> 0, NUM, NUM+ SHOWBUY, 5,0), colorwhite;
STICKLINE(YD2 = 0, NUM, NUM- SHOWSELL, 5,0), colorgreen;
STICKLINE(YD2 <> 0, NUM, NUM- SHOWSELL, 5,0), colorblue;
//当真实买卖与价格变动相反时,属于异动