TA-Lib / ta-lib-python

Python wrapper for TA-Lib (http://ta-lib.org/).
http://ta-lib.github.io/ta-lib-python
Other
9.56k stars 1.75k forks source link

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

Open sadboytom889 opened 10 months ago

sadboytom889 commented 10 months ago

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

mrjbq7 commented 10 months ago

What are you trying to do?On Nov 17, 2023, at 11:41 PM, sadboytom889 @.***> wrote: I'm not familiar with C, how should I define "long" or "short" when using it in python?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

sadboytom889 commented 10 months ago

@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 commented 10 months ago

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

mrjbq7 commented 10 months ago

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 commented 10 months ago

Thank you, this is exactly what I need