用tbuyholdingex和tsellholdingex这两个函数来查看持仓
if 开仓条件 and (tholding=0 or tsellholdingex=1) then begin
tbuy (1,shou,lmt,d1,0,'','品种');
end
if 开仓条件 and (tholding=0 or tbuyholdingex=1) then begin
tbuyshort (1,shou,lmt,d2,0,'','品种');
end
是这样写吗?
tbuyholdingex('账号','合约品种',0)
求指定账号下指定合约的多头持仓,套利下单获取持仓用这个函数很方便的,只要改下合约品种代码就行
比如股指连续就是'if00',股指12就是'if12',两个单引号不能省略
TSELLHOLDING同理
if 开仓条件 and (tholding=0 or tsellholdingex('','品种',1)=1) then begin
tbuy(1,shou,lmt,d1,0,'','品种');
end
现在又有个问题,我这样表达了,只要达到开仓条件,会一直开仓,需要怎么修改?