设为首页收藏本站

 找回密码
 注册
查看: 1375|回复: 0
打印 上一主题 下一主题

求助,为什么我写的语句平不了仓呢? [复制链接]

Rank: 1

精华
0
UID
229011
积分
6
帖子
3
主题
3
阅读权限
10
注册时间
2016-3-1
最后登录
2017-9-6
跳转到指定楼层
1#
发表于 2017-9-1 10:57:09 |只看该作者 |倒序浏览
if (Condition1)
        {
                if(A_SellPosition()>0)
                {
                BuyToCover(A_SellPosition(),Q_AskPrice);
                Commentary("QB="+Text(Q_AskPrice));
            Buy(0,Q_AskPrice);
                }
                        Else if(A_SellPosition()==0&&A_BuyPosition()==0)
                Buy(0,Q_AskPrice);
        }
        if (Condition2)
        {
                if(A_BuyPosition()>0)
                {
                Sell(A_BuyPosition(),Q_BidPrice);
                Commentary("QS="+Text(Q_BidPrice));
                SellShort(0,Q_BidPrice);
                }
                Else if(A_SellPosition()==0&&A_BuyPosition()==0)
                SellShort(0,Q_BidPrice);
        }
每次都是开仓执行,就是无法将模拟账户的仓位平掉。
您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-10 11:57

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部