Rss & SiteMap

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

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

标题:平多信号还是没有及时执行

1楼
FJ6008 发表于:2014/11/27 9:52:52

图片点击可在新窗口打开查看此主题相关图片如下:未命名.jpg
图片点击可在新窗口打开查看
2楼
jinzhe 发表于:2014/11/27 9:55:15
你指的箭头那里没有信号,所以不会有什么信号执行
3楼
FJ6008 发表于:2014/11/27 9:57:00

还是老问题:平多盈利执行不及时,盈利全部吃光:程序源码

//开多
IF ( stopprice)<l THEN
BEGIN
SELLSHORT( HOLDING<0,HOLDING,market); //平空操作
BUY( HOLDING=0,1,market);//开多操作 
maxprofit:=0;
END
//平仓
SELL((stopprice)>h and  HOLDING>0,HOLDING,market);//平多
BUYSHORT((stopprice)>h and HOLDING=0,1,market); //开空操作

if enterbars>=3 then begin
     if c>o and holding>0 then sell(1,holding,market);
     if c<o  and type(1)= 2 then buy(holding>=0,1,market);
  end

//空头为例
  if enterbars>=3 then begin
     if c>o and holding<0 then sellshort(1,holding,market);
     if c<o and type(1)=4 then buyshort(holding<=0,1,market);
  end


 

4楼
jinzhe 发表于:2014/11/27 10:00:22

那根k线是阴线,怎么会出信号的?

5楼
FJ6008 发表于:2014/11/27 10:01:14

 


图片点击可在新窗口打开查看此主题相关图片如下:未命名.jpg
图片点击可在新窗口打开查看
6楼
jinzhe 发表于:2014/11/27 10:06:45

那在这里一次性理清思路,你要的开仓后3根k线之外还是之内满足条件后平仓?

开仓后3根k线之外是原来的代码

 

开仓后3根k线之内是下面的代码

if enterbars<=3 then begin
     if c>o and holding>0 then sell(1,holding,market);
     if c<o  and type(1)= 2 then buy(holding>=0,1,market);
  end

//空头为例
  if enterbars<=3 then begin
     if c>o and holding<0 then sellshort(1,holding,market);
     if c<o and type(1)=4 then buyshort(holding<=0,1,market);
  end

7楼
FJ6008 发表于:2014/11/27 10:08:04
如何修改一下,是不可以:开仓成立第三根K线新高加收阴平仓就可以了,
8楼
jinzhe 发表于:2014/11/27 10:17:37
那么到底3根k线之内还是之外啊?这么长时间你又出了问题是这个没搞清楚
9楼
FJ6008 发表于:2014/11/27 10:26:07
谢谢,我使用2根试试,明白了
10楼
FJ6008 发表于:2014/11/27 10:26:49
只要好用就行,就看几根最好,谢谢
共11 条记录, 每页显示 10 条, 页签: [1] [2]


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