根据同学需要,迁移、改编了王平家、梦想置上两位老师提供通达信的指标,请谅解!
使用说明:按照图中颜色变化确定买卖。
源代码:
空方价=ema(high,4);
多方价=ema(low,5);
b1=ifelse(isCrossUp(close,空方价),1,ifelse(isCrossUp(多方价,close),-1,0));
b2=refBefore(b1,barsFromPrevTrue(b1));
b3=ifelse(b2==1,多方价,ifelse(b2==-1,空方价,0));
界点=b3;
draw(界点,color="#ff00ff");
ma1=b3;
c1=(abs(close-ma1))/close;
j=(highest(c1,160)+lowest(c1,160))/1.7;
cc=ifelse(c1<=j-j/2,1,ifelse(c1<=j-j/3&&c1>j-j/2,2,ifelse(c1<=j+j/3&&c1>j-j/3,3,ifelse(c1<=2*j&&c1>j+j/3,4,ifelse(c1>2*j,5,0)))));
drawStickBetweenIf(close>ma1,0,cc*20,color="#ffffff",fill=true,linewidth=4);
drawStickBetweenIf(close>ma1,0,cc*20,color="#0000ff",fill=true,linewidth=2);
drawStickBetweenIf(close>ma1&&cc>3,30,cc*20,color="#ffff00",fill=true,linewidth=2);
drawStickBetweenIf(close<ma1,0,-cc*20,color="#ffffff",fill=true,linewidth=4);
drawStickBetweenIf(close<ma1,0,-cc*20,color="#ff3333",fill=true,linewidth=2);
drawStickBetweenIf(close<ma1&&cc>3,-30,-cc*20,color="#00ffff",fill=true,linewidth=2);
w=ifelse(1,0);
drawText(close>=ma1&&isLast(close),1,"多",color="#00ffff");
drawText(close<ma1&&isLast(close),-1,"空",color="#ffff00");
var6=(2*close+high+low)/4;
var8=lowest(low,34);
varb=highest(high,34);
bb=ema((var6-var8)/(varb-var8)*100,9);
趋势=ema(0.667*refBefore(bb,1)+0.333*bb,2);
draw(趋势,color="#ffff00");
q=(2*close+high+low)/4;
a1=lowest(low,24);
a2=highest(high,24);
a=ema((q-a1)/(a2-a1)*100,13);
b=ema(0.667*refBefore(a,1)+0.333*a,3);
力道=a-b;
draw(力道,color="#ffff00");