mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-09-11 12:30:30 +08:00
MAINT minor refactoring ENH sample json strategy
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "Sample JSON Strategy",
|
||||
"description": "Sample JSON Strategy",
|
||||
"ta": [
|
||||
{"kind": "ema", "length": 8, "sma": true},
|
||||
{"kind": "ema", "length": 21, "talib": true},
|
||||
{"kind": "sma", "length": 50, "talib": true},
|
||||
{"kind": "sma", "length": 200, "talib": true},
|
||||
{"kind": "sma", "close": "volume", "length": 20, "talib": true},
|
||||
{"kind": "rsi", "talib": true},
|
||||
{"kind": "obv"}
|
||||
]
|
||||
}
|
||||
@@ -23,7 +23,16 @@ ALL_PATTERNS = [
|
||||
]
|
||||
|
||||
|
||||
def cdl_pattern(open_, high, low, close, name: Union[str, Sequence[str]]="all", scalar=None, offset=None, **kwargs) -> DataFrame:
|
||||
def cdl_pattern(
|
||||
open_,
|
||||
high,
|
||||
low,
|
||||
close,
|
||||
name: Union[str, Sequence[str]]="all",
|
||||
scalar=None,
|
||||
offset=None,
|
||||
**kwargs
|
||||
) -> DataFrame:
|
||||
"""TA Lib Candle Patterns
|
||||
|
||||
A wrapper around all TA Lib's candle patterns.
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ class Strategy:
|
||||
name: str # = None # Required.
|
||||
ta: List = field(default_factory=list) # Required.
|
||||
# Helpful. More descriptive version or notes or w/e.
|
||||
description: str = "TA Description"
|
||||
description: str = ""
|
||||
# Optional. Gets Exchange Time and Local Time execution time
|
||||
created: str = get_time(to_string=True)
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@ def inv_norm(value: Tuple[float, int]) -> Tuple[float, None]:
|
||||
If the user has package "statsmodels" installed, the method will call and
|
||||
return norm().ppf(value)
|
||||
|
||||
|
||||
Source: https://github.com/scipy/scipy/blob/701ffcc8a6f04509d115aac5e5681c538b5265a2/scipy/special/cephes/ndtri.c
|
||||
"""
|
||||
|
||||
|
||||
@@ -97,8 +97,8 @@ def total_time(df: DataFrame, tf: str = "years") -> float:
|
||||
|
||||
|
||||
def to_utc(df: DataFrame) -> DataFrame:
|
||||
"""Either localizes the DataFrame Index to UTC or it applies
|
||||
tz_convert to set the Index to UTC.
|
||||
"""Either localizes the DataFrame Index to UTC or it applies tz_convert to
|
||||
set the Index to UTC.
|
||||
"""
|
||||
if not df.empty:
|
||||
try:
|
||||
|
||||
@@ -36,8 +36,8 @@ class sample(object):
|
||||
This is a Numpy and stochastics package wrapper Class that easily creates
|
||||
stochastic process realization with or without stochastic noise.
|
||||
|
||||
To get the most out of sample(), install the _stochastic_
|
||||
package: pip install stochastic.
|
||||
To get the most out of sample(), install the 'stochastic' package:
|
||||
$ pip install stochastic
|
||||
|
||||
The following stochastic package noise and processes have been implemented:
|
||||
* Noise[9]: Blue "b", Brownian "br, Fractal Gaussian "fg", Gaussian "g",
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ sample_data = read_csv(
|
||||
)
|
||||
sample_data.set_index(DatetimeIndex(sample_data["date"]), inplace=True, drop=True)
|
||||
sample_data.drop("date", axis=1, inplace=True)
|
||||
sample_data = sample_data[:200]
|
||||
# sample_data = sample_data[:200]
|
||||
|
||||
|
||||
def error_analysis(df, kind, msg, icon=INFO, newline=True):
|
||||
|
||||
Reference in New Issue
Block a user