openbacktesting 0.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- openbacktesting/__init__.py +85 -0
- openbacktesting/aggregation.py +8 -0
- openbacktesting/broker/__init__.py +54 -0
- openbacktesting/broker/commission.py +57 -0
- openbacktesting/broker/core.py +1122 -0
- openbacktesting/broker/execution.py +62 -0
- openbacktesting/broker/instrument.py +106 -0
- openbacktesting/broker/ledger.py +60 -0
- openbacktesting/broker/models.py +236 -0
- openbacktesting/broker/observations.py +99 -0
- openbacktesting/broker/requests.py +192 -0
- openbacktesting/broker/sizing.py +76 -0
- openbacktesting/colors.py +175 -0
- openbacktesting/data/__init__.py +20 -0
- openbacktesting/data/aggregation.py +39 -0
- openbacktesting/data/context.py +30 -0
- openbacktesting/data/core.py +218 -0
- openbacktesting/data/generators.py +54 -0
- openbacktesting/data/strategy_data.py +103 -0
- openbacktesting/data/timeframe.py +69 -0
- openbacktesting/engine.py +34 -0
- openbacktesting/helpers.py +77 -0
- openbacktesting/indicator_api.py +10 -0
- openbacktesting/indicator_methods.py +123 -0
- openbacktesting/indicator_types.py +19 -0
- openbacktesting/indicators/__init__.py +7 -0
- openbacktesting/indicators/api.py +97 -0
- openbacktesting/indicators/calculus.py +75 -0
- openbacktesting/indicators/candles/__init__.py +0 -0
- openbacktesting/indicators/candles/cdl_doji.py +17 -0
- openbacktesting/indicators/candles/cdl_engulfing.py +14 -0
- openbacktesting/indicators/candles/cdl_eveningstar.py +15 -0
- openbacktesting/indicators/candles/cdl_hammer.py +14 -0
- openbacktesting/indicators/candles/cdl_harami.py +14 -0
- openbacktesting/indicators/candles/cdl_inside.py +14 -0
- openbacktesting/indicators/candles/cdl_marubozu.py +14 -0
- openbacktesting/indicators/candles/cdl_morningstar.py +15 -0
- openbacktesting/indicators/candles/cdl_shootingstar.py +14 -0
- openbacktesting/indicators/candles/cdl_z.py +28 -0
- openbacktesting/indicators/candles/ha.py +19 -0
- openbacktesting/indicators/catalog.json +8348 -0
- openbacktesting/indicators/common.py +94 -0
- openbacktesting/indicators/cycles/__init__.py +0 -0
- openbacktesting/indicators/cycles/dsp.py +10 -0
- openbacktesting/indicators/cycles/ebsw.py +10 -0
- openbacktesting/indicators/cycles/ht_dcperiod.py +10 -0
- openbacktesting/indicators/cycles/ht_dcphase.py +10 -0
- openbacktesting/indicators/cycles/ht_phasor.py +17 -0
- openbacktesting/indicators/cycles/ht_sine.py +17 -0
- openbacktesting/indicators/cycles/ht_trendmode.py +10 -0
- openbacktesting/indicators/cycles/msw.py +19 -0
- openbacktesting/indicators/methods.py +5762 -0
- openbacktesting/indicators/momentum/__init__.py +0 -0
- openbacktesting/indicators/momentum/ac.py +9 -0
- openbacktesting/indicators/momentum/ao.py +10 -0
- openbacktesting/indicators/momentum/apo.py +10 -0
- openbacktesting/indicators/momentum/bias.py +10 -0
- openbacktesting/indicators/momentum/bop.py +10 -0
- openbacktesting/indicators/momentum/brar.py +26 -0
- openbacktesting/indicators/momentum/cci.py +10 -0
- openbacktesting/indicators/momentum/cfo.py +10 -0
- openbacktesting/indicators/momentum/cg.py +10 -0
- openbacktesting/indicators/momentum/cmo.py +10 -0
- openbacktesting/indicators/momentum/coppock.py +10 -0
- openbacktesting/indicators/momentum/crsi.py +28 -0
- openbacktesting/indicators/momentum/cti.py +10 -0
- openbacktesting/indicators/momentum/dm.py +17 -0
- openbacktesting/indicators/momentum/er.py +10 -0
- openbacktesting/indicators/momentum/eri.py +17 -0
- openbacktesting/indicators/momentum/fisher.py +17 -0
- openbacktesting/indicators/momentum/fosc.py +10 -0
- openbacktesting/indicators/momentum/gator.py +13 -0
- openbacktesting/indicators/momentum/ibs.py +7 -0
- openbacktesting/indicators/momentum/inertia.py +22 -0
- openbacktesting/indicators/momentum/kdj.py +18 -0
- openbacktesting/indicators/momentum/kst.py +30 -0
- openbacktesting/indicators/momentum/lrsi.py +10 -0
- openbacktesting/indicators/momentum/macd.py +27 -0
- openbacktesting/indicators/momentum/macdext.py +27 -0
- openbacktesting/indicators/momentum/macdfix.py +18 -0
- openbacktesting/indicators/momentum/mom.py +10 -0
- openbacktesting/indicators/momentum/pgo.py +10 -0
- openbacktesting/indicators/momentum/pmo.py +13 -0
- openbacktesting/indicators/momentum/po.py +10 -0
- openbacktesting/indicators/momentum/ppo.py +20 -0
- openbacktesting/indicators/momentum/psl.py +12 -0
- openbacktesting/indicators/momentum/pvo.py +20 -0
- openbacktesting/indicators/momentum/qqe.py +31 -0
- openbacktesting/indicators/momentum/rci.py +20 -0
- openbacktesting/indicators/momentum/rmi.py +7 -0
- openbacktesting/indicators/momentum/roc.py +10 -0
- openbacktesting/indicators/momentum/rocp.py +10 -0
- openbacktesting/indicators/momentum/rocr.py +10 -0
- openbacktesting/indicators/momentum/rocr100.py +10 -0
- openbacktesting/indicators/momentum/rsi.py +10 -0
- openbacktesting/indicators/momentum/rsx.py +10 -0
- openbacktesting/indicators/momentum/rvgi.py +26 -0
- openbacktesting/indicators/momentum/slope.py +17 -0
- openbacktesting/indicators/momentum/smc_sweep.py +18 -0
- openbacktesting/indicators/momentum/smi.py +21 -0
- openbacktesting/indicators/momentum/smi_stochastic.py +15 -0
- openbacktesting/indicators/momentum/squeeze.py +47 -0
- openbacktesting/indicators/momentum/squeeze_pro.py +53 -0
- openbacktesting/indicators/momentum/stc.py +20 -0
- openbacktesting/indicators/momentum/stoch.py +19 -0
- openbacktesting/indicators/momentum/stochf.py +19 -0
- openbacktesting/indicators/momentum/stochrsi.py +19 -0
- openbacktesting/indicators/momentum/td_seq.py +17 -0
- openbacktesting/indicators/momentum/trix.py +19 -0
- openbacktesting/indicators/momentum/trixh.py +20 -0
- openbacktesting/indicators/momentum/tsi.py +26 -0
- openbacktesting/indicators/momentum/uo.py +22 -0
- openbacktesting/indicators/momentum/vwmacd.py +20 -0
- openbacktesting/indicators/momentum/wavetrend.py +15 -0
- openbacktesting/indicators/momentum/willr.py +10 -0
- openbacktesting/indicators/overlap/__init__.py +0 -0
- openbacktesting/indicators/overlap/alligator.py +13 -0
- openbacktesting/indicators/overlap/alma.py +33 -0
- openbacktesting/indicators/overlap/anchored_vwap.py +50 -0
- openbacktesting/indicators/overlap/anchored_vwap_bands.py +13 -0
- openbacktesting/indicators/overlap/avgprice.py +10 -0
- openbacktesting/indicators/overlap/dema.py +10 -0
- openbacktesting/indicators/overlap/ema.py +12 -0
- openbacktesting/indicators/overlap/frama.py +29 -0
- openbacktesting/indicators/overlap/fwma.py +10 -0
- openbacktesting/indicators/overlap/hilo.py +26 -0
- openbacktesting/indicators/overlap/hl2.py +10 -0
- openbacktesting/indicators/overlap/hlc3.py +10 -0
- openbacktesting/indicators/overlap/hma.py +10 -0
- openbacktesting/indicators/overlap/ht_trendline.py +10 -0
- openbacktesting/indicators/overlap/hwma.py +10 -0
- openbacktesting/indicators/overlap/ichimoku.py +44 -0
- openbacktesting/indicators/overlap/jma.py +10 -0
- openbacktesting/indicators/overlap/kama.py +10 -0
- openbacktesting/indicators/overlap/linreg.py +15 -0
- openbacktesting/indicators/overlap/linregangle.py +10 -0
- openbacktesting/indicators/overlap/linregintercept.py +10 -0
- openbacktesting/indicators/overlap/linregslope.py +10 -0
- openbacktesting/indicators/overlap/ma.py +10 -0
- openbacktesting/indicators/overlap/ma_envelopes.py +16 -0
- openbacktesting/indicators/overlap/mama.py +17 -0
- openbacktesting/indicators/overlap/mavp.py +17 -0
- openbacktesting/indicators/overlap/mcgd.py +10 -0
- openbacktesting/indicators/overlap/medprice.py +10 -0
- openbacktesting/indicators/overlap/midpoint.py +10 -0
- openbacktesting/indicators/overlap/midprice.py +10 -0
- openbacktesting/indicators/overlap/mmar.py +21 -0
- openbacktesting/indicators/overlap/ohlc4.py +10 -0
- openbacktesting/indicators/overlap/pwma.py +10 -0
- openbacktesting/indicators/overlap/rainbow.py +25 -0
- openbacktesting/indicators/overlap/rma.py +10 -0
- openbacktesting/indicators/overlap/sinwma.py +10 -0
- openbacktesting/indicators/overlap/sma.py +14 -0
- openbacktesting/indicators/overlap/ssf.py +10 -0
- openbacktesting/indicators/overlap/supertrend.py +21 -0
- openbacktesting/indicators/overlap/swma.py +10 -0
- openbacktesting/indicators/overlap/t3.py +10 -0
- openbacktesting/indicators/overlap/tema.py +10 -0
- openbacktesting/indicators/overlap/trima.py +10 -0
- openbacktesting/indicators/overlap/tsf.py +10 -0
- openbacktesting/indicators/overlap/typprice.py +10 -0
- openbacktesting/indicators/overlap/vidya.py +10 -0
- openbacktesting/indicators/overlap/vwap.py +10 -0
- openbacktesting/indicators/overlap/vwma.py +10 -0
- openbacktesting/indicators/overlap/wcp.py +10 -0
- openbacktesting/indicators/overlap/wma.py +10 -0
- openbacktesting/indicators/overlap/zlma.py +10 -0
- openbacktesting/indicators/performance/__init__.py +0 -0
- openbacktesting/indicators/performance/drawdown.py +18 -0
- openbacktesting/indicators/performance/log_return.py +10 -0
- openbacktesting/indicators/performance/percent_return.py +10 -0
- openbacktesting/indicators/predicates.py +88 -0
- openbacktesting/indicators/registry.py +571 -0
- openbacktesting/indicators/runtime.py +290 -0
- openbacktesting/indicators/statistics/__init__.py +0 -0
- openbacktesting/indicators/statistics/beta.py +10 -0
- openbacktesting/indicators/statistics/correl.py +10 -0
- openbacktesting/indicators/statistics/entropy.py +10 -0
- openbacktesting/indicators/statistics/kurtosis.py +10 -0
- openbacktesting/indicators/statistics/mad.py +10 -0
- openbacktesting/indicators/statistics/md.py +10 -0
- openbacktesting/indicators/statistics/median.py +10 -0
- openbacktesting/indicators/statistics/mode.py +48 -0
- openbacktesting/indicators/statistics/quantile.py +10 -0
- openbacktesting/indicators/statistics/skew.py +10 -0
- openbacktesting/indicators/statistics/stderr.py +10 -0
- openbacktesting/indicators/statistics/stdev.py +10 -0
- openbacktesting/indicators/statistics/variance.py +10 -0
- openbacktesting/indicators/statistics/zscore.py +10 -0
- openbacktesting/indicators/trend/__init__.py +0 -0
- openbacktesting/indicators/trend/adx.py +28 -0
- openbacktesting/indicators/trend/adxr.py +28 -0
- openbacktesting/indicators/trend/amat.py +19 -0
- openbacktesting/indicators/trend/aroon.py +18 -0
- openbacktesting/indicators/trend/atr_stop.py +33 -0
- openbacktesting/indicators/trend/chop.py +20 -0
- openbacktesting/indicators/trend/cksp.py +17 -0
- openbacktesting/indicators/trend/cpr.py +57 -0
- openbacktesting/indicators/trend/decay.py +10 -0
- openbacktesting/indicators/trend/decreasing.py +18 -0
- openbacktesting/indicators/trend/dpo.py +12 -0
- openbacktesting/indicators/trend/dx.py +19 -0
- openbacktesting/indicators/trend/edecay.py +10 -0
- openbacktesting/indicators/trend/increasing.py +18 -0
- openbacktesting/indicators/trend/long_run.py +10 -0
- openbacktesting/indicators/trend/minus_dm.py +10 -0
- openbacktesting/indicators/trend/pivot_points.py +89 -0
- openbacktesting/indicators/trend/pivothigh.py +23 -0
- openbacktesting/indicators/trend/pivotlow.py +23 -0
- openbacktesting/indicators/trend/plus_dm.py +10 -0
- openbacktesting/indicators/trend/pmax.py +18 -0
- openbacktesting/indicators/trend/psar.py +19 -0
- openbacktesting/indicators/trend/qstick.py +10 -0
- openbacktesting/indicators/trend/sarext.py +35 -0
- openbacktesting/indicators/trend/short_run.py +10 -0
- openbacktesting/indicators/trend/tsignals.py +26 -0
- openbacktesting/indicators/trend/ttm_trend.py +16 -0
- openbacktesting/indicators/trend/vhf.py +10 -0
- openbacktesting/indicators/trend/volatility_stop.py +33 -0
- openbacktesting/indicators/trend/vortex.py +17 -0
- openbacktesting/indicators/trend/xsignals.py +29 -0
- openbacktesting/indicators/types.py +344 -0
- openbacktesting/indicators/utility/__init__.py +0 -0
- openbacktesting/indicators/utility/barssince.py +21 -0
- openbacktesting/indicators/utility/change.py +7 -0
- openbacktesting/indicators/utility/cross.py +12 -0
- openbacktesting/indicators/utility/crossover.py +11 -0
- openbacktesting/indicators/utility/crossunder.py +11 -0
- openbacktesting/indicators/utility/cum.py +7 -0
- openbacktesting/indicators/utility/falling.py +10 -0
- openbacktesting/indicators/utility/highest.py +7 -0
- openbacktesting/indicators/utility/highestbars.py +29 -0
- openbacktesting/indicators/utility/lowest.py +7 -0
- openbacktesting/indicators/utility/lowestbars.py +29 -0
- openbacktesting/indicators/utility/percentile_linear_interpolation.py +12 -0
- openbacktesting/indicators/utility/percentile_nearest_rank.py +16 -0
- openbacktesting/indicators/utility/percentrank.py +7 -0
- openbacktesting/indicators/utility/range.py +8 -0
- openbacktesting/indicators/utility/rising.py +10 -0
- openbacktesting/indicators/utility/rolling_count.py +12 -0
- openbacktesting/indicators/utility/rolling_sum.py +7 -0
- openbacktesting/indicators/utility/running_max.py +7 -0
- openbacktesting/indicators/utility/running_min.py +7 -0
- openbacktesting/indicators/utility/shift.py +7 -0
- openbacktesting/indicators/utility/valuewhen.py +25 -0
- openbacktesting/indicators/volatility/__init__.py +0 -0
- openbacktesting/indicators/volatility/aberration.py +21 -0
- openbacktesting/indicators/volatility/accbands.py +20 -0
- openbacktesting/indicators/volatility/adr.py +7 -0
- openbacktesting/indicators/volatility/atr.py +12 -0
- openbacktesting/indicators/volatility/avolume.py +10 -0
- openbacktesting/indicators/volatility/bbands.py +20 -0
- openbacktesting/indicators/volatility/ce.py +25 -0
- openbacktesting/indicators/volatility/cvi.py +10 -0
- openbacktesting/indicators/volatility/donchian.py +20 -0
- openbacktesting/indicators/volatility/hvol.py +10 -0
- openbacktesting/indicators/volatility/hwc.py +27 -0
- openbacktesting/indicators/volatility/kc.py +27 -0
- openbacktesting/indicators/volatility/massi.py +10 -0
- openbacktesting/indicators/volatility/natr.py +19 -0
- openbacktesting/indicators/volatility/pdist.py +10 -0
- openbacktesting/indicators/volatility/rvi.py +21 -0
- openbacktesting/indicators/volatility/starc.py +11 -0
- openbacktesting/indicators/volatility/thermo.py +28 -0
- openbacktesting/indicators/volatility/true_range.py +31 -0
- openbacktesting/indicators/volatility/ui.py +10 -0
- openbacktesting/indicators/volume/__init__.py +0 -0
- openbacktesting/indicators/volume/ad.py +10 -0
- openbacktesting/indicators/volume/adosc.py +19 -0
- openbacktesting/indicators/volume/aobv.py +31 -0
- openbacktesting/indicators/volume/cmf.py +12 -0
- openbacktesting/indicators/volume/efi.py +12 -0
- openbacktesting/indicators/volume/emv.py +10 -0
- openbacktesting/indicators/volume/eom.py +19 -0
- openbacktesting/indicators/volume/iii.py +9 -0
- openbacktesting/indicators/volume/kvo.py +28 -0
- openbacktesting/indicators/volume/marketfi.py +10 -0
- openbacktesting/indicators/volume/mfi.py +12 -0
- openbacktesting/indicators/volume/nvi.py +26 -0
- openbacktesting/indicators/volume/obv.py +10 -0
- openbacktesting/indicators/volume/pvi.py +26 -0
- openbacktesting/indicators/volume/pvol.py +10 -0
- openbacktesting/indicators/volume/pvr.py +10 -0
- openbacktesting/indicators/volume/pvt.py +10 -0
- openbacktesting/indicators/volume/rvol.py +8 -0
- openbacktesting/indicators/volume/vfi.py +18 -0
- openbacktesting/indicators/volume/vosc.py +10 -0
- openbacktesting/indicators/volume/wad.py +10 -0
- openbacktesting/indicators/volume/wvad.py +9 -0
- openbacktesting/inputs.py +51 -0
- openbacktesting/lib.py +31 -0
- openbacktesting/logs.py +129 -0
- openbacktesting/optimization.py +8 -0
- openbacktesting/optimizer/__init__.py +25 -0
- openbacktesting/optimizer/_semantics.py +155 -0
- openbacktesting/optimizer/identity.py +45 -0
- openbacktesting/optimizer/models.py +92 -0
- openbacktesting/optimizer/plan.py +129 -0
- openbacktesting/optimizer/portfolio-result.schema.json +4984 -0
- openbacktesting/optimizer/query.py +257 -0
- openbacktesting/optimizer/runner.py +98 -0
- openbacktesting/optimizer/storage.py +261 -0
- openbacktesting/optimizer/validation.py +64 -0
- openbacktesting/parallel.py +9 -0
- openbacktesting/plotting/__init__.py +23 -0
- openbacktesting/plotting/collector.py +509 -0
- openbacktesting/plotting/encoding.py +102 -0
- openbacktesting/plotting/types.py +92 -0
- openbacktesting/portfolio/__init__.py +15 -0
- openbacktesting/portfolio/analysis.py +245 -0
- openbacktesting/portfolio/builder.py +381 -0
- openbacktesting/portfolio/catalog.json +1404 -0
- openbacktesting/portfolio/helpers.py +92 -0
- openbacktesting/portfolio/metrics.py +186 -0
- openbacktesting/portfolio/models.py +63 -0
- openbacktesting/portfolio/periods.py +164 -0
- openbacktesting/portfolio/rates.py +14 -0
- openbacktesting/portfolio/snapshot.py +111 -0
- openbacktesting/portfolio/stats.py +272 -0
- openbacktesting/portfolio/trades.py +136 -0
- openbacktesting/portfolio/trading.py +215 -0
- openbacktesting/py.typed +0 -0
- openbacktesting/runtime.py +330 -0
- openbacktesting/simulation/__init__.py +17 -0
- openbacktesting/simulation/collection.py +13 -0
- openbacktesting/simulation/config.py +241 -0
- openbacktesting/simulation/core.py +528 -0
- openbacktesting/simulation/optimization.py +326 -0
- openbacktesting/simulation/parallel.py +145 -0
- openbacktesting/simulation/variants.py +107 -0
- openbacktesting/strategy/__init__.py +19 -0
- openbacktesting/strategy/bar_state.py +14 -0
- openbacktesting/strategy/base.py +810 -0
- openbacktesting/strategy/declaration.py +90 -0
- openbacktesting/strategy/helpers.py +198 -0
- openbacktesting/strategy/inputs.py +460 -0
- openbacktesting/strategy/sizing.py +80 -0
- openbacktesting/strategy/templates.py +160 -0
- openbacktesting/strategy_data.py +10 -0
- openbacktesting/test/BTCUSD.csv +157 -0
- openbacktesting/test/EURUSD.csv +5001 -0
- openbacktesting/test/GOOG.csv +2149 -0
- openbacktesting/test/__init__.py +29 -0
- openbacktesting/test/__main__.py +11 -0
- openbacktesting/test/_test.py +1312 -0
- openbacktesting/util.py +31 -0
- openbacktesting-0.2.0.dist-info/METADATA +151 -0
- openbacktesting-0.2.0.dist-info/RECORD +350 -0
- openbacktesting-0.2.0.dist-info/WHEEL +4 -0
- openbacktesting-0.2.0.dist-info/licenses/LICENSE +202 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""ta.aberration: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.aberration import aberration as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, atr_length, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high, low=low, close=close, length=length, atr_length=atr_length, talib=talib
|
|
11
|
+
)
|
|
12
|
+
return named_frame(
|
|
13
|
+
result,
|
|
14
|
+
"ta.aberration",
|
|
15
|
+
{
|
|
16
|
+
f"ABER_ZG_{length}_{atr_length}": "middle",
|
|
17
|
+
f"ABER_SG_{length}_{atr_length}": "upper",
|
|
18
|
+
f"ABER_XG_{length}_{atr_length}": "lower",
|
|
19
|
+
f"ABER_ATR_{length}_{atr_length}": "atr",
|
|
20
|
+
},
|
|
21
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""ta.accbands: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.accbands import accbands as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, c, mamode, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high, low=low, close=close, length=length, c=c, mamode=mamode, drift=drift, talib=talib
|
|
11
|
+
)
|
|
12
|
+
return named_frame(
|
|
13
|
+
result,
|
|
14
|
+
"ta.accbands",
|
|
15
|
+
{
|
|
16
|
+
f"ACCBL_{length}": "lower",
|
|
17
|
+
f"ACCBM_{length}": "middle",
|
|
18
|
+
f"ACCBU_{length}": "upper",
|
|
19
|
+
},
|
|
20
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""ta.atr: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.atr import atr as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, mamode, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high, low=low, close=close, length=length, mamode=mamode, drift=drift, talib=talib
|
|
11
|
+
)
|
|
12
|
+
return named_series(result, "ta.atr", "atr")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.avolume: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.avolume import avolume as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, talib):
|
|
9
|
+
result = _calculate(close=close, length=length, talib=talib)
|
|
10
|
+
return named_series(result, "ta.avolume", "avolume")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""ta.bbands: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.bbands import bbands as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, std, ddof, mamode, talib):
|
|
9
|
+
result = _calculate(close=close, length=length, std=std, ddof=ddof, mamode=mamode, talib=talib)
|
|
10
|
+
return named_frame(
|
|
11
|
+
result,
|
|
12
|
+
"ta.bbands",
|
|
13
|
+
{
|
|
14
|
+
f"BBL_{length}_{std}": "lower",
|
|
15
|
+
f"BBM_{length}_{std}": "middle",
|
|
16
|
+
f"BBU_{length}_{std}": "upper",
|
|
17
|
+
f"BBB_{length}_{std}": "bandwidth",
|
|
18
|
+
f"BBP_{length}_{std}": "percent",
|
|
19
|
+
},
|
|
20
|
+
)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"""ta.ce: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.ce import ce as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, multiplier, mamode, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high,
|
|
11
|
+
low=low,
|
|
12
|
+
close=close,
|
|
13
|
+
length=length,
|
|
14
|
+
multiplier=multiplier,
|
|
15
|
+
mamode=mamode,
|
|
16
|
+
talib=talib,
|
|
17
|
+
)
|
|
18
|
+
return named_frame(
|
|
19
|
+
result,
|
|
20
|
+
"ta.ce",
|
|
21
|
+
{
|
|
22
|
+
f"CE_L_{length}_{multiplier}": "long",
|
|
23
|
+
f"CE_S_{length}_{multiplier}": "short",
|
|
24
|
+
},
|
|
25
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.cvi: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.cvi import cvi as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, length, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, length=length, talib=talib)
|
|
10
|
+
return named_series(result, "ta.cvi", "cvi")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"""ta.donchian: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.donchian import donchian as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, lower_length, upper_length, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high, low=low, lower_length=lower_length, upper_length=upper_length, talib=talib
|
|
11
|
+
)
|
|
12
|
+
return named_frame(
|
|
13
|
+
result,
|
|
14
|
+
"ta.donchian",
|
|
15
|
+
{
|
|
16
|
+
f"DCL_{lower_length}_{upper_length}": "lower",
|
|
17
|
+
f"DCM_{lower_length}_{upper_length}": "middle",
|
|
18
|
+
f"DCU_{lower_length}_{upper_length}": "upper",
|
|
19
|
+
},
|
|
20
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.hvol: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.hvol import hvol as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, annualization, talib):
|
|
9
|
+
result = _calculate(close=close, length=length, annualization=annualization, talib=talib)
|
|
10
|
+
return named_series(result, "ta.hvol", "hvol")
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""ta.hwc: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.hwc import hwc as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, na, nb, nc, nd, scalar, channel_eval, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
close=close,
|
|
11
|
+
na=na,
|
|
12
|
+
nb=nb,
|
|
13
|
+
nc=nc,
|
|
14
|
+
nd=nd,
|
|
15
|
+
scalar=scalar,
|
|
16
|
+
channel_eval=channel_eval,
|
|
17
|
+
talib=talib,
|
|
18
|
+
)
|
|
19
|
+
return named_frame(
|
|
20
|
+
result,
|
|
21
|
+
"ta.hwc",
|
|
22
|
+
{
|
|
23
|
+
"HWM": "middle",
|
|
24
|
+
"HWU": "upper",
|
|
25
|
+
"HWL": "lower",
|
|
26
|
+
},
|
|
27
|
+
)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"""ta.kc: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.kc import kc as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, scalar, mamode, talib, use_true_range):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high,
|
|
11
|
+
low=low,
|
|
12
|
+
close=close,
|
|
13
|
+
length=length,
|
|
14
|
+
scalar=scalar,
|
|
15
|
+
mamode=mamode,
|
|
16
|
+
talib=talib,
|
|
17
|
+
tr=use_true_range,
|
|
18
|
+
)
|
|
19
|
+
return named_frame(
|
|
20
|
+
result,
|
|
21
|
+
"ta.kc",
|
|
22
|
+
{
|
|
23
|
+
f"KCL{mamode[0]}_{length}_{float(scalar)}": "lower",
|
|
24
|
+
f"KCB{mamode[0]}_{length}_{float(scalar)}": "middle",
|
|
25
|
+
f"KCU{mamode[0]}_{length}_{float(scalar)}": "upper",
|
|
26
|
+
},
|
|
27
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.massi: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.massi import massi as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, fast, slow, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, fast=fast, slow=slow, talib=talib)
|
|
10
|
+
return named_series(result, "ta.massi", "massi")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""ta.natr: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.natr import natr as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, scalar, mamode, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high,
|
|
11
|
+
low=low,
|
|
12
|
+
close=close,
|
|
13
|
+
length=length,
|
|
14
|
+
scalar=scalar,
|
|
15
|
+
mamode=mamode,
|
|
16
|
+
drift=drift,
|
|
17
|
+
talib=talib,
|
|
18
|
+
)
|
|
19
|
+
return named_series(result, "ta.natr", "natr")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.pdist: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.pdist import pdist as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, open_, high, low, close, drift, talib):
|
|
9
|
+
result = _calculate(open_=open_, high=high, low=low, close=close, drift=drift, talib=talib)
|
|
10
|
+
return named_series(result, "ta.pdist", "pdist")
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""ta.rvi: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.rvi import rvi as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, high, low, length, scalar, refined, thirds, mamode, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
close=close,
|
|
11
|
+
high=high,
|
|
12
|
+
low=low,
|
|
13
|
+
length=length,
|
|
14
|
+
scalar=scalar,
|
|
15
|
+
refined=refined,
|
|
16
|
+
thirds=thirds,
|
|
17
|
+
mamode=mamode,
|
|
18
|
+
drift=drift,
|
|
19
|
+
talib=talib,
|
|
20
|
+
)
|
|
21
|
+
return named_series(result, "ta.rvi", "rvi")
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"""ta.starc: Independent formula with a fixed initialization contract."""
|
|
2
|
+
|
|
3
|
+
import pandas as pd
|
|
4
|
+
|
|
5
|
+
from ..calculus import atr, clean
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, atr_length, multiplier):
|
|
9
|
+
middle = clean(close).rolling(length).mean()
|
|
10
|
+
spread = atr(high, low, close, atr_length) * multiplier
|
|
11
|
+
return pd.DataFrame({"middle": middle, "upper": middle + spread, "lower": middle - spread})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""ta.thermo: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.thermo import thermo as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, length, long, short, mamode, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high,
|
|
11
|
+
low=low,
|
|
12
|
+
length=length,
|
|
13
|
+
long=long,
|
|
14
|
+
short=short,
|
|
15
|
+
mamode=mamode,
|
|
16
|
+
drift=drift,
|
|
17
|
+
talib=talib,
|
|
18
|
+
)
|
|
19
|
+
return named_frame(
|
|
20
|
+
result,
|
|
21
|
+
"ta.thermo",
|
|
22
|
+
{
|
|
23
|
+
f"THERMO_{length}_{float(long)}_{float(short)}": "thermo",
|
|
24
|
+
f"THERMOma_{length}_{float(long)}_{float(short)}": "average",
|
|
25
|
+
f"THERMOl_{length}_{float(long)}_{float(short)}": "long",
|
|
26
|
+
f"THERMOs_{length}_{float(long)}_{float(short)}": "short",
|
|
27
|
+
},
|
|
28
|
+
)
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""Legacy default TR calculation with explicit fallback for missing previous Close."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
from pandas_ta_classic.volatility.true_range import true_range as _calculate
|
|
6
|
+
|
|
7
|
+
from ..common import named_series
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def compute(*, high, low, close, drift, talib, handle_na):
|
|
11
|
+
if not handle_na:
|
|
12
|
+
result = named_series(
|
|
13
|
+
_calculate(high=high, low=low, close=close, drift=drift, talib=talib),
|
|
14
|
+
"ta.true_range",
|
|
15
|
+
"true_range",
|
|
16
|
+
)
|
|
17
|
+
if result is not None:
|
|
18
|
+
result.attrs["indicator_valid"] = np.isfinite(np.column_stack([high, low, close])).all(
|
|
19
|
+
axis=1
|
|
20
|
+
)
|
|
21
|
+
return result
|
|
22
|
+
previous = close.shift(drift).to_numpy()
|
|
23
|
+
h, l = high.to_numpy(), low.to_numpy()
|
|
24
|
+
with np.errstate(over="ignore", invalid="ignore"):
|
|
25
|
+
value = np.where(
|
|
26
|
+
np.isfinite(previous),
|
|
27
|
+
np.maximum.reduce([h - l, abs(h - previous), abs(l - previous)]),
|
|
28
|
+
h - l,
|
|
29
|
+
)
|
|
30
|
+
value = np.where(np.isfinite(h) & np.isfinite(l) & (h >= l), value, np.nan)
|
|
31
|
+
return pd.Series(value, index=high.index, name="true_range")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.ui: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volatility.ui import ui as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, scalar, talib):
|
|
9
|
+
result = _calculate(close=close, length=length, scalar=scalar, talib=talib)
|
|
10
|
+
return named_series(result, "ta.ui", "ui")
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.ad: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.ad import ad as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, volume, open_, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, close=close, volume=volume, open_=open_, talib=talib)
|
|
10
|
+
return named_series(result, "ta.ad", "ad")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""ta.adosc: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.adosc import adosc as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, volume, fast, slow, open_, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high,
|
|
11
|
+
low=low,
|
|
12
|
+
close=close,
|
|
13
|
+
volume=volume,
|
|
14
|
+
fast=fast,
|
|
15
|
+
slow=slow,
|
|
16
|
+
open_=open_,
|
|
17
|
+
talib=talib,
|
|
18
|
+
)
|
|
19
|
+
return named_series(result, "ta.adosc", "adosc")
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"""ta.aobv: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.aobv import aobv as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, volume, fast, slow, max_lookback, min_lookback, mamode, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
close=close,
|
|
11
|
+
volume=volume,
|
|
12
|
+
fast=fast,
|
|
13
|
+
slow=slow,
|
|
14
|
+
max_lookback=max_lookback,
|
|
15
|
+
min_lookback=min_lookback,
|
|
16
|
+
mamode=mamode,
|
|
17
|
+
talib=talib,
|
|
18
|
+
)
|
|
19
|
+
return named_frame(
|
|
20
|
+
result,
|
|
21
|
+
"ta.aobv",
|
|
22
|
+
{
|
|
23
|
+
"OBV": "obv",
|
|
24
|
+
f"OBV_min_{min_lookback}": "minimum",
|
|
25
|
+
f"OBV_max_{max_lookback}": "maximum",
|
|
26
|
+
f"OBV{mamode[0]}_{fast}": "fast",
|
|
27
|
+
f"OBV{mamode[0]}_{slow}": "slow",
|
|
28
|
+
"AOBV_LR_2": "long",
|
|
29
|
+
"AOBV_SR_2": "short",
|
|
30
|
+
},
|
|
31
|
+
)
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""ta.cmf: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.cmf import cmf as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, volume, length, open_, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high, low=low, close=close, volume=volume, length=length, open_=open_, talib=talib
|
|
11
|
+
)
|
|
12
|
+
return named_series(result, "ta.cmf", "cmf")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""ta.efi: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.efi import efi as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, volume, length, mamode, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
close=close, volume=volume, length=length, mamode=mamode, drift=drift, talib=talib
|
|
11
|
+
)
|
|
12
|
+
return named_series(result, "ta.efi", "efi")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.emv: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.emv import emv as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, volume, drift, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, volume=volume, drift=drift, talib=talib)
|
|
10
|
+
return named_series(result, "ta.emv", "emv")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""ta.eom: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.eom import eom as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, volume, length, divisor, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high,
|
|
11
|
+
low=low,
|
|
12
|
+
close=close,
|
|
13
|
+
volume=volume,
|
|
14
|
+
length=length,
|
|
15
|
+
divisor=divisor,
|
|
16
|
+
drift=drift,
|
|
17
|
+
talib=talib,
|
|
18
|
+
)
|
|
19
|
+
return named_series(result, "ta.eom", "eom")
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""ta.iii: Independent formula with a fixed initialization contract."""
|
|
2
|
+
|
|
3
|
+
from ..calculus import clean, ratio
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def compute(*, high, low, close, volume):
|
|
7
|
+
return ratio(
|
|
8
|
+
clean(volume) * (2 * clean(close) - clean(high) - clean(low)), clean(high) - clean(low)
|
|
9
|
+
).rename("iii")
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"""ta.kvo: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.kvo import kvo as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, volume, fast, slow, signal, mamode, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high,
|
|
11
|
+
low=low,
|
|
12
|
+
close=close,
|
|
13
|
+
volume=volume,
|
|
14
|
+
fast=fast,
|
|
15
|
+
slow=slow,
|
|
16
|
+
signal=signal,
|
|
17
|
+
mamode=mamode,
|
|
18
|
+
drift=drift,
|
|
19
|
+
talib=talib,
|
|
20
|
+
)
|
|
21
|
+
return named_frame(
|
|
22
|
+
result,
|
|
23
|
+
"ta.kvo",
|
|
24
|
+
{
|
|
25
|
+
f"KVO_{fast}_{slow}_{signal}": "kvo",
|
|
26
|
+
f"KVOs_{fast}_{slow}_{signal}": "signal",
|
|
27
|
+
},
|
|
28
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.marketfi: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.marketfi import marketfi as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, volume, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, volume=volume, talib=talib)
|
|
10
|
+
return named_series(result, "ta.marketfi", "marketfi")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""ta.mfi: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.mfi import mfi as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, volume, length, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
high=high, low=low, close=close, volume=volume, length=length, drift=drift, talib=talib
|
|
11
|
+
)
|
|
12
|
+
return named_series(result, "ta.mfi", "mfi")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""NVI: Update the preceding index by the price ratio under the volume condition."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def compute(*, close, volume, length, initial):
|
|
8
|
+
prices, amounts = close.to_numpy(), volume.to_numpy()
|
|
9
|
+
result = np.full(len(close), np.nan)
|
|
10
|
+
value = None
|
|
11
|
+
for i in range(len(close)):
|
|
12
|
+
if not np.isfinite(prices[i]) or not np.isfinite(amounts[i]):
|
|
13
|
+
continue
|
|
14
|
+
if value is None:
|
|
15
|
+
value = float(initial)
|
|
16
|
+
elif (
|
|
17
|
+
i < length
|
|
18
|
+
or not np.isfinite(prices[i - length])
|
|
19
|
+
or prices[i - length] == 0
|
|
20
|
+
or not np.isfinite(amounts[i - 1])
|
|
21
|
+
):
|
|
22
|
+
continue
|
|
23
|
+
elif amounts[i] < amounts[i - 1]:
|
|
24
|
+
value *= prices[i] / prices[i - length]
|
|
25
|
+
result[i] = value
|
|
26
|
+
return pd.Series(result, index=close.index, name="nvi")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.obv: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.obv import obv as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, volume, talib):
|
|
9
|
+
result = _calculate(close=close, volume=volume, talib=talib)
|
|
10
|
+
return named_series(result, "ta.obv", "obv")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""PVI: Update the preceding index by the price ratio under the volume condition."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def compute(*, close, volume, length, initial):
|
|
8
|
+
prices, amounts = close.to_numpy(), volume.to_numpy()
|
|
9
|
+
result = np.full(len(close), np.nan)
|
|
10
|
+
value = None
|
|
11
|
+
for i in range(len(close)):
|
|
12
|
+
if not np.isfinite(prices[i]) or not np.isfinite(amounts[i]):
|
|
13
|
+
continue
|
|
14
|
+
if value is None:
|
|
15
|
+
value = float(initial)
|
|
16
|
+
elif (
|
|
17
|
+
i < length
|
|
18
|
+
or not np.isfinite(prices[i - length])
|
|
19
|
+
or prices[i - length] == 0
|
|
20
|
+
or not np.isfinite(amounts[i - 1])
|
|
21
|
+
):
|
|
22
|
+
continue
|
|
23
|
+
elif amounts[i] > amounts[i - 1]:
|
|
24
|
+
value *= prices[i] / prices[i - length]
|
|
25
|
+
result[i] = value
|
|
26
|
+
return pd.Series(result, index=close.index, name="pvi")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.pvol: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.pvol import pvol as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, volume, talib):
|
|
9
|
+
result = _calculate(close=close, volume=volume, talib=talib)
|
|
10
|
+
return named_series(result, "ta.pvol", "pvol")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.pvr: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.volume.pvr import pvr as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, volume, talib):
|
|
9
|
+
result = _calculate(close=close, volume=volume, talib=talib)
|
|
10
|
+
return named_series(result, "ta.pvr", "pvr")
|