- 精华
- 0
- 在线时间
- 87 小时
- UID
- 100877
- 积分
- 180
- 帖子
- 66
- 阅读权限
- 40
- 注册时间
- 2012-2-27
- 最后登录
- 2020-3-26
- 精华
- 0
- UID
- 100877
- 积分
- 180
- 帖子
- 66
- 主题
- 14
- 阅读权限
- 40
- 注册时间
- 2012-2-27
- 最后登录
- 2020-3-26
|
//橡胶指数30分钟,开平仓均为收盘价,为什么加仓会成立
//比如MyEntryPrice=26000,MyEntryPrice > (Close+AddSet)应该不会成立
Params
Numeric AddSet(10000);
Vars
NumericSeries MyEntryPrice; // 开仓价格
Bool kccon1;
Bool kccon2;
Begin
kccon1=(Close>Close[1] && close[1]>close[2] && close[2]>Close[3]);
kccon2=(Close<Close[1] && close[1]<close[2] && close[2]<Close[3]);
If(MarketPosition!=1 && kccon1)
{
MyEntryPrice=Close;
Buy(1,MyEntryPrice);
Return;
}
If(MarketPosition!=-1 && kccon2)
{
MyEntryPrice=Close;
SellShort(1,MyEntryPrice);
Return;
}
//加仓
If(MarketPosition == 1 && CurrentEntries < 3)
{If(MyEntryPrice > (Close+AddSet))
{
Buy(1,Close);
Return;
}
} Else If(MarketPosition == -1 && CurrentEntries < 3)
{
If( MyEntryPrice < (Close-AddSet))
{
SellShort(1,Close);
Return;
}
}
PlotNumeric("MyEntryPrice",MyEntryPrice);
End |
|