Rss & SiteMap
金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/
要用一个全局变量来记录一下开平仓的状态:
if 开仓条件 and extgbdata(stklabel)=0 then begin
tbuy(1,100,mkt);
extgbdataset(stklabel,1);
end
这段代码是用来标记开仓股票的,要添加的部分已经标粗了。
if time=closetime(0) then extgbdataset(stklabel,0);
这段代码你写在指标最后,用来重置全局变量的