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,57 @@
|
|
|
1
|
+
"""ta.cpr: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.cpr import cpr as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(
|
|
9
|
+
*,
|
|
10
|
+
open_,
|
|
11
|
+
high,
|
|
12
|
+
low,
|
|
13
|
+
close,
|
|
14
|
+
volume,
|
|
15
|
+
method,
|
|
16
|
+
timeframe,
|
|
17
|
+
interval,
|
|
18
|
+
levels,
|
|
19
|
+
width_analysis,
|
|
20
|
+
price_position,
|
|
21
|
+
virgin_cpr,
|
|
22
|
+
lookahead,
|
|
23
|
+
talib,
|
|
24
|
+
):
|
|
25
|
+
result = _calculate(
|
|
26
|
+
open_=open_,
|
|
27
|
+
high=high,
|
|
28
|
+
low=low,
|
|
29
|
+
close=close,
|
|
30
|
+
volume=volume,
|
|
31
|
+
method=method,
|
|
32
|
+
timeframe=timeframe,
|
|
33
|
+
interval=interval,
|
|
34
|
+
levels=levels,
|
|
35
|
+
width_analysis=width_analysis,
|
|
36
|
+
price_position=price_position,
|
|
37
|
+
virgin_cpr=virgin_cpr,
|
|
38
|
+
lookahead=lookahead,
|
|
39
|
+
talib=talib,
|
|
40
|
+
)
|
|
41
|
+
return named_frame(
|
|
42
|
+
result,
|
|
43
|
+
"ta.cpr",
|
|
44
|
+
{
|
|
45
|
+
"CPR_TC": "top",
|
|
46
|
+
"CPR_PIVOT": "pivot",
|
|
47
|
+
"CPR_BC": "bottom",
|
|
48
|
+
"CPR_R1": "r1",
|
|
49
|
+
"CPR_R2": "r2",
|
|
50
|
+
"CPR_S1": "s1",
|
|
51
|
+
"CPR_S2": "s2",
|
|
52
|
+
"CPR_WIDTH": "width",
|
|
53
|
+
"CPR_WIDTH_PCT": "width_percent",
|
|
54
|
+
"CPR_WIDTH_CLASS": "width_class",
|
|
55
|
+
"CPR_POSITION": "position",
|
|
56
|
+
},
|
|
57
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.decay: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.decay import decay as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, mode, kind, talib):
|
|
9
|
+
result = _calculate(close=close, length=length, mode=mode, kind=kind, talib=talib)
|
|
10
|
+
return named_series(result, "ta.decay", "decay")
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""ta.decreasing: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.decreasing import decreasing as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, strict, asint, percent, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
close=close,
|
|
11
|
+
length=length,
|
|
12
|
+
strict=strict,
|
|
13
|
+
asint=asint,
|
|
14
|
+
percent=percent,
|
|
15
|
+
drift=drift,
|
|
16
|
+
talib=talib,
|
|
17
|
+
)
|
|
18
|
+
return named_series(result, "ta.decreasing", "decreasing")
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"""ta.dpo: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.dpo import dpo as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, centered, lookahead, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
close=close, length=length, centered=centered, lookahead=lookahead, talib=talib
|
|
11
|
+
)
|
|
12
|
+
return named_series(result, "ta.dpo", "dpo")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""ta.dx: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.dx import dx 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.dx", "dx")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.edecay: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.edecay import edecay 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.edecay", "edecay")
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""ta.increasing: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.increasing import increasing as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, strict, asint, percent, drift, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
close=close,
|
|
11
|
+
length=length,
|
|
12
|
+
strict=strict,
|
|
13
|
+
asint=asint,
|
|
14
|
+
percent=percent,
|
|
15
|
+
drift=drift,
|
|
16
|
+
talib=talib,
|
|
17
|
+
)
|
|
18
|
+
return named_series(result, "ta.increasing", "increasing")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.long_run: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.long_run import long_run as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, fast, slow, length, talib):
|
|
9
|
+
result = _calculate(fast=fast, slow=slow, length=length, talib=talib)
|
|
10
|
+
return named_series(result, "ta.long_run", "long_run")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.minus_dm: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.minus_dm import minus_dm as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, length, drift, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, length=length, drift=drift, talib=talib)
|
|
10
|
+
return named_series(result, "ta.minus_dm", "minus_dm")
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"""Six Pivot formulas with explicit period anchors; consume only completed periods."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
from ..calculus import condition
|
|
7
|
+
from ..types import IndicatorError
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def _levels(open_, high, low, close, current_open, method):
|
|
11
|
+
levels = np.full(11, np.nan)
|
|
12
|
+
width = high - low
|
|
13
|
+
pivot = (high + low + close) / 3
|
|
14
|
+
if method == "woodie":
|
|
15
|
+
pivot = (high + low + 2 * current_open) / 4
|
|
16
|
+
if method == "demark":
|
|
17
|
+
if close == open_:
|
|
18
|
+
total = high + low + 2 * close
|
|
19
|
+
elif close > open_:
|
|
20
|
+
total = 2 * high + low + close
|
|
21
|
+
else:
|
|
22
|
+
total = high + 2 * low + close
|
|
23
|
+
levels[:3] = total / 4, total / 2 - low, total / 2 - high
|
|
24
|
+
return levels
|
|
25
|
+
levels[0] = pivot
|
|
26
|
+
if method == "fibonacci":
|
|
27
|
+
for i, coefficient in enumerate((0.382, 0.618, 1), 1):
|
|
28
|
+
levels[2 * i - 1 : 2 * i + 1] = pivot + width * coefficient, pivot - width * coefficient
|
|
29
|
+
elif method == "camarilla":
|
|
30
|
+
for i, divisor in enumerate((12, 6, 4, 2), 1):
|
|
31
|
+
levels[2 * i - 1 : 2 * i + 1] = (
|
|
32
|
+
close + 1.1 * width / divisor,
|
|
33
|
+
close - 1.1 * width / divisor,
|
|
34
|
+
)
|
|
35
|
+
if low != 0:
|
|
36
|
+
levels[9] = high / low * close
|
|
37
|
+
levels[10] = 2 * close - levels[9]
|
|
38
|
+
else:
|
|
39
|
+
levels[1:5] = 2 * pivot - low, 2 * pivot - high, pivot + width, pivot - width
|
|
40
|
+
if method == "classic":
|
|
41
|
+
levels[5:9] = pivot + 2 * width, pivot - 2 * width, pivot + 3 * width, pivot - 3 * width
|
|
42
|
+
elif method == "woodie":
|
|
43
|
+
levels[5:7] = high + 2 * (pivot - low), low - 2 * (high - pivot)
|
|
44
|
+
levels[7:9] = levels[5] + width, levels[6] - width
|
|
45
|
+
else:
|
|
46
|
+
for i in (3, 4, 5):
|
|
47
|
+
levels[2 * i - 1 : 2 * i + 1] = (
|
|
48
|
+
(i - 1) * pivot + high - (i - 1) * low,
|
|
49
|
+
(i - 1) * pivot - (i - 1) * high + low,
|
|
50
|
+
)
|
|
51
|
+
return levels
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def compute(*, open_, high, low, close, anchor, method, developing):
|
|
55
|
+
if developing and method == "woodie":
|
|
56
|
+
raise IndicatorError("invalid-parameter", "ta.pivot_points", "Woodie does not support developing")
|
|
57
|
+
anchor = condition(anchor, "ta.pivot_points")
|
|
58
|
+
if anchor.isna().any():
|
|
59
|
+
raise IndicatorError("invalid-input", "ta.pivot_points", "Period anchors must not be missing")
|
|
60
|
+
values = np.column_stack([open_, high, low, close])
|
|
61
|
+
output = np.full((len(close), 11), np.nan)
|
|
62
|
+
levels = np.full(11, np.nan)
|
|
63
|
+
started = False
|
|
64
|
+
complete = False
|
|
65
|
+
po = ph = pl = pc = np.nan
|
|
66
|
+
for i, (o, h, l, c) in enumerate(values):
|
|
67
|
+
valid = np.isfinite(values[i]).all()
|
|
68
|
+
if developing:
|
|
69
|
+
valid = valid and h >= l
|
|
70
|
+
if anchor.iloc[i] == 1:
|
|
71
|
+
if started and complete and (method != "woodie" or np.isfinite(o)):
|
|
72
|
+
levels = _levels(po, ph, pl, pc, o, method)
|
|
73
|
+
else:
|
|
74
|
+
levels = np.full(11, np.nan)
|
|
75
|
+
started, complete = True, valid
|
|
76
|
+
po, ph, pl, pc = o, h, l, c
|
|
77
|
+
elif started:
|
|
78
|
+
complete &= valid
|
|
79
|
+
ph, pl, pc = max(ph, h), min(pl, l), c
|
|
80
|
+
if developing:
|
|
81
|
+
levels = (
|
|
82
|
+
_levels(po, ph, pl, pc, o, method) if started and complete else np.full(11, np.nan)
|
|
83
|
+
)
|
|
84
|
+
output[i] = levels
|
|
85
|
+
return pd.DataFrame(
|
|
86
|
+
output,
|
|
87
|
+
index=close.index,
|
|
88
|
+
columns=["p", "r1", "s1", "r2", "s2", "r3", "s3", "r4", "s4", "r5", "s5"],
|
|
89
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""ta.pivothigh: Fixed causal sequence contract."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
from ..calculus import clean
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def compute(*, high, left, right):
|
|
10
|
+
source = clean(high)
|
|
11
|
+
candidate = source.shift(right)
|
|
12
|
+
lhs = source.shift(right + 1).rolling(left).max()
|
|
13
|
+
rhs = source.rolling(right).max()
|
|
14
|
+
event = (candidate >= lhs) & (candidate > rhs)
|
|
15
|
+
positions = pd.Series(np.arange(len(source), dtype=float), index=source.index)
|
|
16
|
+
return pd.DataFrame(
|
|
17
|
+
{
|
|
18
|
+
"value": candidate.where(event),
|
|
19
|
+
"pivot_bar": (positions - right).where(event),
|
|
20
|
+
"confirmed_at": positions.where(event),
|
|
21
|
+
},
|
|
22
|
+
index=source.index,
|
|
23
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""ta.pivotlow: Fixed causal sequence contract."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
from ..calculus import clean
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def compute(*, low, left, right):
|
|
10
|
+
source = clean(low)
|
|
11
|
+
candidate = source.shift(right)
|
|
12
|
+
lhs = source.shift(right + 1).rolling(left).min()
|
|
13
|
+
rhs = source.rolling(right).min()
|
|
14
|
+
event = (candidate <= lhs) & (candidate < rhs)
|
|
15
|
+
positions = pd.Series(np.arange(len(source), dtype=float), index=source.index)
|
|
16
|
+
return pd.DataFrame(
|
|
17
|
+
{
|
|
18
|
+
"value": candidate.where(event),
|
|
19
|
+
"pivot_bar": (positions - right).where(event),
|
|
20
|
+
"confirmed_at": positions.where(event),
|
|
21
|
+
},
|
|
22
|
+
index=source.index,
|
|
23
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.plus_dm: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.plus_dm import plus_dm as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, length, drift, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, length=length, drift=drift, talib=talib)
|
|
10
|
+
return named_series(result, "ta.plus_dm", "plus_dm")
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""ta.pmax: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.pmax import pmax as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
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_series(result, "ta.pmax", "pmax")
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""ta.psar: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.psar import psar as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, af0, af, max_af, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, close=close, af0=af0, af=af, max_af=max_af, talib=talib)
|
|
10
|
+
return named_frame(
|
|
11
|
+
result,
|
|
12
|
+
"ta.psar",
|
|
13
|
+
{
|
|
14
|
+
f"PSARl_{af0}_{max_af}": "long",
|
|
15
|
+
f"PSARs_{af0}_{max_af}": "short",
|
|
16
|
+
f"PSARaf_{af0}_{max_af}": "acceleration",
|
|
17
|
+
f"PSARr_{af0}_{max_af}": "reversal",
|
|
18
|
+
},
|
|
19
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.qstick: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.qstick import qstick as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, open_, close, length, talib):
|
|
9
|
+
result = _calculate(open_=open_, close=close, length=length, talib=talib)
|
|
10
|
+
return named_series(result, "ta.qstick", "qstick")
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""ta.sarext: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.sarext import sarext as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(
|
|
9
|
+
*,
|
|
10
|
+
high,
|
|
11
|
+
low,
|
|
12
|
+
startvalue,
|
|
13
|
+
offsetonreverse,
|
|
14
|
+
accelerationinitlong,
|
|
15
|
+
accelerationlong,
|
|
16
|
+
accelerationmaxlong,
|
|
17
|
+
accelerationinitshort,
|
|
18
|
+
accelerationshort,
|
|
19
|
+
accelerationmaxshort,
|
|
20
|
+
talib,
|
|
21
|
+
):
|
|
22
|
+
result = _calculate(
|
|
23
|
+
high=high,
|
|
24
|
+
low=low,
|
|
25
|
+
startvalue=startvalue,
|
|
26
|
+
offsetonreverse=offsetonreverse,
|
|
27
|
+
accelerationinitlong=accelerationinitlong,
|
|
28
|
+
accelerationlong=accelerationlong,
|
|
29
|
+
accelerationmaxlong=accelerationmaxlong,
|
|
30
|
+
accelerationinitshort=accelerationinitshort,
|
|
31
|
+
accelerationshort=accelerationshort,
|
|
32
|
+
accelerationmaxshort=accelerationmaxshort,
|
|
33
|
+
talib=talib,
|
|
34
|
+
)
|
|
35
|
+
return named_series(result, "ta.sarext", "sarext")
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.short_run: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.short_run import short_run as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, fast, slow, length, talib):
|
|
9
|
+
result = _calculate(fast=fast, slow=slow, length=length, talib=talib)
|
|
10
|
+
return named_series(result, "ta.short_run", "short_run")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""ta.tsignals: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.tsignals import tsignals as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, trend, asbool, trade_offset, drift, trend_reset, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
trend=trend,
|
|
11
|
+
asbool=asbool,
|
|
12
|
+
trade_offset=trade_offset,
|
|
13
|
+
drift=drift,
|
|
14
|
+
trend_reset=trend_reset,
|
|
15
|
+
talib=talib,
|
|
16
|
+
)
|
|
17
|
+
return named_frame(
|
|
18
|
+
result,
|
|
19
|
+
"ta.tsignals",
|
|
20
|
+
{
|
|
21
|
+
"TS_Trends": "trend",
|
|
22
|
+
"TS_Trades": "trades",
|
|
23
|
+
"TS_Entries": "entries",
|
|
24
|
+
"TS_Exits": "exits",
|
|
25
|
+
},
|
|
26
|
+
)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"""ta.ttm_trend: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.ttm_trend import ttm_trend as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, close=close, length=length, talib=talib)
|
|
10
|
+
return named_frame(
|
|
11
|
+
result,
|
|
12
|
+
"ta.ttm_trend",
|
|
13
|
+
{
|
|
14
|
+
f"TTM_TRND_{length}": "ttm_trend",
|
|
15
|
+
},
|
|
16
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"""ta.vhf: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.vhf import vhf as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_series
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, close, length, drift, talib):
|
|
9
|
+
result = _calculate(close=close, length=length, drift=drift, talib=talib)
|
|
10
|
+
return named_series(result, "ta.vhf", "vhf")
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"""ta.volatility_stop: Independent formula with a fixed initialization contract."""
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
import pandas as pd
|
|
5
|
+
|
|
6
|
+
from ..calculus import atr, segments
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def compute(*, high, low, close, length, multiplier):
|
|
10
|
+
width = atr(high, low, close, length).to_numpy() * multiplier
|
|
11
|
+
prices = close.to_numpy()
|
|
12
|
+
stop = np.full(len(close), np.nan)
|
|
13
|
+
direction = stop.copy()
|
|
14
|
+
valid = np.isfinite(np.column_stack([high, low, close])).all(axis=1)
|
|
15
|
+
for start, end in segments(valid):
|
|
16
|
+
if end - start <= length:
|
|
17
|
+
continue
|
|
18
|
+
bullish = prices[start + length - 1] > prices[start]
|
|
19
|
+
initial = prices[start : start + length]
|
|
20
|
+
extreme = initial.max() if bullish else initial.min()
|
|
21
|
+
confirmed = False
|
|
22
|
+
for i in range(start + length, end):
|
|
23
|
+
level = extreme - width[i - 1] if bullish else extreme + width[i - 1]
|
|
24
|
+
if confirmed:
|
|
25
|
+
stop[i], direction[i] = level, 1 if bullish else -1
|
|
26
|
+
reverse = prices[i] < level if bullish else prices[i] > level
|
|
27
|
+
if reverse:
|
|
28
|
+
bullish = not bullish
|
|
29
|
+
extreme = prices[i]
|
|
30
|
+
confirmed = True
|
|
31
|
+
else:
|
|
32
|
+
extreme = max(extreme, prices[i]) if bullish else min(extreme, prices[i])
|
|
33
|
+
return pd.DataFrame({"stop": stop, "direction": direction}, index=close.index)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""ta.vortex: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.vortex import vortex as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, high, low, close, length, drift, talib):
|
|
9
|
+
result = _calculate(high=high, low=low, close=close, length=length, drift=drift, talib=talib)
|
|
10
|
+
return named_frame(
|
|
11
|
+
result,
|
|
12
|
+
"ta.vortex",
|
|
13
|
+
{
|
|
14
|
+
f"VTXP_{length}": "positive",
|
|
15
|
+
f"VTXM_{length}": "negative",
|
|
16
|
+
},
|
|
17
|
+
)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""ta.xsignals: Computation wrapper for the pinned dependency with canonical outputs."""
|
|
2
|
+
|
|
3
|
+
from pandas_ta_classic.trend.xsignals import xsignals as _calculate
|
|
4
|
+
|
|
5
|
+
from ..common import named_frame
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def compute(*, signal, xa, xb, above, long, asbool, trade_offset, trend_reset, talib):
|
|
9
|
+
result = _calculate(
|
|
10
|
+
signal=signal,
|
|
11
|
+
xa=xa,
|
|
12
|
+
xb=xb,
|
|
13
|
+
above=above,
|
|
14
|
+
long=long,
|
|
15
|
+
asbool=asbool,
|
|
16
|
+
trade_offset=trade_offset,
|
|
17
|
+
trend_reset=trend_reset,
|
|
18
|
+
talib=talib,
|
|
19
|
+
)
|
|
20
|
+
return named_frame(
|
|
21
|
+
result,
|
|
22
|
+
"ta.xsignals",
|
|
23
|
+
{
|
|
24
|
+
"TS_Trends": "trend",
|
|
25
|
+
"TS_Trades": "trades",
|
|
26
|
+
"TS_Entries": "entries",
|
|
27
|
+
"TS_Exits": "exits",
|
|
28
|
+
},
|
|
29
|
+
)
|