指标编写问答34学习的宝藏
171.问:求资金进出指标
答(杨文亮):
tt:=if(c>=ref(c,1),amount,0);
AA:=sum(amount,0);
AB:=sum(tt,10)*1000/aa;
总体入场金额:100*ab;
tt1:=if(c<ref(c,1),amount,0);
AA1:=sum(amount,0);
AB1:=sum(tt1,10)*1000/aa1;
总体下跌金额:100*ab1;
mm:=if(c>=ref(c,1),v/ref(v,1),0);
mm1:=if(c<ref(c,1),v/ref(v,1),0);
时段入场金额:10000*sum(mm,10)/sum(mm,50);
时段下跌金额:10000*sum(mm1,10)/sum(mm1,50);
172.问:
想在k线上显示那根k线距今天换手100/100那根k线距今天换手200/100显示数字
答(阿福):
f:=MOD(SUM(100*VOL/CAPITAL,0),100);
n:=(SUM(100*VOL/CAPITAL,0)-f)/100;
tj:=f<REF(f,1);
VERTLINE(tj);
fd:=REF(BARSLAST(tj),1)+1;
DRAWNUMBER(tj,50,n,0),ALIGN1,COLORffffff;
DRAWTEXT(tj,40,'次'),ALIGN1,COLORGREEN;
DRAWTEXT(tj,30,'换'),ALIGN1,COLORGREEN;
DRAWTEXT(tj,20,'手'),ALIGN1,COLORGREEN;
DRAWNUMBER(tj,10,fd,0),ALIGN1,COLORred;
DRAWTEXT(tj,0,'天'),ALIGN1,COLORGREEN;
还可这样写:
input:n(1040102,700101,1341231);//设置日期调整范围
n1:=BARSLAST(if(date=n,DATACOUNT-barpos,0)<>0);//计算起始开始的数据周期
hsl:=100*VOL/CAPITAL,LINETHICK0;
f:=MOD(SUM(hsl,n1),100),LINETHICK0;//数据统计从输入日期开始
tj:=f<REF(f,1);
VERTLINE(tj),POINTDOT,colorff...;
fd:=REF(BARSLAST(tj),1)+1;
DRAWNUMBER(tj,CLOSE,fd,0),ALIGN5;
周期天数:fd,LINETHICK0;
换手累积:f,LINETHICK0;
周期均价:SUM(AMOUNT,fd)/SUM(VOL,fd)/100;
bf1:=0;
for i:=SYSPARAM(1) to DATACOUNT do begin
IF bf1>=100 then BREAK else bf1:=bf1+hsl;
end;
btj:=BARPOS=i,LINETHICK0;
VERTLINE(btj),LINEDOT,COLORYELLOW;
DRAWTEXT(btj,HIGH,'完成100%换手\n共 '+NUMTOSTR((i-SYSPARAM(1)),0)+' 天'),ALIGN4,COLORRED;
再给一个钻心虫编的:
自动标出换手达100%(缺省参数)的前面K线位置--源码
偶也编了个小东东:当十字光标移到某一位置时,自动标出换手达100%(缺省参数)的前面K线位置。源码可加在主图公式中。
INPUT:%(100,1,999);//设定换手率缺省参数
周期:SUMBARS(v,capital/100*%),LINETHICK0;
KS:=BACKSET(BARSCOUNT(v)=sysparam(1),周期);
VERTLINE(cross(KS,1)),LINEDOT,COLORYELLOW;
DRAWNUMBER((cross(KS,1)),sysparam(5),DATE,0),COLORGREEN;
173.问:
求金叉死叉价预测
答(道):
KDJ金叉死叉价预测,您可加在自己的主图公式中!
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
交叉:=(D*3-K*2)*(HHV(H,8)-LLV(L,8))/100+LLV(L,8);
DRAWNUMBER(dynainfo(7)=c and dynainfo(10)=amount ,h*0.985,交叉,2),SHIFT1,colorgreen;
DRAWTEXT(dynainfo(7)=c and dynainfo(10)=amount and k>d,h,'KDJ死叉价:'),SHIFT1,coloryellow;
DRAWTEXT(dynainfo(7)=c and dynainfo(10)=amount and k
174.问:
编写一个均线走平和上翘的公式原码.
答(多多):
走平:ma(c,n)=ref(ma(c,n),1)
上翘:ma(c,n)>ref(ma(c,n),1)
175.问:
大盘条形背景(例如周K线上升为红色,下跌为蓝)原码怎样表达
答(馨芸):
vertline(c>ma(c,5)),linethick8,color0099cc;
AC:=C;
AH:=H;
AL:=L;
AO:=O;
STICKLINE(AC>=AO,AH,AC,1,0),color225588;
STICKLINE(AC>=AO,AH,AC,0,0),color66ccff;
STICKLINE(AC>=AO,AO,AL,1,0),color225588;
STICKLINE(AC>=AO,AO,AL,0,0),color66ccff;
STICKLINE(AC>AO,AC,AO,8,0),COLOR225588;
STICKLINE(AC>AO,AC,AO,7,0),COLOR226699;
STICKLINE(AC>AO,AC,AO,6,0),COLOR3377aa;
STICKLINE(AC>AO,AC,AO,5,0),COLOR3388bb;
STICKLINE(AC>AO,AC,AO,4,0),COLOR4499cc;
STICKLINE(AC>AO,AC,AO,3,0),COLOR44aadd;
STICKLINE(AC>AO,AC,AO,2,0),COLOR55bbee;
STICKLINE(AC>AO,AC,AO,1,0),COLOR66ccff;
STICKLINE(AC<=AO,AH,AC,1,0),color88...;
STICKLINE(AC<=AO,AH,AC,0,0),colorffff00;
STICKLINE(AC<=AO,AO,AL,1,0),color88...;
STICKLINE(AC<=AO,AO,AL,0,0),colorffff00;
STICKLINE(AC<=AO,AC,AO,8,0),COLOR88...;
STICKLINE(AC<=AO,AC,AO,7,0),COLOR999900;
STICKLINE(AC<=AO,AC,AO,6,0),COLORaaaa00;
STICKLINE(AC<=AO,AC,AO,5,0),COLORbbbb00;
STICKLINE(AC<=AO,AC,AO,4,0),COLORcccc00;
STICKLINE(AC<=AO,AC,AO,3,0),COLORdddd00;
STICKLINE(AC<=AO,AC,AO,2,0),COLOReeee00;
STICKLINE(AC<=AO,AC,AO,1,0),COLORffff00;
页:
[1]