- 精华
- 0
- 在线时间
- 33 小时
- UID
- 275970
- 积分
- 66
- 帖子
- 23
- 阅读权限
- 30
- 注册时间
- 2019-2-24
- 最后登录
- 2021-5-24
- 精华
- 0
- UID
- 275970
- 积分
- 66
- 帖子
- 23
- 主题
- 13
- 阅读权限
- 30
- 注册时间
- 2019-2-24
- 最后登录
- 2021-5-24
|
回测螺纹钢5分钟,从2010--2018年,㫫示年化收益率为400%以上,肯定不可能,但就是找不到问题点,
求帮忙,哪位大神帮忙看看程序有什问题?谢谢!
Params
Numeric K1(0.7);
Numeric K2(0.15);
Numeric Mday(1);
Numeric Nday(1);
Numeric lost(1);
Numeric offset(0);
Vars
Numeric BuyRange(0);
Numeric SellRange(0);
Numeric BuyTrig (0);
Numeric SellTrig(0);
Numeric HH;
Numeric LL;
Numeric HC;
Numeric LC;
Numeric i_offset;
Numeric BuyPosition;
Numeric SellPosition;
Begin
// 集合竞价和小节休息过滤
If(!CallAuctionFilter()) Return;
If(CurrentBar > 44*Max(Mday,Nday))
{
i_offset = offset*MinMove*PriceScale;
HH = Highest(HighD(1),Mday);
HC = Highest(CloseD(1),Mday);
LL = Lowest(LowD(1),Mday);
LC = Lowest(CloseD(1),Mday);
If ( ( HH - LC ) >= ( HC - LL ))
{
SellRange = HH - LC;
} Else
{
SellRange = HC - LL;
}
HH = Highest(HighD(1),Nday);
HC = Highest(CloseD(1),Nday);
LL = Lowest(LowD(1),Nday);
LC = Lowest(CloseD(1),Nday);
If ( ( HH - LC ) >= ( HC - LL ))
{
BuyRange = HH - LC;
} Else
{
BuyRange = HC - LL;
}
BuyTrig = K1*BuyRange;
SellTrig = K2*SellRange;
BuyPosition = OpenD(0)+ BuyTrig;
SellPosition = OpenD(0)- SellTrig;
PlotNumeric("BuyPosition",BuyPosition);
PlotNumeric("SellPosition",SellPosition);
If( High >= BuyPosition)
{
Buy(lost,Max(Open,SellPosition)+i_offset); // Buy(lost,Max(Open,SellPosition)+i_offset);[1]
Return;
}
If( Low <= SellPosition )
{
SellShort(lost,Min(Open,SellPosition)-i_offset); //SellShort(lost,Min(Open,SellPosition)-i_offset);[1]
Return;
}
}
End
|
附件: 你需要登录才可以下载或查看附件。没有帐号?注册
|