- 精华
- 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
|
改了一下,还是一样的???
//橡胶指数m30.txt,开平仓均为收盘价
Params
Numeric AddSet(1000);
Vars
NumericSeries MyEntryPrice(0); // 开仓价格
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
|
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|