请老师找出问题修改 [文华财经]
-
咨询内容:
下面公式 将显示=1天 改为显示=2天
我自己调整后两个VALUEWHEN的数字相加还是一天的K线根数和,没有同步成两天的K线根数和,
请老师帮我看看,并将要调整的部分用红色显示。
谢谢老师
显示:=1; NN:=DAYBARPOS,NODRAW;//日X:=BACKSET(ISLASTBAR,SUMBARS(NN=1,显示));SS1:= IF(PERIOD<7,SUM(AVPRICE*V,BARSLASTCOUNT(X))/SUM(V,BARSLASTCOUNT(X)),NULL),COLORWHITE;
IF(REFX(NN=1,1),NULL,SS1),COLORWHITE;DRAWSL(REFX(NN=1,1),SS1,SS1-REF(SS1,1),-1,0,COLORWHITE);DRAWNUMBER((REFX(DAYBARPOS=1,1)||ISLASTBAR)&&PERIOD<7,SS1,SUM(C>SS1,BARSLASTCOUNT(X)),0,COLORYELLOW),ALIGN1;DRAWNUMBER((REFX(DAYBARPOS=1,1)||ISLASTBAR)&&PERIOD<7,SS1,SUM(C<SS1,BARSLASTCOUNT(X)),0,COLORYELLOW),ALIGN1,VALIGN0; VALUEWHEN(REFX(NN=1,1)||ISLASTBAR,SUM(C>SS1,NN)),NODRAW,COLORYELLOW; VALUEWHEN(REFX(NN=1,1)||ISLASTBAR,SUM(C<SS1,NN)),NODRAW,COLORYELLOW;
显示2:=2; NN2:=DAYBARPOS,NODRAW;//日X2:=BACKSET(ISLASTBAR,SUMBARS(NN2=1,显示2));SS2:= IF(PERIOD<7,SUM(AVPRICE*V,BARSLASTCOUNT(X2))/SUM(V,BARSLASTCOUNT(X2)),NULL),COLORWHITE;
IF(REFX(NN2=1,2),NULL,SS2),COLORWHITE;DRAWSL(REFX(NN2=1,2),SS2,SS2-REF(SS2,1),-1,0,COLORWHITE);DRAWNUMBER((REFX(DAYBARPOS=2,1)||ISLASTBAR)&&PERIOD<7,SS2,SUM(C>SS2,BARSLASTCOUNT(X2)),0,COLORYELLOW),ALIGN1;DRAWNUMBER((REFX(DAYBARPOS=2,1)||ISLASTBAR)&&PERIOD<7,SS2,SUM(C<SS2,BARSLASTCOUNT(X2)),0,COLORYELLOW),ALIGN1,VALIGN0; VALUEWHEN(REFX(NN2=1,2)||ISLASTBAR,SUM(C>SS2,NN2)),NODRAW,COLORRED; VALUEWHEN(REFX(NN2=1,2)||ISLASTBAR,SUM(C<SS2,NN2)),NODRAW,COLORRED;
来源:程序化99
-
文华技术人员:
您写的不对,如果是两天,不能是DAYBARPOS=2这样的,这个写法是当天的第二根K线。
参考:
显示2:=2; NN2:=DAYBARPOS,NODRAW;//日X2:=BACKSET(ISLASTBAR,SUMBARS(NN2=1,显示2));SS2:= IF(PERIOD<7,SUM(AVPRICE*V,BARSLASTCOUNT(X2))/SUM(V,BARSLASTCOUNT(X2)),NULL),COLORWHITE;
IF(REFX(CROSS(X2,0.5),1),NULL,SS2),COLORWHITE;DRAWSL(REFX(CROSS(X2,0.5)=1,1),SS2,SS2-REF(SS2,1),-1,0,COLORWHITE);DRAWNUMBER((REFX(CROSS(X2,0.5)=1,1)||ISLASTBAR)&&PERIOD<7,SS2,SUM(C>SS2,BARSLASTCOUNT(X2)),0,COLORYELLOW),ALIGN1;DRAWNUMBER((REFX(CROSS(X2,0.5)=1,1)||ISLASTBAR)&&PERIOD<7,SS2,SUM(C<SS2,BARSLASTCOUNT(X2)),0,COLORYELLOW),ALIGN1,VALIGN0; VALUEWHEN(REFX(CROSS(X2,0.5)=1,1)||ISLASTBAR,SUM(C>SS2,BARSLASTCOUNT(X2))),NODRAW,COLORRED; VALUEWHEN(REFX(CROSS(X2,0.5)=1,1)||ISLASTBAR,SUM(C<SS2,BARSLASTCOUNT(X2))),NODRAW,COLORRED;来源: WWW.CXH99.COM
-
文华客服:
感谢!
同样的效果请老师帮忙把 一年 和两年 的公式也写下。 -
网友回复:
参考:
显示2:=1;//两年改成2 NN2:BARSLAST(YEAR<>REF(YEAR,1)),NODRAW;//年 X2:BACKSET(ISLASTBAR,SUMBARS(NN2=1,显示2)); SS2:= IF(PERIOD<7,SUM(AVPRICE*V,BARSLASTCOUNT(X2))/SUM(V,BARSLASTCOUNT(X2)),NULL),COLORWHITE;
IF(REFX(CROSS(X2,0.5),1),NULL,SS2),COLORWHITE; DRAWSL(REFX(CROSS(X2,0.5)=1,1),SS2,SS2-REF(SS2,1),-1,0,COLORWHITE); DRAWNUMBER((REFX(CROSS(X2,0.5)=1,1)||ISLASTBAR)&&PERIOD<7,SS2,SUM(C>SS2,BARSLASTCOUNT(X2)),0,COLORYELLOW),ALIGN1; DRAWNUMBER((REFX(CROSS(X2,0.5)=1,1)||ISLASTBAR)&&PERIOD<7,SS2,SUM(C<SS2,BARSLASTCOUNT(X2)),0,COLORYELLOW),ALIGN1,VALIGN0; VALUEWHEN(REFX(CROSS(X2,0.5)=1,1)||ISLASTBAR,SUM(C>SS2,BARSLASTCOUNT(X2))),NODRAW,COLORRED; VALUEWHEN(REFX(CROSS(X2,0.5)=1,1)||ISLASTBAR,SUM(C<SS2,BARSLASTCOUNT(X2))),NODRAW,COLORRED;
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容