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

麻烦老师解释下 [文华财经]

  • 咨询内容: 麻烦老师给翻译下这段程序,看不懂开平仓条件。谢谢
     TT:=OFFSETPROFIT<18000;N0:=TIME<1510;BB:=BARSLAST(DAY<>REF(DAY,1))+1;JJ:=SETTLE;PB1:=PUBU(CLOSE,0);PB2:=PUBU(CLOSE,1);PB3:=PUBU(CLOSE,2);PB4:=PUBU(CLOSE,3);PB5:=PUBU(CLOSE,4);PB6:=PUBU(CLOSE,5);MA1:=MA(CLOSE,60);RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;K:=SMA(RSV,3,1);D1:=SMA(K,3,1);PB7:=PB1>JJ&&PB2>JJ;PB8:=PB1<JJ&&PB2<JJ;PB9:=PB1>PB2&&PB1>PB3&&PB1>PB4&&PB1>PB5&&PB1>PB6;PB10:=PB1<PB2&&PB1<PB3&&PB1<PB4&&PB1<PB5&&PB1<PB6;PB71:=PB6>=PB1&&PB6>=PB2&&PB6>=PB3&&PB6>=PB4&&PB6>=PB5;PB81:=PB6<=PB1&&PB6<=PB2&&PB6<=PB3&&PB6<=PB4&&PB6<=PB5;PB72:=PB1>MA1&&PB2>MA1&&PB3>MA1&&PB4>MA1&&PB5>MA1&&PB6>MA1;PB82:=PB1<MA1&&PB2<MA1&&PB3<MA1&&PB4<MA1&&PB5<MA1&&PB6<MA1;HH:=(HHV(H,BB));LL:=(LLV(L,BB));JC:=HH-LL;JZ:=JJ*0.005;TJ:=JC>=JZ;AA5:=PB72&&PB9&&CLOSE>JJ&&PB7&&PB81&&CLOSE>PB6&&CLOSE>MA1&&PB9&&TJ&&C>=REF(HH,1)&&K>D1;BB5:=PB82&&PB10&&CLOSE<JJ&&PB8&&PB71&&CLOSE<PB6&&CLOSE<MA1&&PB10&&TJ&&C<=REF(LL,1)&&K<D1 ;JZF:=JJ*0.025;TJF:=JC>=JZF;AA5F:=PB72&&PB9&&CLOSE>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2=0&&NNF4=0&&NN=0,BPK;TT&&NNFA3&&N0,SPK;TT&&MMFB3&&N0,BPK;TT&&AAF&&N0,BPK;TT&&BBF&&N0,SPK;TT&&NNB1&&NNB2=1&&MMF4=0&&MM=0&&N0,BPK;TT&&MMB1&&MMB2=1&&NNF4=0&&NN=0&&N0,SPK;TT&&NNB3=2&&MMF4=0&&NNB&&MM=0&&N0,BPK;TT&&MMB3=2&&NNF4=0&&MMB&&NN=0&&N0,SPK;TT&&NNB3=1&&MMF4=0&&NNB&&FF=1&&MM=0&&N0,BPK;TT&&MMB3=1&&NNF4=0&&MMB&&YY=1&&NN=0&&N0,SPK;TT&&NNA1&&NNA2=1&&SHORT_VOL<1&&N0,BPK;TT&&MMA1&&MMA2=1&&LONG_VOL<1&&N0,SPK;REF(NNB3=1,1)&&REF(NNB,1),BP;REF(MMB3=1,1)&&REF(MMB,1),SP;(C<=BKPRICE-5)&&BKPRICE>0,SP;(C>=SKPRICE+5)&&SKPRICE>0,BP;OFFSETPROFIT<-18000,CLOSEOUT;CHECKSIG_SEC(SP,'A',0,'C',0);CHECKSIG_SEC(BP,'A',0,'C',0);TIME>1512,SP;TIME>1512,BP;SETSIGPRICETYPE(BPK,LIMIT_ORDER);//BK信号以信号发出时的最新价进行委托SETSIGPRICETYPE(SPK,LIMIT_ORDER);//SK信号以信号发出时的最新价进行委托SETSIGPRICETYPE(BP,LIMIT_ORDER);//BP信号根据连续追价的设置进行委托SETSIGPRICETYPE(SP,LIMIT_ORDER);//SP信号根据连续追价的设置进行委托AUTOFILTER;

     

  • 文华技术人员:  抱歉我们不提供大篇幅模型的翻译,您可以参考函数说明学习自行翻译,如果对哪句有疑问可以提出我们帮您分析;

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 511411198  点击这里给我发消息进行 有偿 编写!不贵!点击查看价格!


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

相关文章

    没有相关内容