Rss & SiteMap

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

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

标题:[求助]回撤加仓写法

1楼
akasha3322 发表于:2013/3/21 23:33:24
if holding=0  then begin
   if enterlongcond  then begin
      buy(1,1,market);
      HL:=high;
      cc:=1;
    end
   if entershortcond  then begin
      buyshort(1,1,market);
      HL:=low;
      cc:=-1; 
    end  
    
end  

//中间变量
if cc=-1 and low<HL then begin
   HL:=low;
end

if cc=1 and high>HL then begin
   HL:=high;
end
//加仓
if cc=1 and HL-close>=dayopen*0.01 then begin
   buy(1,1,market);
   cc:=2;
 end
   
if cc=-1 and close-HL>=dayopen*0.01 then begin
   buyshort(1,1,market);
   cc:=-2;
 end   

原意是最高回撤开盘价1%加仓1手,但是结果出来后只有多头会加仓,空头不会加仓,请高手看看到底哪里写错了。
[此贴子已经被作者于2013-3-21 23:33:45编辑过]
2楼
jinzhe 发表于:2013/3/22 9:28:13
平仓语句是没有贴出来还是没写?
3楼
akasha3322 发表于:2013/3/22 9:51:58
if holding<0 and enterlongcond then begin
    sellshort(1,0,thisclose); 
end 
    
if holding>0 and entershortcond then begin
    sell(1,0,thisclose);
end
平仓有写的,很简单应该没问题就没贴上,主条件就是一根均线突破
共3 条记录, 每页显示 10 条, 页签: [1]


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