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

Is it possible to modify the definitions of "BodyLong", "BodyShort", etc. in python? #624

Open
sadboytom889 opened this issue Nov 18, 2023 · 5 comments

Comments

@sadboytom889
Copy link

I'm not familiar with C, how should I define "long" or "short" when using it in python?

@mrjbq7
Copy link
Collaborator

mrjbq7 commented Nov 18, 2023 via email

@sadboytom889
Copy link
Author

@mrjbq7
example:
/real body is long when it is longer than twice the average of the real bodies of the previous 10 candles/
{ TA_BodyLong, TA_RangeType_RealBody, 10, 2.0 },
How to implement such a setting in python?

@mrjbq7
Copy link
Collaborator

mrjbq7 commented Nov 20, 2023

Do you have an example in C that is what you're hoping to have work?

@mrjbq7
Copy link
Collaborator

mrjbq7 commented Nov 20, 2023

I assume what you're looking for is TA_SetCandleSettings...

And this is how you'd do it in python:

import talib._ta_lib

talib._ta_lib._ta_set_candle_settings(settingtype, rangetype, avgperiod, factor)

@sadboytom889
Copy link
Author

Thank you, this is exactly what I need

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