Skip to content

Studies

A Study is a Python DataClass and is used to group such, name, description, cores, ta, et al. Studies simplify both custom and bulk (multi)processing analysis.



Builtin Studies#

Pandas TA has two builtin studies: "All" and "Common".

"ALL"#

1
2
3
import pandas_ta as ta

print(ta.AllStudy)

"Common"#

1
2
3
import pandas_ta as ta

print(ta.CommonStudy)


NOTICE

Thanks to all those that have sponsored and dontated to the library in the past! Your support has been greatly appreciated! 🙏

However, future releases are on definite hold until 100+ donations of $150+ have been received via Buy Me a Coffee.

Help keep this library and application the best in it's class!




The DataClass#

Study DataClass Class to name and group indicators for processing.

Parameters:

Name Type Description Default
name str

Name.

required
ta list of dicts

i.e [{"kind": "ema", "length", 50}]

list()
cores int

The number cores to use for multiprocessing. Default: cpu_count()

cpu_count()
description str

Description of what the Study. Default: ""

''
created str

DateTime String at creation. Default: Automatically generated.

get_time(to_string=True)

Returns:

Type Description
DataClass

The Study to be processed by df.ta.study()

All or Common Study

Run

# All
df.ta.study(ta.AllStudy, **kwargs)

# Common
df.ta.study(ta.CommonStudy, **kwargs)

Custom Study

Create

DemoStudy = ta.Study(
    name="Demo Study",
    description="Example Study Group",
    cores=0,  # Usually faster than multiprocessing
    ta = [
        {"kind": "sma", "length": 200},
        {"kind": "sma", "close": "volume", "length": 50},
        {"kind": "bbands", "length": 20},
        {"kind": "rsi"},
        {"kind": "macd", "fast": 8, "slow": 21},
        {"kind": "sma", "close": "volume", "length": 20, "prefix": "VOLUME"}
    ]

Run

df.ta.study(DemoStudy, **kwargs)

Note
  • See also the Pandas TA "Study" Examples
  • Case-insensitive "All" is reserved.
Multiprocessing

Not recommended for:

  • Small sets of indicators
  • Indicator chains


"Buy Me A Coffee"

ko-fi