Skip to content
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

Stochastic RSI is missing #3

Open
augalip opened this issue Dec 7, 2020 · 3 comments
Open

Stochastic RSI is missing #3

augalip opened this issue Dec 7, 2020 · 3 comments

Comments

@augalip
Copy link

augalip commented Dec 7, 2020

Stochastic RSI (https://tulipindicators.org/stochrsi) is missing in .NET wrapper's "tinet.indicators.INDICATORNAME" structure.

@codeplea
Copy link
Member

codeplea commented Dec 7, 2020

Yes, these bindings are a little bit out of date right now. Hopefully I'll have some free time to update soon.

@augalip
Copy link
Author

augalip commented Dec 7, 2020

This is a well structured and flexible library, thank you for open sourcing this and I can add necessary lines in inds.cpp (for stochrsi) but I have tested a method that comes alphabetically after the stochrsi by using Palantir (PLTR) prices and indicator values calculated with Tradingview, and saw that the WillR method's results are quite different from the Tradingview's ones. I wonder if this situation is also related with changed indicator orders (since all indicators have an index value in inds.cpp)?

Below are the values I got from Tradingview including both start (30.09.2020) and end (02.12.2020) dates. Both values are calculated for period = 14 days.

double[] ClosePrices = new double[] { 9.5, 9.46, 9.2, 9.03, 9.9, 10, 10, 9.95, 9.89, 9.47, 9.34, 9.91, 9.71, 9.57, 9.27, 9.2, 9.68, 9.49, 9.95, 10.95, 10.85, 10.75, 10.13, 10.54, 10.5, 10.72, 11.88, 13.83, 14.67, 14, 15.96, 14.58, 15.8, 15.93, 17.85, 17.9, 18.98, 18.15, 21.04, 23.82, 29.05, 27.66, 27.11, 25.67, 22.51 };
double[] LowPrices = new double[] { 9.11, 9.23, 8.64, 8.92, 8.9, 9.99, 9.99, 9.89, 9.66, 9.41, 9.29, 9.18, 9.66, 9.53, 9.27, 9.2, 9.22, 9.47, 9.6, 9.92, 10.1, 10.56, 9.85, 10.23, 10.44, 10.55, 10.85, 12.05, 14.11, 13.18, 14.4, 14.41, 14.49, 15.01, 16.18, 17.54, 17.96, 18, 18.57, 20.63, 23.69, 26.12, 24.11, 24.45, 21.15 };
double[] HighPrices = new double[] { 11.42, 10.1, 9.28, 9.49, 10.18, 10.49, 10.4, 10.19, 10.05, 9.88, 9.66, 9.91, 9.95, 9.82, 9.66, 9.48, 9.75, 9.83, 9.97, 11.04, 10.99, 11.1, 10.68, 10.57, 10.94, 10.92, 12.13, 14.96, 15.9, 15.01, 15.97, 17.06, 16, 16.1, 18.75, 19.25, 18.98, 19.66, 21.45, 24.27, 29.75, 33.5, 30.15, 24.14, 23.4 };

And below is the Tradingview's result array:

double[] Expected = new double[] { -73.41, -76.73, -81.13, -50.94, -62.89, -41.22, -4.84, -10.22, -18.23, -50.52, -29.17, -31.25, -20, -8.53, -19.62, -18.36, -28.44, -0.15, -33.24, -17.48, -15.67, -10.11, -14.36, -2.99, -16.38, -3.76, -3.35, -3.95, -28.74, -31.45, -40.99, -57.57 };

However the calculated results (copied from the Console Application generated as advised) are:

WillR Output:
-66,54676258992805
-65,945945945946
-69,7297297297298
-50,943396226415125
-62,8930817610063
-41,22137404580158
-4,838709677419349
-10,215053763440837
-18,22916666666665
-50,52083333333328
-29,166666666666696
-31,249999999999982
-19,999999999999943
-8,53242320819112
-19,618055555555564
-18,358208955223883
-28,4431137724551
-0,15384615384615058
-33,243967828418214
-17,47572815533978
-15,67267683772537
-10,11235955056178
-14,361702127659589
-2,99334811529933
-16,3774403470716
-3,7614678899082583
-3,3532041728762985
-3,9548022598870016
-28,74015748031496
-31,446850393700785
-40,99476439790575
-57,56940806705081

@codeplea
Copy link
Member

codeplea commented Dec 7, 2020

To update you'll want to compile tiamalgamation.c from the C repo of Tulip Indicators. Then copy it to the external folder and run external/rework.tcl to create inds.cpp. Changing inds.cpp manually is probably asking for trouble. The issue is that to work with .net core, this is more of an automated rewrite of the C code instead of a wrapper. It's messy, but it works.

If you want to only add one or two functions, you might simply try adding them to a separate file and calling them directly without all the indexing and what not.

If your needs are of a business nature, and you have a budget for this project, drop me an email and I can get you up and running. I've done a lot of new features and indicators with this sponsorship model in the past. Otherwise, I can only afford work on this in my free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants