Rss & SiteMap

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

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

标题:[求助]固定轮询跟走完k线模式能否组合使用

1楼
saintlucifer 发表于:2011/9/27 9:24:21

如题,如果我想开仓的时候使用走完k线模式(因为希望趋势确定才进入),但是止损的时候用固定轮询模式(预防单根k线实体较长,导致损失过大),可以实现吗?

2楼
jinzhe 发表于:2011/9/27 9:37:05

现在有个逐K线下模式提前N秒执行的功能

3楼
saintlucifer 发表于:2011/9/27 9:40:40
但是提前n秒没意义啊,止损位置可能是k线一开始就到,也有可能是最后才到,我总不能整根k线时间提前吧,而且我只是希望可以止损的时候才使用这种功能,开仓的时候还是要等一根k线走完的啊
4楼
jinzhe 发表于:2011/9/27 10:00:55

等高人来看看吧。

5楼
阿火 发表于:2011/9/27 11:45:50

很简单的,都采用采用固定轮询模型,写完整点给你:

variable:cc=0,zs=0,hl=c;
ma5:=ma(c,5);
ma10:=ma(c,10);
if holding=0 and cc>0 then buy(1,1,market);

if holding=0 and cc<0 then buyshort(1,1,market);

if cc>0 and l<zs then begin
  cc:=0;
  sell(1,1,market);
end

if cc<0 and h>zs then begin
  cc:=0;
  sellshort(1,1,market);
end


if cc=0 and ma5>ma10 then begin
  cc:=1;
  zs:=c-10;
  hl:=h;
end

if cc=0 and ma5<ma10 then begin
  cc:=-1;
  zs:=c+10;
  hl:=l;
end

if cc>0 and h>hl then begin
 hl:=h;
 zs:=hl-10;
end

if cc<0 and l<hl then begin
 hl:=l;
 zs:=hl+10;
end

[此贴子已经被作者于2011-9-27 22:45:59编辑过]
6楼
saintlucifer 发表于:2011/9/27 21:19:53
以上公式开仓部分在固定轮询的时候不是会提前下单吗?5天线>10天线开仓,但是单根k线内可能会反复啊,不要说那个k线走完信号消失的话取消持仓功能,个人觉得这样是会出现很多其他问题的,我是希望可以公式实现开仓的时候是走完k线再算,止损的时候才是盘中触价止损
7楼
阿火 发表于:2011/9/27 22:50:08
汗,比较无语
8楼
淡定688 发表于:2011/9/27 23:01:34

请问这个固定轮询模式为什么是用market函数?

 if cc>0 and l<zs then begin   //轮询模式
    cc:=0;
    sell(1,1,market);     
 end

 if cc<0 and h>zs then begin   //轮询模式
   cc:=0;
   sellshort(1,1,market); 
 end

9楼
阿火 发表于:2011/9/27 23:46:30
market是市价下单啊,可以自己修改嘛。
10楼
淡定688 发表于:2011/10/2 20:16:43

为什么是这样?

图片点击可在新窗口打开查看

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


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