- 精华
- 0
- 在线时间
- 5 小时
- UID
- 229011
- 积分
- 6
- 帖子
- 3
- 阅读权限
- 10
- 注册时间
- 2016-3-1
- 最后登录
- 2017-9-6
- 精华
- 0
- UID
- 229011
- 积分
- 6
- 帖子
- 3
- 主题
- 3
- 阅读权限
- 10
- 注册时间
- 2016-3-1
- 最后登录
- 2017-9-6
|
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);
}
每次都是开仓执行,就是无法将模拟账户的仓位平掉。 |
|