等级: 专业版
- 注册:
- 2022-1-11
- 曾用名:
|
如题:后台,加载的非主力合约的版块,依照非主力合约发出的条件发出交易指令,如下语句正确吗?
MA3:=MA(CLOSE,3);
MA10:=MA(CLOSE,10);
CMA310:=CROSS(MA3,MA10);
CMA10:3=CROSS(MA10,MA3);TraderSP:=GETINIFILE('C:\MTraderFILE.INI',stkname,'TraderSP');//记载《移仓主力板块》对应品种的交易信号:2开多仓,1平多仓;-2开空仓,-1平空仓;0移仓(归位)。
if CMA310 and TraderSP=0 then begin
Tsellshort(1,0,LMT,C+5*MINDIFF,0,'',''); //成功卖出老的非主力持仓,还未买入对应主力合约手数后,不能为移仓成功!!
WRITEINIFILE('C:\MTraderFILE.INI',stkname,'TraderSP',C+5*MINDIFF); TraderSP:=C+5*MINDIFF;
end
if CMA103 and C>TraderSP+5*MINDIFF and TraderSP>0 then begin
Tbuyshort(1,BHD,LMT,C+5*MINDIFF,0,'',DYNAINFO(210));
WRITEINIFILE('C:\MTraderFILE.INI',stkname,'TraderSP',0);end
补充内容 (2023-5-4 06:32):
Tbuyshort(1,BHD,LMT,C+5*MINDIFF,0,'',DYNAINFO(210));语句里的C是不是对应的是主力合约的C,而不是加载的非主力合约MA10:=MA(CLOSE,10);中的C? |
|