ta-lib-python icon indicating copy to clipboard operation
ta-lib-python copied to clipboard

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

Open sadboytom889 opened this issue 2 years ago • 5 comments

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

sadboytom889 avatar Nov 18 '23 07:11 sadboytom889

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: @.***>

mrjbq7 avatar Nov 18 '23 16:11 mrjbq7

@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?

sadboytom889 avatar Nov 20 '23 07:11 sadboytom889

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

mrjbq7 avatar Nov 20 '23 20:11 mrjbq7

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)

mrjbq7 avatar Nov 20 '23 20:11 mrjbq7

Thank you, this is exactly what I need

sadboytom889 avatar Nov 21 '23 06:11 sadboytom889