问答交流

【其他】可以把下面的代码转化为BigQuant语言吗

由bqlnkkup创建,最终由small_q 被浏览 21 用户

NN:=BARSLAST(DATE<>REF(DATE,1))+1;

HH:=REF(HHV(HIGH,NN),NN);

LL:=REF(LLV(LOW,NN),NN);

CC:=VALUEWHEN(DATE<>REF(DATE,1),REF(CLOSE,1));

OO:=VALUEWHEN(DATE<>REF(DATE,1),O);

HHJ:=IF(NN=1,OO,REF(HHV(H,NN),1));

LLJ:=IF(NN=1,OO,REF(LLV(L,NN),1));

RFILTER:=(HH-LL)>28/100*(OO/100);

SSETUP:=HH+83/100*(CC-LL);

BSETUP:=LL-84/100*(HH-CC);

SENTER:=(1+80/100)/2*(HH+LL)-74/100*LL;

BENTER:=(1+74/100)/2*(HH+LL)-74/100*HH;

ZGS:=SENTER+(HHJ-SSETUP)/188;

ZGX:=BENTER-(BSETUP-LLJ)/61;

SG:=SSETUP+16/100*(SSETUP-BSETUP);

XG:=BSETUP-16/100*(SSETUP-BSETUP);

AA:=NN>=2&&RFILTER AND TIME<=1451;

BB:=HHJ>SSETUP;

DD:=LLJ<BSETUP;

BK1:=AA&&DD&&CROSS(H,ZGX);

SK1:=AA&&BB&&CROSS(ZGS,L);

BK2:=AA&&CROSS(H,SG);

SK2:=AA&&CROSS(XG,L);

BK3:=H>HH+(HH-LL)*46/100&&H>REF(HHV(H,NN),1)&&(HH-LL)<255/100*(OO/100);

SK3:=L<LL-(HH-LL)*26/100&&L<REF(LLV(L,NN),1)&&(HH-LL)<157/100*(OO/100);

DFD:=O<CC*(1+0.028) AND O>CC*(1-0.028);

KFD:=O>CC*(1-0.028) AND O<CC*(1+0.028);

BKA:=(BK1 OR BK2 OR BK3) AND DFD AND H<>L;

SKA:=(SK1 OR SK2 OR SK3) AND KFD AND H<>L;

SPHH:=REF(HHV(H,BARSLAST(BKA)+1),1);

BPLL:=REF(LLV(L,BARSLAST(SKA)+1),1);

OUT:=OO/102;

SPA:=(NOT(SKA OR BKA)&&(SPHH-L)>OUT) OR CLOSEMINUTE<=2 OR REF(EVERY(REF(H=L,1),2),1);

BPA:=(NOT(BKA OR SKA)&&(H-BPLL)>OUT) OR CLOSEMINUTE<=2 OR REF(EVERY(REF(H=L,1),2),1);

KT:=CLOSEMINUTE<=5||CLOSEMINUTEEVERY(1)<=5;//开仓时间控制

KT=0&&BKA&&SKA&&SPA,BPK;

KT=0&&SKA&&BKA&&BPA,SPK;

KT=0&&BKA&&SPA,BPK;

KT=0&&SKA&&BPA,SPK;

KT=0&&BKA&&SKA,BPK;

KT=0&&SKA&&BKA,SPK;

KT=0&&BKA,BPK;

SPA,SP;

KT=0&&SKA,SPK;

BPA,BP;

KT,SP;

KT,BP;

SETSIGPRICETYPE(BPK,LIMIT_ORDER);

SETSIGPRICETYPE(SPK,LIMIT_ORDER);

SETSIGPRICETYPE(BK,LIMIT_ORDER);

SETSIGPRICETYPE(SK,LIMIT_ORDER);

SETSIGPRICETYPE(BP,LIMIT_ORDER);

SETSIGPRICETYPE(SP,LIMIT_ORDER);

AUTOFILTER;

TRADE_OTHER('AUTO');

标签

量化交易
评论
  • 可以去买PLUS课 学Sql和平台数据使用逻辑,然后根据这些公式的计算逻辑自己在Bq计算。
{link}