您现在的位置:程序化交易>> 期货公式>> 文华财经>> 文华财经知识>>正文内容

帮忙改显示位置 [文华财经]

  • 咨询内容:  老师好,请帮我将下面公式改一下开多,开空的显示位置,即是把开多开空显示在屏幕的最底边,成直线,不要跟随K线高低显示,其他的不变,多谢VAR1:=HHV(HIGH,9)-LLV(LOW,9);VAR2:=HHV(HIGH,9)-CLOSE;VAR3:=CLOSE-LLV(LOW,9);VAR4:=VAR2/VAR1*100-70;VAR5:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*100;VAR6:=(2*CLOSE+HIGH+LOW)/4;VAR7:=SMA(VAR3/VAR1*100,3,1);VAR8:=LLV(LOW,34);VAR9:=SMA(VAR7,3,1)-SMA(VAR4,9,1);VAR10:=IF(VAR9>100,VAR9-100,0);VAR11:=HHV(HIGH,34);VAR12:=EMA((VAR6-VAR8)/(VAR11-VAR8)*100,13);VAR13:=EMA(0.667*REF(VAR12,1)+0.333*VAR12,2);N11:=BARSLAST(CROSS(VAR12,VAR13))+1;N22:=BARSLAST(CROSSDOWN(VAR12,VAR13))+1;T11:=BACKSET(N11=1&&N22<=4,N22);T22:=BACKSET(N22=1&&N11<=4,N11);

    NN:=1;MM:=1;HH1:=IFELSE(H<REF(H,1) && REF(H,1)<REF(H,2),REF(H,2),0);LL1:=IFELSE(L>REF(L,1) && REF(L,1)>REF(L,2),REF(L,2),0);HH2:=VALUEWHEN(HH1>0,HH1);LL2:=VALUEWHEN(LL1>0,LL1);K1:=IFELSE(CLOSE>HH2,-3,IFELSE(CLOSE<LL2,1,0));K2:=VALUEWHEN(K1<>0,K1);G:=IFELSE(K2=1,HH2,LL2);G1:=VALUEWHEN(ISLASTBAR,G);W1:=K2;W2:=OPEN-CLOSE;HT:=IFELSE(OPEN>CLOSE,OPEN,CLOSE);LT:=IFELSE(OPEN<CLOSE,OPEN,CLOSE);BAA:=1;MA4:=EMA(CLOSE,10)*BAA;HH:=HHV(HIGH,5)*BAA;LL:=LLV(LOW,5)*BAA;H1:=IFELSE(CLOSE>REF(HH,1),1,0)*BAA;L1:=IFELSE(CLOSE<REF(LL,1),-1,0)*BAA;H0:=REF(HIGH,1)*BAA;L0:=REF(LOW,1)*BAA;P7:=H1+L1*BAA;P8:=IFELSE(P7=0,REF(P7,1),P7)*BAA;P9:=IFELSE(P8=0,REF(P8,1),P8)*BAA;P10:=IFELSE(P9=0,REF(P9,1),P9)*BAA;P11:=IFELSE(P10=0,REF(P10,1),P10)*BAA;P12:=IFELSE(P11=0,REF(P11,1),P11)*BAA;P13:=IFELSE(P12=0,REF(P12,1),P12)*BAA;P14:=IFELSE(P13=0,REF(P13,1),P13)*BAA;P15:=IFELSE(P14=0,REF(P14,1),P14)*BAA;P16:=IFELSE(P15=0,REF(P15,1),P15)*BAA;P17:=IFELSE(P16=0,REF(P16,1),P16)*BAA;P18:=IFELSE(P17=0,REF(P17,1),P17)*BAA;P19:=IFELSE(P18=0,REF(P18,1),P18)*BAA;P20:=IFELSE(P19=0,REF(P19,1),P19)*BAA;P21:=IFELSE(P20=0,REF(P20,1),P20)*BAA;P22:=IFELSE(P21=0,REF(P21,1),P21)*BAA;P23:=IFELSE(P22=0,REF(P22,1),P22)*BAA;P24:=IFELSE(P23=0,REF(P23,1),P23)*BAA;P25:=IFELSE(P24=0,REF(P24,1),P24)*BAA;P26:=IFELSE(P25=0,REF(P25,1),P25)*BAA;P27:=IFELSE(P26=0,REF(P26,1),P26)*BAA;P28:=IFELSE(P27=0,REF(P27,1),P27)*BAA;P29:=IFELSE(P28=0,REF(P28,1),P28)*BAA;P30:=IFELSE(P29=0,REF(P29,1),P29)*BAA;T:=IFELSE(P30=0,REF(P30,1),P30)*BAA;
    DD:=BARSLAST(CROSS(T=1,0.5));KK:=BARSLAST(CROSS(T=-1,0.5));N1:=7;N2:=14;LC:=REF(CLOSE,1);RSI1:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;RSI2:=SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100;SHORT:=12;LONG:=26;M:=9;DIFF:=EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);DEA:=EMA(DIFF,M);V1:=LLV(LOW,10);V2:=HHV(H,25);价位线:=EMA((C-V1)/(V2-V1)*4,4);VV1:=(C*2+H+L)/4*10;VV2:=EMA(VV1,13)-EMA(VV1,34);VV3:=EMA(VV2,5);VV4:=2*(VV2-VV3)*5.5;主力撤:=IF(VV4<=0,VV4,0);主力进:=IF(VV4>=0,VV4,0);V11:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA(SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1),3,1);趋势线:=EMA(V11,3);V12:=(趋势线-REF(趋势线,1))/REF(趋势线,1)*100;买入:=趋势线<=13 && V12>13;BB:=(趋势线<=13 && V12>13) && FILTER((趋势线<=13 && V12>13),10);逃顶:=FILTER(趋势线>90 && 趋势线<REF(趋势线,1) && 主力进<REF(主力进,1),8);KD1:=CROSS(T=1,0.5) && W1=-3 && DD<KK;KD2:=(W1=-3 && DD<KK && DIFF>DEA && RSI1>RSI2);PK1:=CROSS(T=-1,0.5) && W1=1 && KK<DD;PK2:=W1=1 && KK<DD && DIFF<DEA && RSI1<RSI2;KDD:=BARSLAST(CROSS(W1=-3 && DD<KK,0.5))+1;PKK:=BARSLAST(CROSS(W1=1 && KK<DD,0.5))+1;DD11:=(CROSS(COUNT(KD1 || KD2,KDD)=1,0.5) || KD1);T1:=CROSS(3.5,价位线) && (DIFF<DEA || RSI1<RSI2);T2:=逃顶 && (DIFF<DEA || RSI1<RSI2);T3:=NOT(W1=-3 && DD<KK) && REF(W1=-3 && DD<KK,1);T31:=CROSS(DIFF<DEA && RSI1<RSI2,0.5);T4:=CROSS(COUNT(T1 || T2 || T3 || T31,BARSLAST(DD11)+1)=1,0.5);KK11:=(CROSS(COUNT(PK1 || PK2,PKK)=1,0.5) || PK1);S1:=CROSS(价位线,0.3) && (DIFF>DEA || RSI1>RSI2);S2:=BB && (DIFF>DEA || RSI1>RSI2);S3:=NOT(W1=1 && DD>KK) && REF(W1=1 && DD>KK,1);S31:=CROSS(DIFF>DEA && RSI1>RSI2,0.5);S4:=CROSS(COUNT(S1 || S2 || S3 || S31,BARSLAST(KK11)+1)=1,0.5);MA20:=EMA(CLOSE,20);M1:=MA(CLOSE,5);M2:=MA(CLOSE,20),COLORYELLOW;ZYZS:=IFELSE((M1>M2),M2,M1),COLORGREEN;D10151:=BARSLAST((CROSS(COUNT(KD1 || KD2,KDD)=1,0.5) || KD2) && C>MA20);K10152:=BARSLAST((CROSS(COUNT(PK1 || PK2,PKK)=1,0.5) || PK2) && C<MA20);K10152P:=BARSLAST(NOT(W1=1 && KK<DD));D10151P:=BARSLAST(NOT(W1=-3 && DD<KK));PJ:=MA(H-L,20);
    VAR2Q:=EMA(CLOSE,120);VAR3Q:=(CLOSE-VAR2Q)*2/(120+1)+VAR2Q;生命线:=VAR3Q,LINETHICK2,COLORRED;
    DRAWTEXT(REFX(CROSS(D10151<D10151P,0.5),1)&&C>生命线,L-NN*MINPRICE,'多',VALIGN0,COLORMAGENTA,FONTSIZE24;DRAWTEXT(REFX(CROSS(K10152<K10152P,0.5),1)&&C<生命线,H+MM*MINPRICE,'空',COLORGREEN,FONTSIZE24;


     

     来源:程序化99

  • 文华技术人员:  模型是依附K线进行标注的,编写取到K线底框的位置。
    可以通过修改标注点位为某个价格来类似的实现,但是合约不同,标注的高度也需要自行修改。
    例如铁矿主力,标注到700的位置:
    DRAWTEXT(REFX(CROSS(D10151<D10151P,0.5),1)&&C>生命线,700,'多',VALIGN0,COLORMAGENTA,FONTSIZE24;DRAWTEXT(REFX(CROSS(K10152<K10152P,0.5),1)&&C<生命线,700,'空',COLORGREEN,FONTSIZE24;

     

     来源: WWW.CXH99.COM

  • 文华客服:  老师好,我标注到700显示在屏幕中间位置,我想显示在屏幕下边最底位置,要改到什么数值,

     

  • 网友回复:  随着K线图的拖动,K线坐标也会随价格变动。
    这种标记方式并无固定值,需要您根据当时K线情况进行修改,比如改为696您看下

    DRAWTEXT(REFX(CROSS(D10151<D10151P,0.5),1)&&C>生命线,696,'多',COLORMAGENTA,FONTSIZE24; DRAWTEXT(REFX(CROSS(K10152<K10152P,0.5),1)&&C<生命线,696,'空',COLORGREEN,FONTSIZE24;

     

  • 网友回复:  还是在中间位置,要怎样修改请老师帮帮忙

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信号:cxh99cxh99  进行 有偿收费 编写!

怎么收费,代编流程等详情请点击阅读!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容