- 精华
- 0
- 在线时间
- 41 小时
- UID
- 1636024
- 积分
- 9
- 帖子
- 5
- 阅读权限
- 10
- 注册时间
- 2021-9-23
- 最后登录
- 2022-2-24
- 精华
- 0
- UID
- 1636024
- 积分
- 9
- 帖子
- 5
- 主题
- 4
- 阅读权限
- 10
- 注册时间
- 2021-9-23
- 最后登录
- 2022-2-24
|
代码如下,同时持有了多仓和空仓,请各位指教
//开仓
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);
}
} |
|