- 精华
- 0
- 在线时间
- 144 小时
- UID
- 264292
- 积分
- 27
- 帖子
- 16
- 阅读权限
- 10
- 注册时间
- 2018-4-10
- 最后登录
- 2020-11-2
- 精华
- 0
- UID
- 264292
- 积分
- 27
- 帖子
- 16
- 主题
- 8
- 阅读权限
- 10
- 注册时间
- 2018-4-10
- 最后登录
- 2020-11-2
|
麻烦各位帮忙看看这段代码为何开多仓后亏50点不止损
If(MarketPosition == 0 And exitdate!=Truedate(0))
{
If(High>= BuyPosition)
{ SellShort(Lots,Max(Open,BuyPosition)+i_offset);
Return;
}
If(Low<= SellPosition)
{ Buy(Lots,Min(Open,SellPosition)-i_offset);
Return;
}
}
If(MarketPosition == -1)
{
If(Low<= SellPosition)
{
Buy(Lots,Min(Open,sellPosition)-i_offset);
Return;}
}
If(MarketPosition == 1)
{
If(High>= BuyPosition )
SellShort(Lots,Max(Open, BuyPosition)+i_offset);
Return;}
}
If(MarketPosition == 1)
{
If( Low<=AvgEntryPrice-50)
Sell(Lots,AvgEntryPrice-50);
}
If(MarketPosition == -1)
{
If(high>=avgentryprice+50)
BuyToCover(Lots,avgentryprice+50);
} |
|