-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
feat: Adding pivot point standard impls #37
Conversation
@amv-dev - can you take a look at this and advise on changes? |
@dandxy89 Hello! Sorry for this looooooong anwer. I was having a lot of busy days... But for now I'd recommend you to make you indicator as a |
No problem @amv-dev. Thats for the feedback - much appreciated. Let me re-familiarise myself with my changes and I'll update the PR over the next coming days. |
Just as an FYI this PR only contains a impl for Traditional.
I can follow up with another PR to implement the remaining variants |
Implements the Traditional calculation
@amv-dev any you chance review this? |
/// | ||
/// * <https://en.wikipedia.org/wiki/Pivot_point_(technical_analysis)> | ||
/// | ||
pub struct PivotPointStandard {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove those curly brackets. It's useless.
Please make this change and I will merge your PR. But I think this feature must be refactored in the future. As I see, there is no internal state. On the other hand there are too many values in the output. So I think the whole feature might be created by traits. Something like pub trait PivotPointStandard: OHLCV {
fn pp(&self) -> ValueType {
(self.high() + self.low() + self.close())/3.0
}
...
}
impl<T: OHLCV> PivotPointStandard for T {} |
Thanks for the feedback. I'll look at the suggestions later this year. |
To implement this I needed to increase
IndicatorResult
result size to12
.Resolves: #36