这两句代码是做什么用的,为什么你会觉得重复没意义
是的,不定义也是0。如果你没有其他的赋值动作,只有这一句判断,也是可以不用写赋值。
如果有其他赋值之类的,就要写,这样可以重新赋值为0
if duo and extgbdata(stklabel+'bn1')=0 then begin tbuy(1,手数,mkt); extgbdataset(stklabel+'bn1',1); extgbdataset(stklabel+'bn15',手数); extgbdataset(stklabel+'bdcs',1); end if l<=tENTERPRICE-z*s and tENTERBARS>0 and extgbdata(stklabel+'bn1')=1 and extgbdata(stklabel+'bdcs')=1 and extgbdata(stklabel+'bn15')<>0 then begin tsell(1,extgbdata(stklabel+'bn15'),mkt); extgbdataset(stklabel+'bn1',0); extgbdataset(stklabel+'bn15',0); extgbdataset(stklabel+'bdcs',0); 开仓后赋值(stklabel+'bdcs')=1,extgbdata(stklabel+'bdcs')=1的情况下才允许有平仓动作。 |