比如我用的四周,以下公式为模版,需要在哪里作何修改可以达到标题的目的?
Params
Numeric money(100); //开仓市值:单位万元
Numeric length(20); //四周的周期
Numeric hcrate(15); //价格回撤%
Vars
Series<bool> pickCond; //是否满足选股表达式
Series<Numeric> highline;
Series<Numeric> lowline;
Series<Numeric> buylasthigh(0,2); //买持仓价格峰值
Series<Numeric> selllastlow(0,2); //卖持仓价格低谷
//期货换月专用函数
Dic<Array<String>> fRollover("TB_ROLLOVER_v2"); //[期货换月合约,期货换月前价格,期货换月后价格]
Global Integer sendCount(0);
Global Integer fillCount(0);
Plot plt;
Bool IsRollover(true);//是否后复权
Bool IsRolloverRealPrice(true);//是否映射真实价格
//Bool IsAutoSwapPosition(true);//是否自动换仓
Numeric trade_begin_time(93000);
Numeric trade_end_time(143000);
Numeric trade_exit_time(145000);
Numeric trade_end_time1(150000);
Series<Numeric> N3;
Events
OnBar(ArrayRef<Integer> indexs)
{
Integer i = 0;
range[i = 0:datacount-1]
{
//使用IsAllPickCondition()判断当前Bar是否满足选股表达式,
pickCond = IsAllPickCondition();
Numeric TempUnitMoney=Open/rollover*ContractUnit*BigPointValue;
numeric lots=Round(10000*money/TempUnitMoney/baseshares,0)*baseshares;
highline=Highest(High[1],length);
lowline=Lowest(Low[1],length);
if(MarketPosition==1 and Low<=buylasthigh*(1-0.01*hcrate) and buylasthigh>EntryPrice*(1+0.01*6))
{Sell(0,Min(Open,buylasthigh*(1-0.01*hcrate)));Return;}
if(MarketPosition==-1 and High>=selllastlow*(1+0.01*hcrate) and selllastlow<EntryPrice*(1-0.01*6))
{BuyToCover(0,Max(Open,selllastlow*(1+0.01*hcrate)));Return;}
If(MarketPosition<>1 And High>=highline and pickCond[1]) //在开仓的时候确认下是否被选中
Buy(lots,Max(Open,highline));
If(MarketPosition<>-1 And Low<=lowline)
SellShort(lots,Min(Open,lowline));
If(MarketPosition==1)
{
If(BarsSinceEntry==0)
buylasthigh=EntryPrice;
Else
buylasthigh=Max(High,buylasthigh);
}
If(MarketPosition==-1)
{
If(BarsSinceEntry==0)
selllastlow=EntryPrice;
Else
selllastlow=Min(Low,selllastlow);
}
}
}
我知道后复权的解释,我需要解决的问题是后复权数据在回测报告中收益如何除权,现在平台暂时还没办法吗