[
]}
v_rise_sum:=SUM(v_rise,sumup_time),colorred,LINETHICK2;//指定周期内的增减总量
v_fall_sum:=SUM(v_fall,sumup_time),colorgreen,LINETHICK2;
v_rise_sum_ema:EMA(v_rise_sum,6),colorred,LINETHICK1;//增减总量的平滑滤波
v_fall_sum_ema:EMA(v_fall_sum,6),colorgreen,LINETHICK1;
v_total_ema_mid:(v_rise_sum_ema+v_fall_sum_ema)/2,colorblue,LINETHICK1;//增减量中值,也就是平衡点
v_delta:=EMA(v_rise_sum_ema-v_fall_sum_ema,2),colorblue;//总差量;大于0代表涨动力强于跌动力
v_delta_emv:=(EMA(v_rise_sum_ema-v_fall_sum_ema,9)),colorgray,LINETHICK2;//总差量均值
v_delta_delay:=(REF(v_delta,CHANGE_PERIOD));//总差量滞后值
v_delta_emv_delay:=(REF(v_delta_emv,CHANGE_PERIOD));
v_delta_speed_ema:MA(-ABS(v_delta_emv-v_delta_emv_delay),120)*delta_inc_k,colorwhite;
// ---------- 价格分析
//p_rise:=IF(CLOSE>=REF(CLOSE,1),CLOSE-REF(CLOSE,1),0);//价格增量
//p_fall:=IF(CLOSE< REF(CLOSE,1),-CLOSE+REF(CLOSE,1),0);//价格减量
//p_abs:=IF(CLOSE< REF(CLOSE,1),-CLOSE+REF(CLOSE,1),CLOSE-REF(CLOSE,1));//价格绝对增量
// ---------- 图形显示
//涨跌量差值
STICKLINE(v_delta_emv>=0,0,v_delta_emv,3,0),colorred;
STICKLINE(v_delta_emv<0,0,-v_delta_emv,3,0),colorgreen;
//总成交量在涨跌中的表现
IF (CODETYPE==0)//指数
{
v_total_inc:=EMA((v_total_ema_mid-REF(v_total_ema_mid,1)),10)*v_total_inc_k;//总成交量增量
//STICKLINE((v_delta_emv-v_delta_emv_delay)>0 AND v_total_inc>0,v_rise_sum_ema,v_rise_sum_ema+v_total_inc,1,1),colorlired;//总差量值在上升,情况正在好转;且成交量上升
//STICKLINE((v_delta_emv-v_delta_emv_delay)>0 AND v_total_inc<0,v_rise_sum_ema,v_rise_sum_ema-v_total_inc,1,1),colorlired;
//STICKLINE((v_delta_emv-v_delta_emv_delay)<0 AND v_total_inc>0,v_fall_sum_ema,v_fall_sum_ema-v_total_inc,1,1),colorligreen;//总差量值下降,空军力量增强;且成交量上升
//STICKLINE((v_delta_emv-v_delta_emv_delay)<0 AND v_total_inc<0,v_fall_sum_ema,v_fall_sum_ema+v_total_inc,1,1),colorligreen;
STICKLINE(v_delta_emv>0 AND v_total_inc>0,v_rise_sum_ema,v_rise_sum_ema+v_total_inc,1,1),colorlired;// 差量大于0,多方市场;且总成交量上升;表明情况好转
STICKLINE(v_delta_emv>0 AND v_total_inc<0,v_fall_sum_ema,v_fall_sum_ema+v_total_inc,1,1),colorligreen;
STICKLINE(v_delta_emv<0 AND v_total_inc>0,v_fall_sum_ema,v_fall_sum_ema+v_total_inc,1,1),colorligreen;// 差量小于0,空方市场;且总成交量上升;表明情况恶化
STICKLINE(v_delta_emv<0 AND v_total_inc<0,v_rise_sum_ema,v_rise_sum_ema+v_total_inc,1,1),colorlired;
}
ELSE IF (CODETYPE==1)
{
v_total_inc:=EMA((v_total_ema_mid-REF(v_total_ema_mid,1)),10)*v_total_inc_k/2;
STICKLINE(v_delta_emv>0 AND v_total_inc>0,v_rise_sum_ema,v_rise_sum_ema+v_total_inc,1,1),colorlired;
STICKLINE(v_delta_emv>0 AND v_total_inc<0,v_fall_sum_ema,v_fall_sum_ema+v_total_inc,1,1),colorligreen;
STICKLINE(v_delta_emv<0 AND v_total_inc>0,v_fall_sum_ema,v_fall_sum_ema+v_total_inc,1,1),colorligreen;
STICKLINE(v_delta_emv<0 AND v_total_inc<0,v_rise_sum_ema,v_rise_sum_ema+v_total_inc,1,1),colorlired;
}
ELSE;
//涨跌速度
STICKLINE(v_delta_emv>=0 AND v_delta_emv>=v_delta_emv_delay AND HIGH>LOW,0,-delta_inc_k*(v_delta_emv-v_delta_emv_delay),5,0),coloryellow;
STICKLINE(v_delta_emv>=0 AND v_delta_emvLOW, 0, delta_inc_k*(v_delta_emv-v_delta_emv_delay),5,0),colorblue;
STICKLINE(v_delta_emv<0 AND v_delta_emv>=v_delta_emv_delay AND HIGH>LOW,0,-delta_inc_k*(v_delta_emv-v_delta_emv_delay),5,0),coloryellow;
STICKLINE(v_delta_emv<0 AND v_delta_emvLOW, 0, delta_inc_k*(v_delta_emv-v_delta_emv_delay),5,0),colorblue;
//时间点
STICKLINE(HOUR==10 AND MINUTE==30,0,v_total_ema_mid/2,1,0),colorgray;//每日记号线
STICKLINE(HOUR==11 AND MINUTE==30,0,v_total_ema_mid/2,1,0),colorgray;//每日记号线
STICKLINE(HOUR==14 AND MINUTE==0 ,0,v_total_ema_mid/2,1,0),colorgray;//每日记号线
STICKLINE(HOUR==15 AND MINUTE==0 ,0,v_total_ema_mid/2,1,0),colorgray;//每日记号线
STICKLINE(HOUR==14 AND MINUTE>=30,0,v_total_ema_mid/2,1,1),colorgray;//每日记号线
//变盘提示
/*
v_rise_sum_ema_delay:=REF(v_rise_sum_ema,CHANGE_PERIOD);//分析变盘的间隔
v_fall_sum_ema_delay:=REF(v_fall_sum_ema,CHANGE_PERIOD);
v_rise_sum_ema_delay_delta:=(v_rise_sum_ema-v_rise_sum_ema_delay)/ABS(v_rise_sum_ema_delay);
v_fall_sum_ema_delay_delta:=(v_fall_sum_ema-v_fall_sum_ema_delay)/ABS(v_rise_sum_ema_delay);
//涨放量,跌缩量
IF (v_rise_sum_ema_delay_delta/ABS(v_fall_sum_ema_delay_delta)>ALARM_PERCENT)//涨量放大速度明显快于跌量放大速度
rise_alarm:=1;
ELSE IF (v_fall_sum_ema_delay_delta/ABS(v_rise_sum_ema_delay_delta)<-ALARM_PERCENT)//跌量缩小速度明显快于涨量缩小速度
rise_alarm:=2;
ELSE IF (v_rise_sum_ema_delay_delta>ALARM_VALUE AND v_fall_sum_ema_delay_delta<-ALARM_VALUE)//跌缩量而涨放量
rise_alarm:=3;
ELSE
rise_alarm:=0;
STICKLINE(rise_alarm==1,v_rise_sum_ema,v_fall_sum_ema,1,1),coloryellow;
STICKLINE(rise_alarm==2,v_rise_sum_ema,v_fall_sum_ema,1,1),colormagenta;
STICKLINE(rise_alarm==3,v_rise_sum_ema,v_fall_sum_ema,1,1),colorred;
*/