设为首页收藏本站

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

同时持有多空仓是什么情况 [复制链接]

Rank: 1

精华
0
UID
1636024
积分
9
帖子
5
主题
4
阅读权限
10
注册时间
2021-9-23
最后登录
2022-2-24
跳转到指定楼层
1#
发表于 2021-9-30 11:12:34 |只看该作者 |倒序浏览
代码如下,同时持有了多仓和空仓,请各位指教
//开仓
        If(MarketPosition==0)
        {
                If(conditon4 And conditon1)//做多
                {
                        Buy(TurtleUnits,Cl_FxHigh);
                }
                Else If (conditon1)//做多
                {
                        Buy(TurtleUnits,Ma[1]);
                }
                Else If(conditon2 And conditon3)
                {
                        SellShort(TurtleUnits,Cl_FxLow);
                }
                Else If(conditon2)
                {
                        SellShort(TurtleUnits,Ma[1]);
                }
        }
        Else If(MarketPosition==-1 )//空单出场
        {
                If(conditon4 Or conditon5)
                {
                        BuyToCover(TurtleUnits,Open);
                }
        }
        Else If(MarketPosition==1)//多单出场
        {
                If(conditon3 Or conditon6)
                {
                        Sell(TurtleUnits,Open);
                }
        }
您需要登录后才可以回帖 登录 | 注册

bottom

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

GMT+8, 2024-4-24 03:38

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部