- 精华
- 0
- 在线时间
- 13 小时
- UID
- 246415
- 积分
- 14
- 帖子
- 10
- 阅读权限
- 10
- 注册时间
- 2017-1-22
- 最后登录
- 2017-9-14
- 精华
- 0
- UID
- 246415
- 积分
- 14
- 帖子
- 10
- 主题
- 4
- 阅读权限
- 10
- 注册时间
- 2017-1-22
- 最后登录
- 2017-9-14
|
//建仓
If(MarketPosition <> 1 && BuyEntry) //满足买入条件建仓
{
Buy(lots,Open);
}
If (MarketPosition <> -1 && SellEntry)
{
SellShort(lots,open);
}
//加仓
//一级加仓 盈利100跳加仓0.6份
If(MarketPosition==1 && BarsSinceLastEntry>0 && CurrentEntries<2 && Close[1]>=LastEntryPrice+s1*Minpoint )
{
Buy(Lots*0.6,open);
Commentary("一级加仓");
}
If(MarketPosition==-1 && BarsSinceLastEntry>0 && CurrentEntries<2 && Close[1]<=LastEntryPrice-s1*Minpoint )
{
SellShort(Lots*0.6,open);
Commentary("一级加仓");
}
//二级加仓 一级加仓后再盈利100跳加仓0.3份
If(MarketPosition==1 && BarsSinceLastEntry>0 && CurrentEntries<3 && close[1]>=LastEntryPrice+s1*Minpoint )
{
Buy(Lots*0.3,open);
Commentary("二级加仓");
}
If(MarketPosition==-1 && BarsSinceLastEntry>0 && CurrentEntries<3 && close[1]<=LastEntryPrice-s1*Minpoint )
{
SellShort(Lots*0.3,open);
Commentary("二级加仓");
}
|
|