- 精华
- 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
|
//改了一下,橡胶RU1303,30分钟线,以2月7日为例,开多仓价格26000,价格小于25090时,为什么加仓不成立
Params
Numeric AddSet(10);
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 |
|