转自通达信用户反馈区:
一、shape_short,shape_mid,shape_long三个形态函数返回为对应的数字,数定对应的形态如下:
1:倒V型反转 2:V型反转 3:W底 4:M顶 5:盘整 6:盘整后上行 7:盘整后下跌 8:上升通道 9:下降通道 10:拐头下跌 11:拐头上升 12:上行盘整 13:下跌盘整 14:其它形态
二、各处形态对应的解释如下:
1、shape_short:短期形态,近60天历史 行情走势进行形态研判
2、shape_mid:中期形态,对近120天历史行情走势进行形态研判
3、shape_long:长期形态,对近240-500天历史行情走势进行形态研判
三、对应使用示例公式源码及图例:
1、公式源码
交易周期:=CURRBARSCOUNT;
交易周期条件:=(交易周期<=55);
{指数均数系统}
CYC1:=EMA(C,5);
CYC2:=EMA(C,13);
CYC3:=EMA(C,34);
CYC4:=EMA(C,55);
E2331:=EMA(C,233);
{画变线均线}
NOTEXT13:IF(交易周期条件,EMA(C,N1),DRAWNULL),COLORLIBLUE,LINETHICK1;
E131:IF(EMA(C,N1)>REF(EMA(C,N1),1) AND 交易周期条件,EMA(C,N1),DRAWNULL),COLORRED,LINETHICK1;
NOTEXT34:IF(交易周期条件,EMA(C,N2),DRAWNULL),COLORLIBLUE,LINETHICK1;
NOTEXT341:IF(EMA(C,N2)>REF(EMA(C,N2),1) AND 交易周期条件,EMA(C,N2),DRAWNULL),COLORRED,LINETHICK1;
NOTEXT55:IF(交易周期条件,EMA(C,N3),DRAWNULL),COLORLIBLUE,LINETHICK1;
NOTEXT551:IF(EMA(C,N3)>REF(EMA(C,N3),1) AND 交易周期条件,EMA(C,N3),DRAWNULL),COLORRED,LINETHICK1;
NOTEXT233:IF(交易周期条件,EMA(C,233),DRAWNULL),COLOR9F5F9F,LINETHICK1;
NOTEXT234:IF(EMA(C,233)>REF(EMA(C,233),1) AND 交易周期条件,EMA(C,233),DRAWNULL),COLORRED,LINETHICK1;
{EMA均线上叉股票5\8\13日均线}
周期1:=(PERIOD=0 OR PERIOD=1 OR PERIOD=2);
E5:=EMA(C,5);
E8:=EMA(C,8);
E13:=EMA(C,13);
E13多:=(E13>REF(E13,1) AND REF(E13,1)>REF(E13,2));
E55:=EMA(C,55);
E55多:=(E55>REF(E55,1) AND REF(E55,1)>REF(E55,2));
E233:=EMA(C,233);
E233多:=(E233>REF(E233,1) AND REF(E233,1)>REF(E233,2));
年多:=(C>E233);
{三线金叉}
E5813:=CROSS(E5,E8) AND CROSS(8,13) AND E55多 AND E233多 AND 年多;
{多头上叉
E58:=CROSS(E5,E8) AND E13多 AND E55多 AND E233多 AND 年多;
DRAWICON( (E5813 OR E58),H,5);}
{13日均线向上拐向}
E1312:=REF(E13,4)<REF(E13,5) AND REF(E13,3)<REF(E13,4) AND REF(E13,2)<REF(E13,3) AND REF(E13,1)>REF(E13,2) AND E13>REF(E13,1);
{13日均线向下拐向}
E1311:=REF(E13,4)>REF(E13,5) AND REF(E13,3)>REF(E13,4) AND REF(E13,2)>REF(E13,3) AND REF(E13,1)<REF(E13,2) AND E13<REF(E13,1);
{55日均线向上拐向}
E5512:=REF(E55,4)<REF(E55,5) AND REF(E55,3)<REF(E55,4) AND REF(E55,2)<REF(E55,3) AND REF(E55,1)>REF(E55,2) AND E55>REF(E55,1);
{55日均线向下拐向}
E5511:=REF(E55,4)>REF(E55,5) AND REF(E55,3)>REF(E55,4) AND REF(E55,2)>REF(E55,3) AND REF(E55,1)<REF(E55,2) AND E55<REF(E55,1);
{长多或是长空信号}
长多:=(COUNT(E5512,3)>=1 AND COUNT(E1312,3)>=1);
长空:=(COUNT(E5511,3)>=1 AND COUNT(E1311,3)>=1);
DRAWICON(E1312 AND NOT(周期1) AND NOT(长多) AND 交易周期条件,E13,5);
DRAWICON(E1311 AND NOT(周期1) AND NOT(长空) AND 交易周期条件,E13,6);
DRAWICON(E5512 AND NOT(周期1) AND NOT(长多) AND 交易周期条件,E55,5);
DRAWICON(E5511 AND NOT(周期1) AND NOT(长空) AND 交易周期条件,E55,6);
DRAWICON(长多 AND NOT(周期1) AND 交易周期条件,E55,7);
DRAWICON(长空 AND NOT(周期1) AND 交易周期条件,E55,8);
{短期:近60天,中期:近120天,长期:240-500天}
显示周期:=(PERIOD=0 OR PERIOD=1 OR PERIOD=2 OR PERIOD=3 OR PERIOD=4 OR PERIOD=6 OR PERIOD=7 OR PERIOD=8 OR PERIOD=9 OR PERIOD=10);
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期),0.11,0.02,0,'短:60-中:120-长:240-500'),COLORRED;
{短期形态提示}
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=1,0.11,0.22,0,'短期形态:∧型反转'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=2,0.11,0.22,0,'短期形态:∨型反转'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=3,0.11,0.22,0,'短期形态:W底'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=4,0.11,0.22,0,'短期形态:M顶'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=5,0.11,0.22,0,'短期形态:盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=6,0.11,0.22,0,'短期形态:盘整上行'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=7,0.11,0.22,0,'短期形态:盘整下跌'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=8,0.11,0.22,0,'短期形态:上升通道'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=9,0.11,0.22,0,'短期形态:下降通道'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=10,0.11,0.22,0,'短期形态:拐头下跌'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=11,0.11,0.22,0,'短期形态:拐头上升'),COLORLIRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=12,0.11,0.22,0,'短期形态:上行盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=13,0.11,0.22,0,'短期形态:下跌盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_SHORT=14,0.11,0.22,0,'短期形态:NA/其它'),COLORLIBLUE;
{中期形态提示}
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=1,0.11,0.42,0,'中期形态:∧型反转'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=2,0.11,0.42,0,'中期形态:∨型反转'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=3,0.11,0.42,0,'中期形态:W底'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=4,0.11,0.42,0,'中期形态:M顶'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=5,0.11,0.42,0,'中期形态:盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=6,0.11,0.42,0,'中期形态:盘整上行'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=7,0.11,0.42,0,'中期形态:盘整下跌'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=8,0.11,0.42,0,'中期形态:上升通道'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=9,0.11,0.42,0,'中期形态:下降通道'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=10,0.11,0.42,0,'中期形态:拐头下跌'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=11,0.11,0.42,0,'中期形态:拐头上升'),COLORLIRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=12,0.11,0.42,0,'中期形态:上行盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=13,0.11,0.42,0,'中期形态:下跌盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_MID=14,0.11,0.42,0,'中期形态:NA/其它'),COLORLIBLUE;
{长期形态提示}
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=1,0.11,0.62,0,'长期形态:∧型反转'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=2,0.11,0.62,0,'长期形态:∨型反转'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=3,0.11,0.62,0,'长期形态:W底'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=4,0.11,0.62,0,'长期形态:M顶'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=5,0.11,0.62,0,'长期形态:盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=6,0.11,0.62,0,'长期形态:盘整上行'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=7,0.11,0.62,0,'长期形态:盘整下跌'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=8,0.11,0.62,0,'长期形态:上升通道'),COLORRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=9,0.11,0.62,0,'长期形态:下降通道'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=10,0.11,0.62,0,'长期形态:拐头下跌'),COLORLIGREEN;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=11,0.11,0.62,0,'长期形态:拐头上升'),COLORLIRED;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=12,0.11,0.62,0,'长期形态:上行盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=13,0.11,0.62,0,'长期形态:下跌盘整'),COLORLIBLUE;
DRAWTEXT_FIX(ISLASTBAR=1 AND NOT(显示周期) AND SHAPE_LONG=14,0.11,0.62,0,'长期形态:NA/其它'),COLORLIBLUE;
{描述行业、地域、风格和概念}
DY:='股息率:';
FG:=CON2STR(FINANCE(45),2);
股息率:=STRCAT(DY,FG);
DRAWTEXT_FIX(ISLASTBAR=1 AND 显示周期,0.11,0.02,0,股息率),COLOR9F5F9F;
2、公式图例:
发表评论