Rss & SiteMap

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

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

标题:请问IF两个选择叠加为何不出信号

1楼
maxuser2004 发表于:2017/8/9 10:59:24
书写如下:
if A then begin
    if B then 
    buy(1,1,market);
    if C  then begin
    sell(1,holding,market);
    buyshort(1,1,market);
    end
 end

其中B和C是两种相反条件,共用A条件,这样不知道为啥B条件下的开多信号无法产生?
但是,可以产生C条件下的开空信号,但是,B条件下的开多信号就没了。。。
请教版主,谢谢!
2楼
wenarm 发表于:2017/8/9 11:12:18

 应有空头持仓造成的。可以输出holding 确认下

 

if A then begin
    if B then begin
           sellshort(1,holding,market);
           buy(1,1,market);
    end
    if C  then begin
          sell(1,holding,market);
          buyshort(1,1,market);
    end
 end
3楼
maxuser2004 发表于:2017/8/9 11:21:02
还是不行,还是出不来开多信号
4楼
pyd 发表于:2017/8/9 11:29:42

if A then begin
    if B then begin
           sellshort(holding<0,holding,market);
           buy(holding=0,1,market);
    end
    if C  then begin
          sell(holding>0,holding,market);
          buyshort(holding=0,1,market);
    end
 end

没有开多信号就是条件不满足,把条件输出看下

 

 

 

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


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