Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:部分代码,请帮忙看看有无问题

1楼
量化马甲 发表于:2014/7/11 22:09:35
cu1:='cu00';
CUKD:=;
CUPD:=;
CUKK:=;
CUPK:=;
tbuy(CUKD and tbuyholdingex('',cu1,1)<1,10,mkt,0,0,'',cu1);
tbuyshort(CUKK and tsellholdingex('',cu1,1)<1,10,mkt,0,0,'',cu1);
tsell(CUPD and tbuyholdingex('',cu1,1)>0,0,mkt,0,0,'',cu1);
tsellshort(CUPD and tsellholdingex('',cu1,1)>0,0,mkt,0,0,'',cu1);
if (hhv(topenprofit,tenterbars+1)-topenprofit)/hhv(topenprofit,tenterbars+1)>=0.2 and tbuyholdingex('',cu1,1)>0 then begin
tsell(1,tbuyholdingex('',cu1,1),mkt,0,0,'',cu1);
end
if (hhv(topenprofit,tenterbars+1)-topenprofit)/hhv(topenprofit,tenterbars+1)>=0.2 and tsellholdingex('',cu1,1)>0 then begin
tsellshort(1,tsellholdingex('',cu1,1),mkt,0,0,'',cu1);
end
if tavgenterpriceex2('',cu1,0)-c>200*mindiff then begin
tsell(1,tbuyholdingex('',cu1,1),mkt,0,0,'',cu1);
end
if c-tavgenterpriceex2('',cu1,0)>200*mindiff then begin
tsellshort(1,tsellholdingex('',cu1,1),mkt,0,0,'',cu1);
end
WCJ:=tremainqty(0,'',cu1);
if WCJ<>0 then begin
A:=WCJ;
end
if WCJ>0 then begin
tcancelex(1,0,'',cu1);
tbuy(WCJ=0,A,mkt,0,0,'',cu1);
tbuyshort(WCJ=0,A,mkt,0,0,'',cu1);
end
当前持仓量:=tbuyholdingex('',cu1,1)+tsellholdingex('',cu1,1);
当前可用资金:=taccount(19);
debugout('当前持仓量%.2f',当前持仓量 );
debugout('当前可用资金%.2f',当前可用资金 );
2楼
jinzhe 发表于:2014/7/14 8:59:56
你本地编译通过即算作无问题
共2 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.02637 s, 3 queries.