同花顺伏击牛熊主图源码分享
MA5:MA(C,5);
MA6:=MA(C,6);
MA10:MA(C,10);
MA20:MA(C,20);A2:=REF(MA20,1);J1:=(MA20-A2)/A2*100;MJ1:=MA(J1,3);
MA30:MA(C,30);
MA60:MA(C,60);
MA120:MA(C,120);
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,9,0),colorFF5B00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,8,0),colorFF6C00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,7,0),colorFF7B00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,6,0),colorFF9C00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,5,0),colorFFBE00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,3.5,0),colorFFCC00;
STICKLINE((OPEN >= CLOSE),CLOSE,OPEN,1.5,0),colorFFFF00;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,9,0),color070084;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,8,0),color0000A3;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,7,0),color0000B7;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,6,0),color0000CD;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,5,0),color0000E9;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,3,0),color0754E9;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,1.5,0),color076fF3;
STICKLINE((CLOSE >= OPEN),CLOSE,OPEN,1,0),color079BF3;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0,0) ,COLORFFBBFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,8,0) ,COLORFF00FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,7,0) ,COLORFF22FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,6,0) ,COLORFF44FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,5,0) ,COLORFF66FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0) ,COLORFF88FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0) ,COLORFF99FF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0) ,COLORFFAAFF;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0) ,COLORFFBBFF;
STICKLINE((CLOSE > OPEN),OPEN,LOW,1,0),color0726CA;
STICKLINE((CLOSE > OPEN),CLOSE,HIGH,1,0),color0726CA;
STICKLINE((OPEN > CLOSE),CLOSE,LOW,1,0),colorDE9100;
STICKLINE((OPEN > CLOSE),OPEN,HIGH,1,0),colorDE9100;
VAR01:=100*EMA(EMA((C-REF(C,1)),6),6)/EMA(EMA(ABS((C-REF(C,1))),6),6);
买:=LLV(VAR01,2)=LLV(VAR01,7) AND COUNT(VAR01<0,2) AND CROSS(VAR01,MA(VAR01,2));
DRAWTEXT(买,L, '▲买入'),colorred;
VAR02:=5;
VAR03:=MA(C,5);
VAR04:=(HIGH+LOW+CLOSE)/3;
VAR05:=VOL/IF(HIGH=LOW,4,HIGH-LOW);
VAR06:=SMA(IF(C>=REF(C,1),VAR05,-VAR05/100),2,1);
伏击:=REF(VAR06*1.01,1)-REF(VAR06,1)<0 AND C<O AND REF(VAR03,1)<VAR03;
今日:=VAR06-REF(VAR06,1)*0.99;
昨日:=REF(VAR06,1)-REF(VAR06,2) ;
风险:=今日<0 AND 昨日>0 AND 今日<=昨日*0.8 AND C>O AND REF(VAR03,1)<VAR03;
VAR07:=FILTER(风险,1);
DRAWTEXT(伏击,L*0.99,'伏击'),coloryellow;
DRAWICON(伏击,L*0.9995,1);
DRAWTEXT(VAR07,H*1.01,'风险'),colorgreen;
DRAWICON(VAR07,H*0.9995,2);
来函数检测结果如下:
该公式没有未来函数
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
输出MA5:C的5日简单移动平均
MA6赋值:C的6日简单移动平均
输出MA10:C的10日简单移动平均
输出MA20:C的20日简单移动平均
A2赋值:1日前的MA20
J1赋值:(MA20-A2)/A2*100
MJ1赋值:J1的3日简单移动平均
输出MA30:C的30日简单移动平均
MA60:C的60日简单移动平均
输出MA120:C的120日简单移动平均
STICKLINE((开盘价 >= 收盘价),收盘价,开盘价,9,0),COLORFF5B00
STICKLINE((开盘价 >= 收盘价),收盘价,开盘价,8,0),COLORFF6C00
STICKLINE((开盘价 >= 收盘价),收盘价,开盘价,7,0),COLORFF7B00
STICKLINE((开盘价 >= 收盘价),收盘价,开盘价,6,0),COLORFF9C00
STICKLINE((开盘价 >= 收盘价),收盘价,开盘价,5,0),COLORFFBE00
STICKLINE((开盘价 >= 收盘价),收盘价,开盘价,3.5,0),COLORFFCC00
STICKLINE((开盘价 >= 收盘价),收盘价,开盘价,1.5,0),COLORFFFF00
STICKLINE((收盘价 >= 开盘价),收盘价,开盘价,9,0),COLOR070084
STICKLINE((收盘价 >= 开盘价),收盘价,开盘价,8,0),COLOR0000A3
STICKLINE((收盘价 >= 开盘价),收盘价,开盘价,7,0),COLOR0000B7
STICKLINE((收盘价 >= 开盘价),收盘价,开盘价,6,0),COLOR0000CD
STICKLINE((收盘价 >= 开盘价),收盘价,开盘价,5,0),COLOR0000E9
STICKLINE((收盘价 >= 开盘价),收盘价,开盘价,3,0),COLOR0754E9
STICKLINE((收盘价 >= 开盘价),收盘价,开盘价,1.5,0),COLOR076FF3
STICKLINE((收盘价 >= 开盘价),收盘价,开盘价,1,0),COLOR079BF3
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
当满足条件收盘价>开盘价时,在收盘价和开盘价之间画柱状线
STICKLINE((收盘价 > 开盘价),开盘价,最低价,1,0),COLOR0726CA
STICKLINE((收盘价 > 开盘价),收盘价,最高价,1,0),COLOR0726CA
STICKLINE((开盘价 > 收盘价),收盘价,最低价,1,0),COLORDE9100
STICKLINE((开盘价 > 收盘价),开盘价,最高价,1,0),COLORDE9100
VAR01赋值:100*EMA(EMA((C-1日前的C),6),6)/EMA(EMA((C-1日前的C的绝对值),6),6)
买赋值:2日内VAR01最低值=7日内VAR01最低值 AND 统计2日满足VAR01<0的天数 AND CROSS(VAR01,VAR01的2日简单移动平均)
当满足条件买时,在L和 '▲买入'位置书写文字
VAR02赋值:5
VAR03赋值:C的5日简单移动平均
VAR04赋值:(最高价+最低价+收盘价)/3
如果最高价=最低价返回4否则返回最高价-最低价
VAR06赋值:SMA(IF(C>=1日前的C,VAR05,-VAR05/100),2,1)
伏击赋值:1日前的VAR06*1.01-1日前的VAR06<0 AND C今日赋值:VAR06-1日前的VAR06*0.99
昨日赋值:1日前的VAR06-2日前的VAR06
风险赋值:今日<0 AND 昨日>0 AND 今日<=昨日*0.8 AND C>O AND 1日前的VAR03VAR07赋值:风险的1过滤
当满足条件伏击时,在L*0.99和'伏击'位置书写文字
当满足条件伏击时,在L*0.9995和1之间画图标
当满足条件VAR07时,在H*1.01和'风险'位置书写文字
当满足条件VAR07时,在H*0.9995和2之间画图标