通达信公式修改为赢顺公式 [赢顺期货]
- 咨询内容:
谢谢!刚学习使用赢顺,好多函数不清楚是怎么回事,请高手修改下!
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWTEXT(二次金叉,MACD*1.02,'二次金叉'),COLORLIGREEN;
DRAWTEXT(底背,MACD*0.98,'底背'),COLORMAGENTA;JC := DEA-DIF;
绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);
红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);
本次最低价:=LLV(L,BARSLAST(JC<0));
本次最高价:=HHV(H,BARSLAST(JC>0));
X1:=IF (MACD<0,BARSLAST(CROSS(DIF,DEA)),0);
前次绿柱面积:=REF(绿柱面积,X1+1);
前次最低价:=REF(本次最低价,X1+1);
Y1:=IF((绿柱面积<0 AND ABS(绿柱面积)<ABS(前次绿柱面积)
AND 本次最低价<前次最低价 ),1,0);
RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价
AND ABS(绿柱面积)<ABS(前次绿柱面积) AND ABS(MACD)<ABS(REF(MACD,1));
底背驰:= IF (CROSS(DIF,DEA),REF(Y1,1),0);
DRAWTEXT(底背驰,0.3,'积底背'),COLOR00FFFF;
STICKLINE(底背驰,0,0.3,4,0),COLOR0000FF;
DRAWICON(底背驰,0,23),COLORYELLOW;
DRAWBAND(DIF,RGB(200,50,55),DEA,RGB(50,100,10));
遵:IF(DIF>=DEA,DIF,DRAWNULL),COLORRED;
守:IF(DEA>=DIF,DEA,DRAWNULL),COLORFF9900;
纪:IF(DIF>=DEA,DEA,DRAWNULL),COLOR00FFFF;
律:IF(DEA>=DIF,DIF,DRAWNULL),COLOR00FF00;X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIF)),0);
前次红柱面积:=REF(红柱面积,X2+1);
前次最高价:=REF(本次最高价,X2+1);
Y2:=IF((红柱面积>0 AND 红柱面积<前次红柱面积 AND 本次最高价>前次最高价 ),1,0);
RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高价 AND ABS(红柱面积)<ABS(前次红柱面积) AND ABS(MACD)<ABS(REF(MACD,1));
顶背驰:= IF (CROSS(DEA,DIF),REF(Y2,1),0);
DRAWICON(顶背驰,0,19),COLOR00FF00;
STICKLINE(顶背驰,0,-0.3,4,0),COLOR00FF00;
DRAWTEXT(顶背驰,-0.3,'积顶背'),COLORFF0000; - 赢顺技术人员:
模型为您改写如下: 另外请您提供红字部分通达信DRAWBAND函数的用法。
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
DWJC:=CROSS(DIF,DEA) AND DIF<-0.1;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
ECJC:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
DB:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWTEXT(ECJC,MACD*1.02,'ECJC'),COLORGREEN;
DRAWTEXT(DB,MACD*0.98,'DB'),COLORMAGENTA;JC:=DEA-DIF;
LZMJ:=IFELSE(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);
HZMJ:=IFELSE(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);
BCZDJ:=LLV(L,BARSLAST(JC<0));
BCZGJ:=HHV(H,BARSLAST(JC>0));
X1:=IFELSE(MACD<0,BARSLAST(CROSS(DIF,DEA)),0);
QCLZMJ:=REF(LZMJ,X1+1);
QCZDJ:=REF(BCZDJ,X1+1);
Y1:=IFELSE(LZMJ<0 AND ABS(LZMJ)<ABS(QCLZMJ) AND BCZDJ<QCZDJ,1,0);
RS1:= MACD<0 AND REF(MACD,1)<0 AND C<QCZDJ AND ABS(LZMJ)<ABS(QCLZMJ) AND ABS(MACD)<ABS(REF(MACD,1));
DBC:=IFELSE(CROSS(DIF,DEA),REF(Y1,1),0);
DRAWTEXT(DBC,0.3,'积底背');
STICKLINE(DBC,0,0.3,4,0);
DRAWICON(DBC,0,23),COLORYELLOW;
DRAWBAND(DIF,RGB(200,50,55),DEA,RGB(50,100,10));
ZUN:IFELSE(DIF>=DEA,DIF,NODRAW),COLORRED;
SHOU:IFELSE(DEA>=DIF,DEA,NODRAW);
JI:IFELSE(DIF>=DEA,DEA,NODRAW);
LU:IFELSE(DEA>=DIF,DIF,NODRAW);X2:=IFELSE(MACD>0,BARSLAST(CROSS(DEA,DIF)),0);
QCHZMJ:=REF(HZMJ,X2+1);
QCZGJ:=REF(BCZGJ,X2+1);
Y2:=IFELSE(HZMJ>0 AND HZMJ<QCHZMJ AND BCZGJ>QCZGJ,1,0);
RS2:=MACD>0 AND REF(MACD,1)>0 AND C>QCZGJ AND ABS(HZMJ)<ABS(QCHZMJ) AND ABS(MACD)<ABS(REF(MACD,1));
DDBC:=IFELSE(CROSS(DEA,DIF),REF(Y2,1),0);
DRAWICON(DDBC,0,19);
STICKLINE(DDBC,0,-0.3,4,0);
DRAWTEXT(DDBC,-0.3,'积定背'); - 赢顺客服:
期待!谢谢!
- 网友回复:
请参照2楼回复,但由于不同软件部分函数的表达形式不同,请您提供通达信中DRAWBAND函数的用法和效果。我们方便改写
- 网友回复:
画出带状线.
用法:DRAWBAND(VAL1,COLOR1,VAL2,COLOR2),当VAL1>VAL2时,在VAL1和VAL2之间填充COLOR1;当VAL1<VAL2时,填充COLOR2,这里的颜色均使用RGB函数计算得到。
例如:DRAWBAND(OPEN,RGB(0,224,224),CLOSE,RGB(255,96,96));那个是在dea和dif之间填充不同颜色的语句。
如果以上指标公式不适用于您常用的行情软件
或者您想改编成选股公式,以便快速选出某种形态个股的话,
- 上一篇:[求助]文华有统计在单位时间成交开空单、…
- 下一篇:没有了!
相关文章
-
指定的模型还没有相关内容!