股友量 发表于 2022-1-6 22:56

指标编写问答92学习的宝藏

461.问:
      公式中取出来的
开:=OPEN;
高:=HIGH;
低:=LOW;
收:=CLOSE;
STICKLINE(收>=开 AND E8,高,低,0,0),COLORRED;
STICKLINE(收>=开 AND E8,收,开,4,0),COLORRED;
STICKLINE(收< 开 AND E8,高,低,0,0),COLOR00FF00;
STICKLINE(收< 开 AND E8,收,开,4,0),COLOR00FF00;
STICKLINE(开> 收 AND A8,低,高,0,0),COLORYELLOW;
STICKLINE(开> 收 AND A8,收,开,4,0),COLORYELLOW;
STICKLINE(开<=收 AND A8,低,高,0,0),COLORYELLOW;
STICKLINE(开<=收 AND A8,收,开,4,1),COLORYELLOW;
STICKLINE(开> 收 AND B8,低,高,0,0),COLORRED;
STICKLINE(开> 收 AND B8,收,开,4,0),COLORRED;
STICKLINE(开<=收 AND B8,低,高,0,0),COLORRED;
STICKLINE(开<=收 AND B8,收,开,4,1),COLORRED;
STICKLINE(开> 收 AND D8,低,高,0,0),COLORFFCC66;
STICKLINE(开> 收 AND D8,收,开,4,0),COLORFFCC66;
STICKLINE(开<=收 AND D8,低,高,0,0),COLORFFCC66;
STICKLINE(开<=收 AND D8,收,开,4,1),COLORFFCC66;
    答(阳之光):
       注意这么几个符号就明白了.
          <
          >
          <=
          >=
       分别以各自的颜色来表示.从颜色来区分涨跌和盘整


462.问:
       当日最低价触及某条均价线或低于某条均价线,当日收盘价高于此均价线,最好收阳.
    答(君俊):
       jx:=ma(c,n);
       cross(jx,l) and c>jx and c>o;


463.问:
       请把MACD+中的金叉数字加到MACD3中   
             1. macd+
       DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
       DEA:=EMA(DIFF,9);
       DEAA:EMA(DIFF, 9),COLORGREEN, linethick2;
       DEAC:EMA(DIFF, 1),COLORRED,linethick2;
       MACD:2*(DIFF-DEAA),COLORSTICK,linethick1;JC:=CROSS(DIFF,DEA);
       SC:=CROSS(DEA,DIFF);
       JCCOUNT:=COUNT(JC,BARSLAST(DEA>0));
       TEXT:=NUMTOSTR(JCCOUNT);
       DRAWTEXT(DEA<0 AND JC,DEA*0.9,TEXT),COLORMAGENTA;
       PARTLINE(DIFF,DIFF<DEAA*1),COLORBLUE,linethick1;
       零:-0,COLORBLACK,linethick3;
       零上金叉:=cross(DIFF,DEA) and DEA>0;
       DRAWTEXT( 零上金叉,0,'+'),colorwhite;
       DRAWTEXT( 零上金叉,-0.02,'零上金叉'),colorwhite;

       上市日期年:REF(YEAR,BARSCOUNT(C)-1),linethick0,COLORRED,PRECIS0;
       月:REF(MONTH,BARSCOUNT(C)-1),linethick0,COLORYELLOW,PRECIS0;

               2.macd3

       上市日期年:REF(YEAR,BARSCOUNT(C)-1),linethick0,COLORRED,PRECIS0;
       月:REF(MONTH,BARSCOUNT(C)-1),linethick0,COLORYELLOW,PRECIS0;
       日:REF(DAY,BARSCOUNT(C)-1),linethick0,COLORCYAN,PRECIS0;

       DIFF:EMA(C,12)-EMA(C,26);
       DEA :EMA(DIFF,9),COLORYELLOW;
       MACD:=2*(DIFF-DEA);      
       PARTLINE(DIFF,DIFF>REF(DIFF,1)AND REF(DIFF,1)>0,RGB(255,0,0),DIFF<REF(DIFF,1),
                RGB(0,255,0),DIFF>REF(DIFF,1)AND REF(DIFF,1)<0,RGB(255,0,255));
       PARTLINE(DEA,DEA>REF(DEA,1),RGB(255,255,0),DEA<REF(DEA,1),RGB(0,255,255));
       STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,6,0 ),COLOR00AAFF;
       STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,6.6,0 ),COLOR00BBFF;
       STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,4.4,0 ),COLOR00CCFF;
       STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,3.3,0 ),COLOR00DDFF;
       STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2.2,0 ),COLOR00EEFF;
       STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,1.1,0 ),COLOR00FFFF;
       STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,6,0 ),COLOR0000AA;
       STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,6.6 ,0 ),COLOR0011BB;
       STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,4.4,0 ),COLOr0022CC;
       STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,3.3 ,0 ),COLOR0033DD;
       STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,2.2 ,0 ),COLOR0044EE;
       STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,1.1 ,0 ),COLOR0055FF;
       STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,6,0 ),COLORAA00BB;
       STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,6.6 ,0 ),COLORBB11BB;
       STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,4.4,0 ),COLORCC22BB;
       STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,3.3,0 ),COLORDD33BB;
       STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,2.2 ,0 ),COLOREE44BB;
       STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,1.1 ,0 ),COLORFF55BB;
       STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,6,0 ),COLORFF7700;
       STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,6.6 ,0 ),COLORFF8811;
       STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,4.4,0 ),COLORFFAA22;
       STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,3.3 ,0 ),COLORFFBB33;
       STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,2.2 ,0 ),COLORFFDD44;
       STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,1.1 ,0 ),COLORFFFF55;
       零:-0,COLORBLACK,linethick3;
       零上金叉:=cross(DIFF,DEA) and DEA>0;
       DRAWTEXT( 零上金叉,0,'+'),colorwhite;
       DRAWTEXT( 零上金叉,-0.02,'零上金叉'),colorwhite;

       日:REF(DAY,BARSCOUNT(C)-1),linethick0,COLORCYAN,PRECIS0;
    答():
