Page 1 of 1

Changing Indicator Parameters During Update()

PostPosted: Tue Jan 24, 2017 12:20 am
by mhodgson23
All, I have an idea for a strategy that would potentially require changing an indicators period during run. I am curious the optimal solution here. For this post, let's assume I want to repeatedly change the period of an exponential moving average (ema).

My three ideas so far:
1) Create multiple instances of the ema, one with each possible setting. (Seems like a lot of overhead).
2) Create one instance of the ema and replace it with a new instance each time the period changes. (maybe less memory, but still extensive).
3) Change the period and run instance:updateall() (can this be done?)

Appreciate any thoughts or if there are other ideas, that would be helpful, too.