趋势主图指标源码分享适用期货股市




DRAWGBK(C>0,RGB(0,0,110),RGB(0,25,0),0,' ',0);

Z1:=STRCAT(HYBLOCK,' ');

Z2:=STRCAT(Z1,DYBLOCK);

Z3:=STRCAT(Z2,' ');

DRAWTEXT_FIX(ISLASTBAR,0,0,0,STRCAT(Z3,GNBLOCK)),COLORYELLOW;

DRAWKLINE(H,O,L,C);

SJTJ:=1;

XA_1:=IF(1=1 OR 1=3,HIGH,CLOSE);

XA_2:=IF(1=1 OR 1=3,LOW,CLOSE);

XA_3:=3=1 OR 3=2 OR 3=3;

XA_4:=3=2 OR 3=3;

XA_5:=3=3;

XA_6:=C;

XA_7:=IF(XA_6=1,REF(XA_6,1)-1,IF(XA_6=(-1),REF(XA_6,1)+1,XA_6));

XA_8:=IF(XA_7<0,XA_7+1,XA_7-1);

XA_9:=TROUGHBARS(3,3,1);

XA_10:=PEAKBARS(3,3,1);




XA_11:=IF(XA_9=0,(-1),IF(XA_10=0,1,0));

XA_12:=IF(XA_9=0,XA_10,IF(XA_10=0,-XA_9,IF(XA_9>XA_10,XA_10,-XA_9)));

XA_13:=H;

XA_14:=BARSLAST(XA_13<0);

XA_15:=BARSLAST(XA_13>0);

XA_16:=IF(XA_14=0,(-1),IF(XA_15=0,1,0));

XA_17:=IF(XA_14=0,XA_15,IF(XA_15=0,-XA_14,IF(XA_14>XA_15,XA_15,-XA_14)));




XA_18:=IF(1=2,XA_11,IF(1=3,XA_16,XA_6));

XA_19:=IF(1=2,XA_12,IF(1=3,XA_17,XA_8));

XA_20:=IF(XA_19<0,-XA_19,XA_19);

周期:XA_20,NODRAW,COLORWHITE;

XA_21:=IF(XA_19>0,100*(XA_2/REF(XA_1,XA_20)-1),100*(XA_1/REF(XA_2,XA_20)-1));




涨跌幅:XA_21,NODRAW,COLORWHITE;

XA_22:=INBLOCK(1)=1 AND NOT(NAMEINCLUDE(2));

XA_23:=IF(0=0,XA_20,MIN(XA_20,0));

XA_24:=IF(XA_19>0,100*(XA_2/REF(XA_1,XA_23)-1),100*(XA_1/REF(XA_2,XA_23)-1));

XA_25:=IF(XA_22,AMOUNT/100000000,VOL/100);

XA_26:=SUM(XA_25,XA_23);

XA_27:=XA_26/XA_24/1;

速度指数:XA_27,NODRAW,COLORWHITE;

DRAWLINE(XA_3 AND XA_18=(-1),XA_2,XA_3 AND XA_18=1,XA_1,0),DOTLINE,COLORYELLOW;

DRAWLINE(XA_3 AND XA_18=1,XA_1,XA_3 AND XA_18=(-1),XA_2,0),DOTLINE,COLORYELLOW;

DRAWNUMBER(XA_4 AND XA_18=1,HIGH,ROUND(XA_27)),COLORWHITE,LINETHICK9;

DRAWNUMBER(XA_4 AND XA_18=(-1),LOW,ROUND(XA_27)),COLORWHITE;

XA_28:=BARSLAST(XA_18=1);CHAGULA:SMA(MAX(CLOSE-C,0),7,1)/SMA(ABS(CLOSE-C),7,1)*100,NODRAW;

XA_29:=BARSLAST(XA_18=(-1));

XA_30:=IF(XA_28=0 OR XA_29=0,DRAWNULL,(REF(XA_1,XA_28)+REF(XA_2,XA_29))/2);

R50%:IF(XA_5,XA_30,DRAWNULL),POINTDOT,COLORWHITE;

XA_31:=IF(HIGH<REF(LOW,1),REF(LOW,1),HIGH);

XA_32:=IF(LOW>REF(HIGH,1),REF(HIGH,1),LOW);

