Rss & SiteMap

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

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

标题:求助

1楼
cpgly 发表于:2011/4/5 13:30:14

if holding=0 then begin
 if h>hh and aa>0 then
  buy(1,30%,limit,thisclose),tfilter;
  end
if holding=0 then begin
  if l<ll and aa<0 then
  buyshort(1,30%,limit ,thisclose),tfilter;
  end
 if holding>0 then begin
    if l<ll then
    sell(1,holding,limit ,thisclose),tfilter;
    end
  if holding<0 then begin
   if h>hh then
   sellshort(1,holding,limit,thisclose),tfilter;
   end
end

这样写有错吗,但是怎么显示的信号跟我想的不一样,我写的是创N日新高新低的信号,结果不是,测试结果也跟简单图标交易的差很多

[此贴子已经被作者于2011-4-5 13:32:47编辑过]
2楼
阿火 发表于:2011/4/5 16:48:11

hh:=ref(hhv(h,20),1);

ll:=ref(llv(l,20),1);

buycond:=c>hh;

sellcond:=c<ll;

if buycond then begin

  sellshort(holding<0,1,thisclose);//创新高时,如果有空单则买入平仓

  buy(holding=0,1,thisclose);//创新高时,如果没有持仓则买入开仓

end

 

if sellcond then begin

  sell(holding>0,1,thisclose);//创新低时,如果有多单则卖出平仓

  buyshort(holding=0,1,thisclose);//创新低时,如果没有持仓则卖出开仓

end

 

 

请参看以上模板编写

3楼
cpgly 发表于:2011/4/5 17:35:29
longcon:=h>hh and aa>0;
shortcon:=l<ll and aa<0;
if h>hh then
sellshort(holding<0,holding,thisclose);
if longcon then
buy(1,30%,thisclose);
if l<ll then
sell(holding>0 ,holding,thisclose);
if shortcon then
buyshort(1,30%,thisclose);
 我这样写可以吧,但是图表怎么没有箭头之类的指示呢?
4楼
阿火 发表于:2011/4/5 18:59:40

1,把变量调试出来看看是否成立

2,如果变量成立却没有信号,请查看一下费率设置的问题

3,把资金量调大

共4 条记录, 每页显示 10 条, 页签: [1]


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