Board logo

标题: [TS源码] Simple length adjusting weighted moving average [打印本页]

作者: 龙听    时间: 2020-11-28 07:47     标题: Simple length adjusting weighted moving average

本帖隐藏的内容需要回复才可以浏览

作者: 龙听    时间: 2020-11-28 07:47

You can see that another variable has been added which is a weighted moving average and the trick here is to replace the usual field of length with the algorithm monitor which is adjusting the length applied.

Code tricks to try

If you plot a 20 period weighted average next to it on the subgraph one. You can see how the code above length changing average is slower at some period and faster in other periods.

The above indicator is place in subgraph no1 overlayed with the price. Example code no4 is placed in sub 2.

You can observe the length changing algorithm in action and see how it affects the speed of the weighted average.




欢迎光临 龙听期货论坛 (http://qhlt.club/) Powered by Discuz! 7.2