等级: 免费版
- 注册:
- 2021-7-30
- 曾用名:
|

楼主 |
发表于 2022-12-27 08:55
|
显示全部楼层
谢谢老师。后台程序化,调用X1篮子交易,代码如下。发现成交数量不对,既不是SS,也不是篮子里设定的。请问如何设定?先谢谢了。
ss:=intpart(20000/(c*multiplier*taccount(41)));
a10:=jdma20>0.62 and jdupper>0 and jdma5>0 ;
a11:=jdma2015f>2.4 and jdupper15f>4.2 and jdma515f>4.2 and abs((ma515-ma2015)/ma2015)*100<=0.62 ;
a20:=a10 and a11;
A21:=jdma515f<=0;
a22:=c<ref(l,tenterbars+1) and l<ma20;
tbuy(a20 and tbuyholding(1)=0 ,ss ,mkt,0,0,'','x1');
if c<tenterprice then tsell(a22 ,tbuyholding(1) ,mkt,0,0,'','x1');
if c<tenterprice then tsell(a21 ,tbuyholding(1) ,mkt,0,0,'','x1');
if c>tenterprice then tsell(a21 ,tbuyholding(1) ,mkt,0,0,'','x1');
b10:=jdma20<-0.62 and jdlower<-0 and jdma5<-0 ;
b11:=jdma2015f<-2.4 and jdlower15f<-4.2 and jdma515f<-4.2 and abs((ma515-ma2015)/ma2015)*100<=0.62 ;
b20:=b10 and b11;
B21:=jdma515f>=0;
b22:=c>ref(h,tenterbars+1) and h>ma20;
tbuyshort(b20 and tsellholding(1)=0 ,ss ,mkt,0,0,'','x1');
if c>tenterprice then tsellshort(b22 ,tsellholding(1) ,mkt,0,0,'','x1');
if c>tenterprice then tsellshort(b21 ,tsellholding(1) ,mkt,0,0,'','x1');
if c<tenterprice then tsellshort(b21 ,tsellholding(1) ,mkt,0,0,'','x1');
|
|