Changing Indicator Parameters During Update()

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Changing Indicator Parameters During Update()

Postby mhodgson23 » Tue Jan 24, 2017 12:20 am

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.
Posts: 3
Joined: Tue Jan 24, 2017 12:15 am

Return to Discussions

Who is online

Users browsing this forum: No registered users and 1 guest