前期最高价和最低价改为收盘价和开盘价

    菜鸟 发表于 2020-06-08 21:17 ・1025次浏览 1条跟帖 赢顺 wh6 回复

    
    前2月最低价:=REF(LLV(L,NY),SUMBARS(NY=1,2)),NODRAW;
    DRAWTEXT(ISLASTBAR,上月最低价,'前2月最低价'),ALIGN0;
    DRAWSL(CROSS(A,0.5),REFX1(前2月最高价,1000),0,1,2,COLORGREEN);
    前3月最低价:=REF(LLV(L,NY),SUMBARS(NY=1,3)),NODRAW;
    DRAWTEXT(ISLASTBAR,前3月最低价,'前3月最低价'),ALIGN0;
    DRAWSL(CROSS(A,0.5),REFX1(前3月最高价,1000),0,1,2,COLORGREEN);
    NJ:=BARSLAST(QUARTER<>REF(QUARTER,1))+1;
    DRAWSL(CROSS(A,0.5),REFX1(上季最低价,1000),0,1,2,COLORRED);
    上季最高价:=REF(HHV(H,NJ),SUMBARS(NJ=1,1));
    DRAWTEXT(ISLASTBAR,上季最高价,'上季最高价'),ALIGN0;
    DRAWSL(CROSS(A,0.5),REFX1(前2季最低价,1000),0,1,2,COLORRED);
    前2季最高价:=REF(HHV(H,NJ),SUMBARS(NJ=1,2)),NODRAW;
    DRAWTEXT(ISLASTBAR,前2季最高价,'前2季最高价'),ALIGN0;
    DRAWSL(CROSS(A,0.5),REFX1(前3季最低价,1000),0,1,2,COLORRED);
    前3季最高价:=REF(HHV(H,NJ),SUMBARS(NJ=1,3)),NODRAW;
    DRAWTEXT(ISLASTBAR,前3季最高价,'前3季最高价'),ALIGN0;
    上年最低价:=REF(LLV(L,N),SUMBARS(N=1,1)),NODRAW;
    DRAWTEXT(ISLASTBAR,上年最低价,'上年最低价'),ALIGN0;
    DRAWSL(CROSS(A,0.5),REFX1(上年最高价,1000),0,1,2,COLORGREEN);
    前2年最低价:=REF(LLV(L,N),SUMBARS(N=1,2)),NODRAW;
    DRAWTEXT(ISLASTBAR,前2年最低价,'前2年最低价'),ALIGN0;
    DRAWSL(CROSS(A,0.5),REFX1(前2年最高价,1000),0,1,2,COLORGREEN);
    前3年最低价:=REF(LLV(L,N),SUMBARS(N=1,3)),NODRAW;
    DRAWTEXT(ISLASTBAR,前3年最低价,'前3年最低价'),ALIGN0;
    DRAWSL(CROSS(A,0.5),REFX1(前3年最高价,1000),0,1,2,COLORGREEN);
        
    
    

    autojiaoyi.com 沙发

    参考:
    NZ:=BARSLAST(WEEKDAY<REF(WEEKDAY,1))+1;
    上周开盘价:=REF(REF(O,NZ-1),NZ),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(上周开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,上周开盘价,'上周开盘价'),ALIGN0;
    上周收盘价:=REF(C,SUMBARS(NZ=1,1)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(上周收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,上周收盘价,'上周收盘价'),ALIGN0;
    前2周开盘价:=REF(REF(O,NZ-1),SUMBARS(NZ=1,2)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前2周开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,前2周开盘价,'前2周开盘价'),ALIGN0;
    前2周收盘价:=REF(C,SUMBARS(NZ=1,2)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前2周收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,前2周收盘价,'前2周收盘价'),ALIGN0;
    前3周开盘价:=REF(REF(O,NZ-1),SUMBARS(NZ=1,3)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前3周开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,前3周开盘价,'前3周开盘价'),ALIGN0;
    前3周收盘价:=REF(C,SUMBARS(NZ=1,3)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前3周收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,前3周收盘价,'前3周收盘价'),ALIGN0;
    NY:=BARSLAST(MONTH<>REF(MONTH,1))+1;
    上月开盘价:=REF(REF(O,NY-1),SUMBARS(NY=1,1)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(上月开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,上月开盘价,'上月开盘价'),ALIGN0;
    上月收盘价:=REF(C,SUMBARS(NY=1,1)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(上月收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,上月收盘价,'上月收盘价'),ALIGN0;
    前2月开盘价:=REF(REF(O,NY-1),SUMBARS(NY=1,2)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前2月开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,上月开盘价,'前2月开盘价'),ALIGN0;
    前2月收盘价:=REF(C,SUMBARS(NY=1,2)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前2月收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,前2月收盘价,'前2月收盘价'),ALIGN0;
    前3月开盘价:=REF(REF(O,NY-1),SUMBARS(NY=1,3)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前3月开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,前3月开盘价,'前3月开盘价'),ALIGN0;
    前3月收盘价:=REF(C,SUMBARS(NY=1,3)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前3月收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,前3月收盘价,'前3月收盘价'),ALIGN0;
    NJ:=BARSLAST(QUARTER<>REF(QUARTER,1))+1;
    上季开盘价:=REF(REF(O,NJ-1),SUMBARS(NJ=1,1)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(上季开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,上季开盘价,'上季开盘价'),ALIGN0;
    上季收盘价:=REF(C,SUMBARS(NJ=1,1));
    DRAWSL(CROSS(A,0.5),REFX1(上季收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,上季收盘价,'上季收盘价'),ALIGN0;
    前2季开盘价:=REF(REF(O,NJ-1),SUMBARS(NJ=1,2)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前2季开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,前2季开盘价,'前2季开盘价'),ALIGN0;
    前2季收盘价:=REF(C,SUMBARS(NJ=1,2)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前2季收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,前2季收盘价,'前2季收盘价'),ALIGN0;
    前3季开盘价:=REF(REF(O,NJ-1),SUMBARS(NJ=1,3)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前3季开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,前3季开盘价,'前3季开盘价'),ALIGN0;
    前3季收盘价:=REF(C,SUMBARS(NJ=1,3)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前3季收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,前3季收盘价,'前3季收盘价'),ALIGN0;
    N:=BARSLAST(YEAR<>REF(YEAR,1))+1;
    上年开盘价:=REF(REF(O,N-1),SUMBARS(N=1,1)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(上年开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,上年开盘价,'上年开盘价'),ALIGN0;
    上年收盘价:=REF(C,SUMBARS(N=1,1)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(上年收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,上年收盘价,'上年收盘价'),ALIGN0;
    前2年开盘价:=REF(REF(O,N-1),SUMBARS(N=1,2)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前2年开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,前2年开盘价,'前2年开盘价'),ALIGN0;
    前2年收盘价:=REF(C,SUMBARS(N=1,2)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前2年收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,前2年收盘价,'前2年收盘价'),ALIGN0;
    前3年开盘价:=REF(REF(O,N-1),SUMBARS(N=1,3)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前3年开盘价,1000),0,1,2,COLORRED);
    DRAWTEXT(ISLASTBAR,前3年开盘价,'前3年开盘价'),ALIGN0;
    前3年收盘价:=REF(C,SUMBARS(N=1,3)),NODRAW;
    DRAWSL(CROSS(A,0.5),REFX1(前3年收盘价,1000),0,1,2,COLORGREEN);
    DRAWTEXT(ISLASTBAR,前3年收盘价,'前3年收盘价'),ALIGN0;
    回复

    本版积分规则

    发布新内容
    请关注微信公众号,获取最新指标公式
    加入收藏 我要分享
    分享到论坛或者博客

    复制
    热门指标策略
    快速回复 返回顶部 返回列表