XA_33:=HHV(XA_31,3);

XA_34:=LLV(XA_32,3);

XA_35:=BARSLAST(XA_34<REF(XA_34,1));

XA_36:=BARSLAST(XA_33>REF(XA_33,1));

XA_37:=IF(HHV(XA_31,XA_36+1)=XA_31,1,0);

XA_38:=IF(LLV(XA_32,XA_35+1)=XA_32,1,0);




XA_39:=BARSLAST(XA_37);

XA_40:=REF(LLV(XA_32,3),XA_39);

XA_41:=BARSLAST(XA_38);

XA_42:=REF(HHV(XA_31,3),XA_41);

XA_43:=VALUEWHEN(XA_42>0,XA_42);

XA_44:=VALUEWHEN(XA_40>0,XA_40);

XA_45:=IF(CLOSE>XA_43,(-1),IF(CLOSE<XA_44,1,0));

XA_46:=VALUEWHEN(XA_45!=0,XA_45);

XA_47:=BARSLAST(CROSS(0,XA_46));

XA_48:=BARSLAST(CROSS(XA_46,0));




XA_49:=IF(XA_46=1,IF(LLV(XA_43,XA_48+1)=XA_43,XA_43,LLV(XA_43,XA_48+1)),XA_43);

XA_50:=IF(XA_46=(-1),IF(HHV(XA_44,XA_47+1)=XA_44,XA_44,HHV(XA_44,XA_47+1)),XA_44);

XA_51:=IF(CLOSE>XA_49,(-1),IF(CLOSE<XA_50,1,0));

XA_52:=VALUEWHEN(XA_51!=0,XA_51);

XA_53:=BARSLAST(CROSS(0,XA_51));

XA_54:=BARSLAST(CROSS(XA_51,0));

XA_55:=IF(XA_52=1,IF(LLV(XA_49,XA_54+1)=XA_49,XA_49,LLV(XA_49,XA_54+1)),IF(HHV(XA_50,XA_53+1)=XA_50,XA_50,HHV(XA_50,XA_53+1)));

多头止损:IF(XA_5 AND XA_52<0,XA_55,DRAWNULL),COLORRED,LINETHICK2;

空头止损:IF(XA_5 AND XA_52>0,XA_55,DRAWNULL),COLORGREEN,LINETHICK2;




STICKLINE(多头止损 AND C>O,OPEN,CLOSE,-1,1),COLORRED;

{STICKLINE(多头止损,OPEN,H,0.0,0),COLORRED;}

{STICKLINE(多头止损,C,L,0.0,0),COLORRED;}

STICKLINE(多头止损 AND C<O,OPEN,CLOSE,-1,0),COLORRED;

{STICKLINE(多头止损,O,L,0.0,0),COLORRED;

STICKLINE(多头止损,C,H,0.0,0),COLORRED;}




STICKLINE(空头止损 AND C<O,OPEN,CLOSE,-1,1),COLORGREEN;

{STICKLINE(空头止损,OPEN,H,0.0,0),COLORGREEN;}

{STICKLINE(空头止损,C,L,0.0,0),COLORGREEN;}

STICKLINE(空头止损 AND C>O,OPEN,CLOSE,-1,0),COLORGREEN;

{STICKLINE(空头止损,C,H,0.0,0),COLORGREEN;

STICKLINE(空头止损,O,L,0.0,0),COLORGREEN;};







未来函数检测结果如下:
该公式包含未来函数:PEAK
该公式包含未来函数:PEAKBARS
该公式包含未来函数:TROUGH
该公式包含未来函数:TROUGHBARS

解密、定制、编写股票指标请联系QQ或微信同号:88652583
相关股票指标公式

联系我们  |  指标公式网  |  指标网   |  指标公式  |   加入收藏   |  设为主页

@2005-2023 浙ICP备2024071487号-2 指标公式网别名指标网仅为互联网文章,所有指标公式及文章仅供学习研究,并不构成投资建议,请勿以此为依据进行股票交易,由此引起的投资亏损与本站无关。指标公式网均来源互联网收集整理,如不慎侵犯了你的权益,请联系我们告知,我们将做删除处理
QQ:88652583 微信 88652583
sitemap站点地图