-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
Request to Add Envelope Indicator #228
Comments
Thank you very much for the feature request! It definitely sounds like a
good one to add. I will read more and implement it. I will very much
appreciate if I can use your help to review and test it.
…On Tue, Oct 8, 2024, 9:57 PM 超级大黄蜂 ***@***.***> wrote:
Hello,
I am a user of the github.com/cinar/indicator package and I greatly
appreciate the work you've done so far. I would like to request the
addition of a new indicator, the Envelope Indicator.
The Envelope Indicator is a technical analysis tool that consists of two
moving averages—one shifted upward and one shifted downward by a fixed
percentage. It is used to identify overbought and oversold conditions as
well as to signal potential trend reversals.
I believe adding this indicator would be a valuable enhancement to the
package.
Thank you for considering my request!
Best regards,
—
Reply to this email directly, view it on GitHub
<#228>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANMH3FQHTHUHSLEJCT25FTZ2SZUZAVCNFSM6AAAAABPTU7UZ2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGU3TINZWGE3DQMQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Preliminary Implementation of Envelope Indicator
|
Excellent, this is great, let me move it to a branch quickly. We can also abstract out the SMA and EMA piece using the Ma interface. I'll make some quick modifications and share it with you. |
I did some modifications and put the Envelope indicator to a new branch: https://github.com/cinar/indicator/tree/issue-228 I also added tests for both SMA and EMA based Envelope also. By the way, what strategy we can develop based on this? Something like sell when above upper, and buy when below lower? |
Thank you for the update! I’m currently at work and a bit busy, so I will need some time before I can review whether it's working as expected. I’ll take a look as soon as I can and get back to you. |
"Something like sell when above upper, and buy when below lower?"You're absolutely right. At the moment, my approach is to be cautious of risk when the price is above the upper band and to consider opportunities when it's below the lower band. |
After testing, I found the results to be as expected. Would it be possible to add an option to create an Envelope instance based on a custom percentage? Of course, I can also achieve this by assigning values to variables myself. |
Absolutely, I've simplified things. There are two approaches: You can begin by using the SMA and EMA convenience constructor functions: envelope := trend.NewEnvelopeWithEma[float64]()
envelope.Percentage = 40 If you want to control both the period and the percentage, you can also do this: envelope := trend.NewEnvelope(
trend.NewSmaWithPeriod[float64](10),
40,
) Please let me know if this will work for your use case? |
Thank you for the clarification and for simplifying the approach. Both methods seem very practical. I’ve already implemented one of them in my program, and it works great! |
# Describe Request Envelope trend indicator and Envelope strategy are added. Fixed #228 # Change Type New feature. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a new `Envelope` indicator and multiple new strategies, enhancing the library's capabilities. - Added dedicated test data in CSV format for better validation of indicators and strategies. - **Documentation** - Added detailed documentation for the new `Envelope` type and its methods. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
You're welcome! I'm glad you find this module helpful. If you have any suggestions for improvements, please let me know. I've recently added the EnvelopeStrategy and merged the branch. A new release will be available soon. |
Hello,
I am a user of the github.com/cinar/indicator package and I greatly appreciate the work you've done so far. I would like to request the addition of a new indicator, the Envelope Indicator.
The Envelope Indicator is a technical analysis tool that consists of two moving averages—one shifted upward and one shifted downward by a fixed percentage. It is used to identify overbought and oversold conditions as well as to signal potential trend reversals.
I believe adding this indicator would be a valuable enhancement to the package.
Thank you for considering my request!
Best regards,
The text was updated successfully, but these errors were encountered: