Hi Dan,
Thanks for your great explaination!
But truely to say I find the smooth one ist more reallity than the zick-zack one. I use many other chart tolls and they all show the smooth one.
How to can I get the smooth one in algo?
I find out, the longer I set in hist = data.history(context.spy, 'close', context.ma_length + 40, '1d'), the smoother it will be. But the question is: If the underlying is emited on 2010.01.01 for example and I do the backtesting from 2010.02.01, I can get so many historical datas and there for the WMA will be wrong, right?
Besides, even I use the very long back datas in the hist(), the WMA looks still have some small zick-zack on Dec.19, Sep.19, June 19 etc.(see attached backtesting below). You wrote in your notebook:
...
The notebook used SPY pricing which was adjusted as of the end_date. The algo used data which was adjusted as of each simulation day (similar to pipeline data).
...
Is it possible to make the pricing in algo adjusted as of the end_date?
Thomas