Skip to content

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

@sadboytom889

Description

@sadboytom889

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

Activity

mrjbq7

mrjbq7 commented on Nov 18, 2023

@mrjbq7
Member
sadboytom889

sadboytom889 commented on Nov 20, 2023

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

mrjbq7 commented on Nov 20, 2023

@mrjbq7
Member

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

mrjbq7

mrjbq7 commented on Nov 20, 2023

@mrjbq7
Member

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

sadboytom889 commented on Nov 21, 2023

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @mrjbq7@sadboytom889

        Issue actions

          Is it possible to modify the definitions of "BodyLong", "BodyShort", etc. in python? · Issue #624 · TA-Lib/ta-lib-python