-
Notifications
You must be signed in to change notification settings - Fork 692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return NaN
for Indicators while within unstableBars?
#947
Comments
Agreed, having this as consistent behavior would be ideal. How do you see us implementing this - just returning Tangentially, we may also want to revisit how |
We should just return |
But when returning NaN the user does not have any change using or inspecting values for indices lower than the unstable bars value. Maybe there are cases where the user wants to use or at least the those values |
Why should the user be allowed to use wrong indicator values? Why would the user even willingly want to use wrong indicator values? It can be dangerous to use wrong indicator values. It should be forbidden by default. I don't know any reasonable use case to use wrong indicator values.
What interest does the user have in observing incorrect indicator values anyway? In fact, I believe that many users do not even know that there are indicators that can initially give wrong indicator values and users mistakenly classify them as correct. So it must be prevented to return wrong indicator values. I don't see any benefit in using or observing wrong indicator values. Or am I missing a benefit? |
Users should never be presented with values during warm-up period as it does not provide any value to user and only creates confusion and bad decisions. |
There should not be a wrapper around any indicator to for the purpose of excluding/suppressing data during warm-up period. This should be done by default by every indicator. Any major trading system and other technical analysis systems automatically suppress the warm up data. |
@hhashim1 are you able/willing to take this on and create a PR? |
@so following @nimo23 and @hhashim1 we should return NaN during warm up period? This sounds easy and logical for Indicators like EMAIndicator with a
Indicators like @hhashim1 how does "any major trading system and other technical analysis systems" handle this? I bet there are different handlings of this issue |
Well, we can have indictors like
That's why it is difficult for one person to decide the unstableBars for ALL indicators. #944 was intended as an initial solution (in which a professional who knows the respective indicator better will improve the |
Take a look at the attached file which is the |
Maybe we have to distinguish?
Adding this to the system would produce a lot of checking for open bugs that may be related to not having unstable/warum-up period |
If the user wants to set a custom unstablePeriod, then the user can set
Correct, and I think, this is the correct way to handle it: It propagates different
Yes, but I think these checkings are necessary, because how else can we ensure that the indicator values only return correct values? |
You're right simply propagating NaNs up is problematic because of this. Something to noodle on. |
Besides
Strategy#unstableBars
, we now also haveIndicator#getUnstableBars
(according to #919).As @team172011 suggested:
I think, this is a good idea. I would also suggest to return
NaN
whenever it is not possible to calculate the correct value of an indicator.Any suggestions or objections on this topic?
Related issues:
The text was updated successfully, but these errors were encountered: