之前老师有专门讲到quant3优化了,可以避免同品种跨周期的数据没对齐的问题。
在开发跨品种套利策略时,经常会遇到跨品种同周期的数据不好对齐,特别容易造成信号闪烁,请问有好的解决思路没有,谢谢。
以下跨品种价差,如何数据对齐,不会闪烁呢?
OpenPrice = Data0.Open*D0 - Data1.Open*D1;
ClosePrice = Data0.Close*D0 - Data1.Close*D1;
If(OpenPrice == InvalidNumeric) Return;
If(ClosePrice == InvalidNumeric) Return;
HH = Max(OpenPrice,ClosePrice);
LL = Min(OpenPrice,ClosePrice);
//PlotKline(OpenPrice,Max(ClosePrice,OpenPrice),Min(ClosePrice,OpenPrice),ClosePrice);