上市日期年:REF(YEAR,BARSCOUNT(C)-1),linethick0,COLORRED,PRECIS0;
月:REF(MONTH,BARSCOUNT(C)-1),linethick0,COLORYELLOW,PRECIS0;
日:REF(DAY,BARSCOUNT(C)-1),linethick0,COLORCYAN,PRECIS0;

DIFF:EMA(C,12)-EMA(C,26);
DEA :EMA(DIFF,9),COLORYELLOW;
MACD:=2*(DIFF-DEA);      
PARTLINE(DIFF,DIFF>REF(DIFF,1)AND REF(DIFF,1)>0,RGB(255,0,0),DIFF<REF(DIFF,1),
                  RGB(0,255,0),DIFF>REF(DIFF,1)AND REF(DIFF,1)<0,RGB(255,0,255));
PARTLINE(DEA,DEA>REF(DEA,1),RGB(255,255,0),DEA<REF(DEA,1),RGB(0,255,255));
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,6,0 ),COLOR00AAFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,6.6,0 ),COLOR00BBFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,4.4,0 ),COLOR00CCFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,3.3,0 ),COLOR00DDFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,2.2,0 ),COLOR00EEFF;
STICKLINE(MACD<ref(MACD,1)and MACD>0,0,MACD,1.1,0 ),COLOR00FFFF;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,6,0 ),COLOR0000AA;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,6.6 ,0 ),COLOR0011BB;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,4.4,0 ),COLOr0022CC;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,3.3 ,0 ),COLOR0033DD;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,2.2 ,0 ),COLOR0044EE;
STICKLINE(MACD>=ref(MACD,1)and MACD>0,0,MACD,1.1 ,0 ),COLOR0055FF;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,6,0 ),COLORAA00BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,6.6 ,0 ),COLORBB11BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,4.4,0 ),COLORCC22BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,3.3,0 ),COLORDD33BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,2.2 ,0 ),COLOREE44BB;
STICKLINE(MACD>ref(MACD,1)and MACD<0,0,MACD,1.1 ,0 ),COLORFF55BB;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,6,0 ),COLORFF7700;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,6.6 ,0 ),COLORFF8811;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,4.4,0 ),COLORFFAA22;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,3.3 ,0 ),COLORFFBB33;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,2.2 ,0 ),COLORFFDD44;
STICKLINE(MACD<=ref(MACD,1)and MACD<0,0,MACD,1.1 ,0 ),COLORFFFF55;
零:-0,COLORBLACK,linethick3;
零上金叉:=cross(DIFF,DEA) and DEA>0;
JC:=CROSS(DIFF,DEA);
JCCOUNT:=COUNT(JC,BARSLAST(DEA>0));
TEXT:=NUMTOSTR(JCCOUNT);
DRAWTEXT(DEA<0 AND JC,DEA*0.9,TEXT),COLORMAGENTA;
DRAWTEXT( 零上金叉,0,'+'),colorwhite;
DRAWTEXT( 零上金叉,-0.02,'零上金叉'),colorwhite;


464.问:
       公式描述:今日K线的下影线大于实体3倍以上,(分析家软件使用)

    答(进军股市):
       X1:=min(o,c)-l;
       X2:=max(o,c)-min(o,c);
       X:X1>X2*3;


465.问:
       两阳夹一阴
    答(重剑无锋):
A1:=REF(C,2)>REF(O,2)*1.03;{确定前天阳线实体大小}
A2:=REF(C,1)<REF(O,1)*1.005 and ref(c,1)<ref(c,2);{确定昨天为阴线收盘价低于前天收盘价}
A3:=C>O*1.023 AND C>REF(C,1)*0.99;{确定今天阳线实体收盘价大于昨天阴线}
两阳夹一阴:A1AND A2 AND A3 ;

页: [1]
查看完整版本: 指标编写问答92学习的宝藏