openbb-technical 1.4.1__tar.gz → 1.4.2__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: openbb-technical
3
- Version: 1.4.1
3
+ Version: 1.4.2
4
4
  Summary: Technical Analysis extension for OpenBB
5
5
  License: AGPL-3.0-only
6
6
  Author: OpenBB Team
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3.9
12
12
  Classifier: Programming Language :: Python :: 3.10
13
13
  Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
- Requires-Dist: openbb-core (>=1.4.0,<2.0.0)
15
+ Requires-Dist: openbb-core (>=1.4.3,<2.0.0)
16
16
  Requires-Dist: pandas-ta-openbb (>=0.4.20,<0.5.0)
17
17
  Requires-Dist: scikit-learn (>=1.6.0,<2.0.0)
18
18
  Description-Content-Type: text/markdown
@@ -2,7 +2,7 @@
2
2
 
3
3
  # pylint: disable=too-many-lines,unused-import,too-many-arguments,too-many-positional-arguments
4
4
 
5
- from typing import Any, Dict, List, Literal, Optional
5
+ from typing import Any, Literal, Optional
6
6
 
7
7
  from openbb_core.app.model.example import APIEx, PythonEx
8
8
  from openbb_core.app.model.obbject import OBBject
@@ -59,14 +59,14 @@ router = Router(prefix="", description="Technical Analysis tools.")
59
59
  ],
60
60
  )
61
61
  async def relative_rotation(
62
- data: List[Data],
62
+ data: list[Data],
63
63
  benchmark: str,
64
64
  study: Literal["price", "volume", "volatility"] = "price",
65
65
  long_period: Optional[int] = 252,
66
66
  short_period: Optional[int] = 21,
67
67
  window: Optional[int] = 21,
68
68
  trading_periods: Optional[int] = 252,
69
- chart_params: Optional[Dict[str, Any]] = None,
69
+ chart_params: Optional[dict[str, Any]] = None,
70
70
  ) -> OBBject[RelativeRotationData]:
71
71
  """Calculate the Relative Strength Ratio and Relative Strength Momentum for a group of symbols against a benchmark.
72
72
 
@@ -177,13 +177,13 @@ async def relative_rotation(
177
177
  ],
178
178
  )
179
179
  def atr(
180
- data: List[Data],
180
+ data: list[Data],
181
181
  index: str = "date",
182
182
  length: PositiveInt = 14,
183
183
  mamode: Literal["rma", "ema", "sma", "wma"] = "rma",
184
184
  drift: NonNegativeInt = 1,
185
185
  offset: int = 0,
186
- ) -> OBBject[List[Data]]:
186
+ ) -> OBBject[list[Data]]:
187
187
  """Calculate the Average True Range.
188
188
 
189
189
  Used to measure volatility, especially volatility caused by gaps or limit moves.
@@ -196,8 +196,8 @@ def atr(
196
196
 
197
197
  Parameters
198
198
  ----------
199
- data : List[Data]
200
- List of data to apply the indicator to.
199
+ data : list[Data]
200
+ list of data to apply the indicator to.
201
201
  index : str, optional
202
202
  Index column name, by default "date"
203
203
  length : PositiveInt, optional
@@ -211,8 +211,8 @@ def atr(
211
211
 
212
212
  Returns
213
213
  -------
214
- OBBject[List[Data]]
215
- List of data with the indicator applied.
214
+ OBBject[list[Data]]
215
+ list of data with the indicator applied.
216
216
  """
217
217
  # pylint: disable=import-outside-toplevel
218
218
  import pandas as pd
@@ -245,13 +245,13 @@ def atr(
245
245
  ],
246
246
  )
247
247
  def fib(
248
- data: List[Data],
248
+ data: list[Data],
249
249
  index: str = "date",
250
250
  close_column: Literal["close", "adj_close"] = "close",
251
251
  period: PositiveInt = 120,
252
252
  start_date: Optional[str] = None,
253
253
  end_date: Optional[str] = None,
254
- ) -> OBBject[List[Data]]:
254
+ ) -> OBBject[list[Data]]:
255
255
  """Create Fibonacci Retracement Levels.
256
256
 
257
257
  This method draws from a classic technique to pinpoint significant price levels
@@ -262,8 +262,8 @@ def fib(
262
262
 
263
263
  Parameters
264
264
  ----------
265
- data : List[Data]
266
- List of data to apply the indicator to.
265
+ data : list[Data]
266
+ list of data to apply the indicator to.
267
267
  index : str, optional
268
268
  Index column name, by default "date"
269
269
  period : PositiveInt, optional
@@ -271,8 +271,8 @@ def fib(
271
271
 
272
272
  Returns
273
273
  -------
274
- OBBject[List[Data]]
275
- List of data with the indicator applied.
274
+ OBBject[list[Data]]
275
+ list of data with the indicator applied.
276
276
  """
277
277
  df = basemodel_to_df(data, index=index)
278
278
 
@@ -316,10 +316,10 @@ def fib(
316
316
  ],
317
317
  )
318
318
  def obv(
319
- data: List[Data],
319
+ data: list[Data],
320
320
  index: str = "date",
321
321
  offset: int = 0,
322
- ) -> OBBject[List[Data]]:
322
+ ) -> OBBject[list[Data]]:
323
323
  """Calculate the On Balance Volume (OBV).
324
324
 
325
325
  Is a cumulative total of the up and down volume. When the close is higher than the
@@ -333,8 +333,8 @@ def obv(
333
333
 
334
334
  Parameters
335
335
  ----------
336
- data : List[Data]
337
- List of data to apply the indicator to.
336
+ data : list[Data]
337
+ list of data to apply the indicator to.
338
338
  index : str, optional
339
339
  Index column name, by default "date"
340
340
  offset : int, optional
@@ -342,8 +342,8 @@ def obv(
342
342
 
343
343
  Returns
344
344
  -------
345
- OBBject[List[Data]]
346
- List of data with the indicator applied.
345
+ OBBject[list[Data]]
346
+ list of data with the indicator applied.
347
347
  """
348
348
  # pylint: disable=import-outside-toplevel
349
349
  import pandas as pd
@@ -373,11 +373,11 @@ def obv(
373
373
  ],
374
374
  )
375
375
  def fisher(
376
- data: List[Data],
376
+ data: list[Data],
377
377
  index: str = "date",
378
378
  length: PositiveInt = 14,
379
379
  signal: PositiveInt = 1,
380
- ) -> OBBject[List[Data]]:
380
+ ) -> OBBject[list[Data]]:
381
381
  """Perform the Fisher Transform.
382
382
 
383
383
  A technical indicator created by John F. Ehlers that converts prices into a Gaussian
@@ -388,8 +388,8 @@ def fisher(
388
388
 
389
389
  Parameters
390
390
  ----------
391
- data : List[Data]
392
- List of data to apply the indicator to.
391
+ data : list[Data]
392
+ list of data to apply the indicator to.
393
393
  index : str, optional
394
394
  Index column name, by default "date"
395
395
  length : PositiveInt, optional
@@ -399,8 +399,8 @@ def fisher(
399
399
 
400
400
  Returns
401
401
  -------
402
- OBBject[List[Data]]
403
- List of data with the indicator applied.
402
+ OBBject[list[Data]]
403
+ list of data with the indicator applied.
404
404
  """
405
405
  # pylint: disable=import-outside-toplevel
406
406
  import pandas as pd
@@ -431,12 +431,12 @@ def fisher(
431
431
  ],
432
432
  )
433
433
  def adosc(
434
- data: List[Data],
434
+ data: list[Data],
435
435
  index: str = "date",
436
436
  fast: PositiveInt = 3,
437
437
  slow: PositiveInt = 10,
438
438
  offset: int = 0,
439
- ) -> OBBject[List[Data]]:
439
+ ) -> OBBject[list[Data]]:
440
440
  """Calculate the Accumulation/Distribution Oscillator.
441
441
 
442
442
  Also known as the Chaikin Oscillator.
@@ -450,8 +450,8 @@ def adosc(
450
450
 
451
451
  Parameters
452
452
  ----------
453
- data : List[Data]
454
- List of data to be used for the calculation.
453
+ data : list[Data]
454
+ list of data to be used for the calculation.
455
455
  fast : PositiveInt, optional
456
456
  Number of periods to be used for the fast calculation, by default 3.
457
457
  slow : PositiveInt, optional
@@ -461,7 +461,7 @@ def adosc(
461
461
 
462
462
  Returns
463
463
  -------
464
- OBBject[List[Data]]
464
+ OBBject[list[Data]]
465
465
  The calculated data.
466
466
  """
467
467
  # pylint: disable=import-outside-toplevel
@@ -493,14 +493,14 @@ def adosc(
493
493
  ],
494
494
  )
495
495
  def bbands(
496
- data: List[Data],
496
+ data: list[Data],
497
497
  target: str = "close",
498
498
  index: str = "date",
499
499
  length: int = 50,
500
500
  std: NonNegativeFloat = 2,
501
501
  mamode: Literal["sma", "ema", "wma", "rma"] = "sma",
502
502
  offset: int = 0,
503
- ) -> OBBject[List[Data]]:
503
+ ) -> OBBject[list[Data]]:
504
504
  """Calculate the Bollinger Bands.
505
505
 
506
506
  Consist of three lines. The middle band is a simple moving average (generally 20
@@ -518,8 +518,8 @@ def bbands(
518
518
 
519
519
  Parameters
520
520
  ----------
521
- data : List[Data]
522
- List of data to be used for the calculation.
521
+ data : list[Data]
522
+ list of data to be used for the calculation.
523
523
  target : str
524
524
  Target column name.
525
525
  index : str, optional
@@ -535,7 +535,7 @@ def bbands(
535
535
 
536
536
  Returns
537
537
  -------
538
- OBBject[List[Data]]
538
+ OBBject[list[Data]]
539
539
  The calculated data.
540
540
  """
541
541
  # pylint: disable=import-outside-toplevel
@@ -576,12 +576,12 @@ def bbands(
576
576
  ],
577
577
  )
578
578
  def zlma(
579
- data: List[Data],
579
+ data: list[Data],
580
580
  target: str = "close",
581
581
  index: str = "date",
582
582
  length: int = 50,
583
583
  offset: int = 0,
584
- ) -> OBBject[List[Data]]:
584
+ ) -> OBBject[list[Data]]:
585
585
  """Calculate the zero lag exponential moving average (ZLEMA).
586
586
 
587
587
  Created by John Ehlers and Ric Way. The idea is do a
@@ -593,8 +593,8 @@ def zlma(
593
593
 
594
594
  Parameters
595
595
  ----------
596
- data : List[Data]
597
- List of data to be used for the calculation.
596
+ data : list[Data]
597
+ list of data to be used for the calculation.
598
598
  target : str
599
599
  Target column name.
600
600
  index : str, optional
@@ -606,7 +606,7 @@ def zlma(
606
606
 
607
607
  Returns
608
608
  -------
609
- OBBject[List[Data]]
609
+ OBBject[list[Data]]
610
610
  The calculated data.
611
611
  """
612
612
  # pylint: disable=import-outside-toplevel
@@ -645,11 +645,11 @@ def zlma(
645
645
  ],
646
646
  )
647
647
  def aroon(
648
- data: List[Data],
648
+ data: list[Data],
649
649
  index: str = "date",
650
650
  length: int = 25,
651
651
  scalar: float = 100,
652
- ) -> OBBject[List[Data]]:
652
+ ) -> OBBject[list[Data]]:
653
653
  """Calculate the Aroon Indicator.
654
654
 
655
655
  The word aroon is Sanskrit for "dawn's early light." The Aroon
@@ -666,8 +666,8 @@ def aroon(
666
666
 
667
667
  Parameters
668
668
  ----------
669
- data : List[Data]
670
- List of data to be used for the calculation.
669
+ data : list[Data]
670
+ list of data to be used for the calculation.
671
671
  index: str, optional
672
672
  Index column name to use with `data`, by default "date".
673
673
  length : int, optional
@@ -677,7 +677,7 @@ def aroon(
677
677
 
678
678
  Returns
679
679
  -------
680
- OBBject[List[Data]]
680
+ OBBject[list[Data]]
681
681
  The calculated data.
682
682
  """
683
683
  # pylint: disable=import-outside-toplevel
@@ -709,12 +709,12 @@ def aroon(
709
709
  ],
710
710
  )
711
711
  def sma(
712
- data: List[Data],
712
+ data: list[Data],
713
713
  target: str = "close",
714
714
  index: str = "date",
715
715
  length: int = 50,
716
716
  offset: int = 0,
717
- ) -> OBBject[List[Data]]:
717
+ ) -> OBBject[list[Data]]:
718
718
  """Calculate the Simple Moving Average (SMA).
719
719
 
720
720
  Moving Averages are used to smooth the data in an array to
@@ -727,8 +727,8 @@ def sma(
727
727
 
728
728
  Parameters
729
729
  ----------
730
- data : List[Data]
731
- List of data to be used for the calculation.
730
+ data : list[Data]
731
+ list of data to be used for the calculation.
732
732
  target : str
733
733
  Target column name.
734
734
  index : str, optional
@@ -740,7 +740,7 @@ def sma(
740
740
 
741
741
  Returns
742
742
  -------
743
- OBBject[List[Data]]
743
+ OBBject[list[Data]]
744
744
  The calculated data.
745
745
  """
746
746
  # pylint: disable=import-outside-toplevel
@@ -779,13 +779,13 @@ def sma(
779
779
  ],
780
780
  )
781
781
  def demark(
782
- data: List[Data],
782
+ data: list[Data],
783
783
  index: str = "date",
784
784
  target: str = "close",
785
785
  show_all: bool = True,
786
786
  asint: bool = True,
787
787
  offset: int = 0,
788
- ) -> OBBject[List[Data]]:
788
+ ) -> OBBject[list[Data]]:
789
789
  """Calculate the Demark sequential indicator.
790
790
 
791
791
  This indicator offers a strategic way to spot potential reversals in market trends.
@@ -796,8 +796,8 @@ def demark(
796
796
 
797
797
  Parameters
798
798
  ----------
799
- data : List[Data]
800
- List of data to be used for the calculation.
799
+ data : list[Data]
800
+ list of data to be used for the calculation.
801
801
  index : str, optional
802
802
  Index column name to use with `data`, by default "date".
803
803
  target : str, optional
@@ -811,7 +811,7 @@ def demark(
811
811
 
812
812
  Returns
813
813
  -------
814
- OBBject[List[Data]]
814
+ OBBject[list[Data]]
815
815
  The calculated data, with fields: [{index}, {target}, "up", "down"]
816
816
  """
817
817
  # pylint: disable=import-outside-toplevel
@@ -842,11 +842,11 @@ def demark(
842
842
  ],
843
843
  )
844
844
  def vwap(
845
- data: List[Data],
845
+ data: list[Data],
846
846
  index: str = "date",
847
847
  anchor: str = "D",
848
848
  offset: int = 0,
849
- ) -> OBBject[List[Data]]:
849
+ ) -> OBBject[list[Data]]:
850
850
  """Calculate the Volume Weighted Average Price (VWAP).
851
851
 
852
852
  Measures the average typical price by volume.
@@ -856,8 +856,8 @@ def vwap(
856
856
 
857
857
  Parameters
858
858
  ----------
859
- data : List[Data]
860
- List of data to be used for the calculation.
859
+ data : list[Data]
860
+ list of data to be used for the calculation.
861
861
  index : str, optional
862
862
  Index column name to use with `data`, by default "date".
863
863
  anchor : str, optional
@@ -869,7 +869,7 @@ def vwap(
869
869
 
870
870
  Returns
871
871
  -------
872
- OBBject[List[Data]]
872
+ OBBject[list[Data]]
873
873
  The calculated data.
874
874
  """
875
875
  # pylint: disable=import-outside-toplevel
@@ -910,13 +910,13 @@ def vwap(
910
910
  ],
911
911
  )
912
912
  def macd(
913
- data: List[Data],
913
+ data: list[Data],
914
914
  target: str = "close",
915
915
  index: str = "date",
916
916
  fast: int = 12,
917
917
  slow: int = 26,
918
918
  signal: int = 9,
919
- ) -> OBBject[List[Data]]:
919
+ ) -> OBBject[list[Data]]:
920
920
  """Calculate the Moving Average Convergence Divergence (MACD).
921
921
 
922
922
  Difference between two Exponential Moving Averages. The Signal line is an
@@ -932,8 +932,8 @@ def macd(
932
932
 
933
933
  Parameters
934
934
  ----------
935
- data : List[Data]
936
- List of data to be used for the calculation.
935
+ data : list[Data]
936
+ list of data to be used for the calculation.
937
937
  target : str
938
938
  Target column name.
939
939
  fast : int, optional
@@ -945,7 +945,7 @@ def macd(
945
945
 
946
946
  Returns
947
947
  -------
948
- OBBject[List[Data]]
948
+ OBBject[list[Data]]
949
949
  The calculated data.
950
950
  """
951
951
  # pylint: disable=import-outside-toplevel
@@ -983,12 +983,12 @@ def macd(
983
983
  ],
984
984
  )
985
985
  def hma(
986
- data: List[Data],
986
+ data: list[Data],
987
987
  target: str = "close",
988
988
  index: str = "date",
989
989
  length: int = 50,
990
990
  offset: int = 0,
991
- ) -> OBBject[List[Data]]:
991
+ ) -> OBBject[list[Data]]:
992
992
  """Calculate the Hull Moving Average (HMA).
993
993
 
994
994
  Solves the age old dilemma of making a moving average more responsive to current
@@ -998,8 +998,8 @@ def hma(
998
998
 
999
999
  Parameters
1000
1000
  ----------
1001
- data : List[Data]
1002
- List of data to be used for the calculation.
1001
+ data : list[Data]
1002
+ list of data to be used for the calculation.
1003
1003
  target : str
1004
1004
  Target column name.
1005
1005
  index : str, optional
@@ -1011,7 +1011,7 @@ def hma(
1011
1011
 
1012
1012
  Returns
1013
1013
  -------
1014
- OBBject[List[Data]]
1014
+ OBBject[list[Data]]
1015
1015
  The calculated data.
1016
1016
  """
1017
1017
  # pylint: disable=import-outside-toplevel
@@ -1056,12 +1056,12 @@ def hma(
1056
1056
  ],
1057
1057
  )
1058
1058
  def donchian(
1059
- data: List[Data],
1059
+ data: list[Data],
1060
1060
  index: str = "date",
1061
1061
  lower_length: PositiveInt = 20,
1062
1062
  upper_length: PositiveInt = 20,
1063
1063
  offset: int = 0,
1064
- ) -> OBBject[List[Data]]:
1064
+ ) -> OBBject[list[Data]]:
1065
1065
  """Calculate the Donchian Channels.
1066
1066
 
1067
1067
  Three lines generated by moving average calculations that comprise an indicator
@@ -1072,8 +1072,8 @@ def donchian(
1072
1072
 
1073
1073
  Parameters
1074
1074
  ----------
1075
- data : List[Data]
1076
- List of data to be used for the calculation.
1075
+ data : list[Data]
1076
+ list of data to be used for the calculation.
1077
1077
  index : str, optional
1078
1078
  Index column name to use with `data`, by default "date".
1079
1079
  lower_length : PositiveInt, optional
@@ -1085,7 +1085,7 @@ def donchian(
1085
1085
 
1086
1086
  Returns
1087
1087
  -------
1088
- OBBject[List[Data]]
1088
+ OBBject[list[Data]]
1089
1089
  The calculated data.
1090
1090
  """
1091
1091
  # pylint: disable=import-outside-toplevel
@@ -1120,14 +1120,14 @@ def donchian(
1120
1120
  ],
1121
1121
  )
1122
1122
  def ichimoku(
1123
- data: List[Data],
1123
+ data: list[Data],
1124
1124
  index: str = "date",
1125
1125
  conversion: PositiveInt = 9,
1126
1126
  base: PositiveInt = 26,
1127
1127
  lagging: PositiveInt = 52,
1128
1128
  offset: PositiveInt = 26,
1129
1129
  lookahead: bool = False,
1130
- ) -> OBBject[List[Data]]:
1130
+ ) -> OBBject[list[Data]]:
1131
1131
  """Calculate the Ichimoku Cloud.
1132
1132
 
1133
1133
  Also known as Ichimoku Kinko Hyo, is a versatile indicator that defines support and
@@ -1138,8 +1138,8 @@ def ichimoku(
1138
1138
 
1139
1139
  Parameters
1140
1140
  ----------
1141
- data : List[Data]
1142
- List of data to be used for the calculation.
1141
+ data : list[Data]
1142
+ list of data to be used for the calculation.
1143
1143
  index : str, optional
1144
1144
  Index column name to use with `data`, by default "date".
1145
1145
  conversion : PositiveInt, optional
@@ -1155,7 +1155,7 @@ def ichimoku(
1155
1155
 
1156
1156
  Returns
1157
1157
  -------
1158
- OBBject[List[Data]]
1158
+ OBBject[list[Data]]
1159
1159
  The calculated data.
1160
1160
  """
1161
1161
  validate_data(data, [conversion, base, lagging])
@@ -1191,11 +1191,11 @@ def ichimoku(
1191
1191
  ],
1192
1192
  )
1193
1193
  def clenow(
1194
- data: List[Data],
1194
+ data: list[Data],
1195
1195
  index: str = "date",
1196
1196
  target: str = "close",
1197
1197
  period: PositiveInt = 90,
1198
- ) -> OBBject[List[Data]]:
1198
+ ) -> OBBject[list[Data]]:
1199
1199
  """Calculate the Clenow Volatility Adjusted Momentum.
1200
1200
 
1201
1201
  The Clenow Volatility Adjusted Momentum is a sophisticated approach to understanding market momentum with a twist.
@@ -1204,8 +1204,8 @@ def clenow(
1204
1204
 
1205
1205
  Parameters
1206
1206
  ----------
1207
- data : List[Data]
1208
- List of data to be used for the calculation.
1207
+ data : list[Data]
1208
+ list of data to be used for the calculation.
1209
1209
  index : str, optional
1210
1210
  Index column name to use with `data`, by default "date".
1211
1211
  target : str, optional
@@ -1215,7 +1215,7 @@ def clenow(
1215
1215
 
1216
1216
  Returns
1217
1217
  -------
1218
- OBBject[List[Data]]
1218
+ OBBject[list[Data]]
1219
1219
  The calculated data.
1220
1220
  """
1221
1221
  # pylint: disable=import-outside-toplevel
@@ -1256,7 +1256,7 @@ def clenow(
1256
1256
  APIEx(parameters={"data": APIEx.mock_data("timeseries")}),
1257
1257
  ],
1258
1258
  )
1259
- def ad(data: List[Data], index: str = "date", offset: int = 0) -> OBBject[List[Data]]:
1259
+ def ad(data: list[Data], index: str = "date", offset: int = 0) -> OBBject[list[Data]]:
1260
1260
  """Calculate the Accumulation/Distribution Line.
1261
1261
 
1262
1262
  Similar to the On Balance Volume (OBV).
@@ -1274,8 +1274,8 @@ def ad(data: List[Data], index: str = "date", offset: int = 0) -> OBBject[List[D
1274
1274
 
1275
1275
  Parameters
1276
1276
  ----------
1277
- data : List[Data]
1278
- List of data to be used for the calculation.
1277
+ data : list[Data]
1278
+ list of data to be used for the calculation.
1279
1279
  index : str, optional
1280
1280
  Index column name to use with `data`, by default "date".
1281
1281
  offset : int, optional
@@ -1283,7 +1283,7 @@ def ad(data: List[Data], index: str = "date", offset: int = 0) -> OBBject[List[D
1283
1283
 
1284
1284
  Returns
1285
1285
  -------
1286
- OBBject[List[Data]]
1286
+ OBBject[list[Data]]
1287
1287
  The calculated data.
1288
1288
  """
1289
1289
  # pylint: disable=import-outside-toplevel
@@ -1314,12 +1314,12 @@ def ad(data: List[Data], index: str = "date", offset: int = 0) -> OBBject[List[D
1314
1314
  ],
1315
1315
  )
1316
1316
  def adx(
1317
- data: List[Data],
1317
+ data: list[Data],
1318
1318
  index: str = "date",
1319
1319
  length: int = 50,
1320
1320
  scalar: float = 100.0,
1321
1321
  drift: int = 1,
1322
- ) -> OBBject[List[Data]]:
1322
+ ) -> OBBject[list[Data]]:
1323
1323
  """Calculate the Average Directional Index (ADX).
1324
1324
 
1325
1325
  The ADX is a Welles Wilder style moving average of the Directional Movement Index (DX).
@@ -1328,8 +1328,8 @@ def adx(
1328
1328
 
1329
1329
  Parameters
1330
1330
  ----------
1331
- data : List[Data]
1332
- List of data to be used for the calculation.
1331
+ data : list[Data]
1332
+ list of data to be used for the calculation.
1333
1333
  index : str, optional
1334
1334
  Index column name to use with `data`, by default "date".
1335
1335
  length : int, optional
@@ -1341,7 +1341,7 @@ def adx(
1341
1341
 
1342
1342
  Returns
1343
1343
  -------
1344
- OBBject[List[Data]]
1344
+ OBBject[list[Data]]
1345
1345
  The calculated data.
1346
1346
  """
1347
1347
  # pylint: disable=import-outside-toplevel
@@ -1375,12 +1375,12 @@ def adx(
1375
1375
  ],
1376
1376
  )
1377
1377
  def wma(
1378
- data: List[Data],
1378
+ data: list[Data],
1379
1379
  target: str = "close",
1380
1380
  index: str = "date",
1381
1381
  length: int = 50,
1382
1382
  offset: int = 0,
1383
- ) -> OBBject[List[Data]]:
1383
+ ) -> OBBject[list[Data]]:
1384
1384
  """Calculate the Weighted Moving Average (WMA).
1385
1385
 
1386
1386
  A Weighted Moving Average puts more weight on recent data and less on past data.
@@ -1390,7 +1390,7 @@ def wma(
1390
1390
 
1391
1391
  Parameters
1392
1392
  ----------
1393
- data : List[Data]
1393
+ data : list[Data]
1394
1394
  The data to use for the calculation.
1395
1395
  target : str
1396
1396
  Target column name.
@@ -1403,7 +1403,7 @@ def wma(
1403
1403
 
1404
1404
  Returns
1405
1405
  -------
1406
- OBBject[List[Data]]
1406
+ OBBject[list[Data]]
1407
1407
  The WMA data.
1408
1408
  """
1409
1409
  # pylint: disable=import-outside-toplevel
@@ -1442,11 +1442,11 @@ def wma(
1442
1442
  ],
1443
1443
  )
1444
1444
  def cci(
1445
- data: List[Data],
1445
+ data: list[Data],
1446
1446
  index: str = "date",
1447
1447
  length: PositiveInt = 14,
1448
1448
  scalar: PositiveFloat = 0.015,
1449
- ) -> OBBject[List[Data]]:
1449
+ ) -> OBBject[list[Data]]:
1450
1450
  """Calculate the Commodity Channel Index (CCI).
1451
1451
 
1452
1452
  The CCI is designed to detect beginning and ending market trends.
@@ -1457,7 +1457,7 @@ def cci(
1457
1457
 
1458
1458
  Parameters
1459
1459
  ----------
1460
- data : List[Data]
1460
+ data : list[Data]
1461
1461
  The data to use for the CCI calculation.
1462
1462
  index : str, optional
1463
1463
  Index column name to use with `data`, by default "date".
@@ -1468,7 +1468,7 @@ def cci(
1468
1468
 
1469
1469
  Returns
1470
1470
  -------
1471
- OBBject[List[Data]]
1471
+ OBBject[list[Data]]
1472
1472
  The CCI data.
1473
1473
  """
1474
1474
  # pylint: disable=import-outside-toplevel
@@ -1500,13 +1500,13 @@ def cci(
1500
1500
  ],
1501
1501
  )
1502
1502
  def rsi(
1503
- data: List[Data],
1503
+ data: list[Data],
1504
1504
  target: str = "close",
1505
1505
  index: str = "date",
1506
1506
  length: int = 14,
1507
1507
  scalar: float = 100.0,
1508
1508
  drift: int = 1,
1509
- ) -> OBBject[List[Data]]:
1509
+ ) -> OBBject[list[Data]]:
1510
1510
  """Calculate the Relative Strength Index (RSI).
1511
1511
 
1512
1512
  RSI calculates a ratio of the recent upward price movements to the absolute price
@@ -1517,7 +1517,7 @@ def rsi(
1517
1517
 
1518
1518
  Parameters
1519
1519
  ----------
1520
- data : List[Data]
1520
+ data : list[Data]
1521
1521
  The data to use for the RSI calculation.
1522
1522
  target : str
1523
1523
  Target column name.
@@ -1532,7 +1532,7 @@ def rsi(
1532
1532
 
1533
1533
  Returns
1534
1534
  -------
1535
- OBBject[List[Data]]
1535
+ OBBject[list[Data]]
1536
1536
  The RSI data.
1537
1537
  """
1538
1538
  # pylint: disable=import-outside-toplevel
@@ -1571,12 +1571,12 @@ def rsi(
1571
1571
  ],
1572
1572
  )
1573
1573
  def stoch(
1574
- data: List[Data],
1574
+ data: list[Data],
1575
1575
  index: str = "date",
1576
1576
  fast_k_period: NonNegativeInt = 14,
1577
1577
  slow_d_period: NonNegativeInt = 3,
1578
1578
  slow_k_period: NonNegativeInt = 3,
1579
- ) -> OBBject[List[Data]]:
1579
+ ) -> OBBject[list[Data]]:
1580
1580
  """Calculate the Stochastic Oscillator.
1581
1581
 
1582
1582
  The Stochastic Oscillator measures where the close is in relation
@@ -1588,7 +1588,7 @@ def stoch(
1588
1588
 
1589
1589
  Parameters
1590
1590
  ----------
1591
- data : List[Data]
1591
+ data : list[Data]
1592
1592
  The data to use for the Stochastic Oscillator calculation.
1593
1593
  index : str, optional
1594
1594
  Index column name to use with `data`, by default "date".
@@ -1601,7 +1601,7 @@ def stoch(
1601
1601
 
1602
1602
  Returns
1603
1603
  -------
1604
- OBBject[List[Data]]
1604
+ OBBject[list[Data]]
1605
1605
  The Stochastic Oscillator data.
1606
1606
  """
1607
1607
  # pylint: disable=import-outside-toplevel
@@ -1639,13 +1639,13 @@ def stoch(
1639
1639
  ],
1640
1640
  )
1641
1641
  def kc(
1642
- data: List[Data],
1642
+ data: list[Data],
1643
1643
  index: str = "date",
1644
1644
  length: PositiveInt = 20,
1645
1645
  scalar: PositiveFloat = 20,
1646
1646
  mamode: Literal["ema", "sma", "wma", "hma", "zlma"] = "ema",
1647
1647
  offset: NonNegativeInt = 0,
1648
- ) -> OBBject[List[Data]]:
1648
+ ) -> OBBject[list[Data]]:
1649
1649
  """Calculate the Keltner Channels.
1650
1650
 
1651
1651
  Keltner Channels are volatility-based bands that are placed
@@ -1656,7 +1656,7 @@ def kc(
1656
1656
 
1657
1657
  Parameters
1658
1658
  ----------
1659
- data : List[Data]
1659
+ data : list[Data]
1660
1660
  The data to use for the Keltner Channels calculation.
1661
1661
  index : str, optional
1662
1662
  Index column name to use with `data`, by default "date"
@@ -1671,7 +1671,7 @@ def kc(
1671
1671
 
1672
1672
  Returns
1673
1673
  -------
1674
- OBBject[List[Data]]
1674
+ OBBject[list[Data]]
1675
1675
  The Keltner Channels data.
1676
1676
  """
1677
1677
  # pylint: disable=import-outside-toplevel
@@ -1709,8 +1709,8 @@ def kc(
1709
1709
  ],
1710
1710
  )
1711
1711
  def cg(
1712
- data: List[Data], index: str = "date", length: PositiveInt = 14
1713
- ) -> OBBject[List[Data]]:
1712
+ data: list[Data], index: str = "date", length: PositiveInt = 14
1713
+ ) -> OBBject[list[Data]]:
1714
1714
  """Calculate the Center of Gravity.
1715
1715
 
1716
1716
  The Center of Gravity indicator, in short, is used to anticipate future price movements
@@ -1721,7 +1721,7 @@ def cg(
1721
1721
 
1722
1722
  Parameters
1723
1723
  ----------
1724
- data : List[Data]
1724
+ data : list[Data]
1725
1725
  The data to use for the COG calculation.
1726
1726
  index : str, optional
1727
1727
  Index column name to use with `data`, by default "date"
@@ -1730,7 +1730,7 @@ def cg(
1730
1730
 
1731
1731
  Returns
1732
1732
  -------
1733
- OBBject[List[Data]]
1733
+ OBBject[list[Data]]
1734
1734
  The COG data.
1735
1735
  """
1736
1736
  # pylint: disable=import-outside-toplevel
@@ -1762,7 +1762,7 @@ def cg(
1762
1762
  ],
1763
1763
  )
1764
1764
  def cones(
1765
- data: List[Data],
1765
+ data: list[Data],
1766
1766
  index: str = "date",
1767
1767
  lower_q: float = 0.25,
1768
1768
  upper_q: float = 0.75,
@@ -1776,7 +1776,7 @@ def cones(
1776
1776
  ] = "std",
1777
1777
  is_crypto: bool = False,
1778
1778
  trading_periods: Optional[int] = None,
1779
- ) -> OBBject[List[Data]]:
1779
+ ) -> OBBject[list[Data]]:
1780
1780
  """Calculate the realized volatility quantiles over rolling windows of time.
1781
1781
 
1782
1782
  The cones indicator is designed to map out the ebb and flow of price movements through a detailed analysis of
@@ -1795,7 +1795,7 @@ def cones(
1795
1795
 
1796
1796
  Parameters
1797
1797
  ----------
1798
- data : List[Data]
1798
+ data : list[Data]
1799
1799
  The data to use for the calculation.
1800
1800
  index : str, optional
1801
1801
  Index column name to use with `data`, by default "date"
@@ -1832,7 +1832,7 @@ def cones(
1832
1832
 
1833
1833
  Returns
1834
1834
  -------
1835
- OBBject[List[Data]]
1835
+ OBBject[list[Data]]
1836
1836
  The cones data.
1837
1837
  """
1838
1838
  if lower_q > upper_q:
@@ -1866,12 +1866,12 @@ def cones(
1866
1866
  ],
1867
1867
  )
1868
1868
  def ema(
1869
- data: List[Data],
1869
+ data: list[Data],
1870
1870
  target: str = "close",
1871
1871
  index: str = "date",
1872
1872
  length: int = 50,
1873
1873
  offset: int = 0,
1874
- ) -> OBBject[List[Data]]:
1874
+ ) -> OBBject[list[Data]]:
1875
1875
  """Calculate the Exponential Moving Average (EMA).
1876
1876
 
1877
1877
  EMA is a cumulative calculation, including all data. Past values have
@@ -1881,7 +1881,7 @@ def ema(
1881
1881
 
1882
1882
  Parameters
1883
1883
  ----------
1884
- data : List[Data]
1884
+ data : list[Data]
1885
1885
  The data to use for the calculation.
1886
1886
  target : str
1887
1887
  Target column name.
@@ -1894,7 +1894,7 @@ def ema(
1894
1894
 
1895
1895
  Returns
1896
1896
  -------
1897
- OBBject[List[Data]]
1897
+ OBBject[list[Data]]
1898
1898
  The calculated data.
1899
1899
  """
1900
1900
  # pylint: disable=import-outside-toplevel
@@ -2,7 +2,7 @@
2
2
 
3
3
  # pylint: disable=too-many-locals,use-dict-literal
4
4
 
5
- from typing import TYPE_CHECKING, Any, Dict, Tuple
5
+ from typing import TYPE_CHECKING, Any
6
6
 
7
7
  from openbb_charting.core.to_chart import to_chart
8
8
  from openbb_charting.styles.colors import LARGE_CYCLER
@@ -15,42 +15,42 @@ class TechnicalViews:
15
15
  """Technical Views."""
16
16
 
17
17
  @staticmethod
18
- def technical_sma(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
18
+ def technical_sma(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
19
19
  """Plot simple moving average chart."""
20
20
  if "ma_type" not in kwargs:
21
21
  kwargs["ma_type"] = "sma"
22
22
  return _ta_ma(**kwargs)
23
23
 
24
24
  @staticmethod
25
- def technical_ema(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
25
+ def technical_ema(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
26
26
  """Exponential moving average chart."""
27
27
  if "ma_type" not in kwargs:
28
28
  kwargs["ma_type"] = "ema"
29
29
  return _ta_ma(**kwargs)
30
30
 
31
31
  @staticmethod
32
- def technical_hma(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
32
+ def technical_hma(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
33
33
  """Hull moving average chart."""
34
34
  if "ma_type" not in kwargs:
35
35
  kwargs["ma_type"] = "hma"
36
36
  return _ta_ma(**kwargs)
37
37
 
38
38
  @staticmethod
39
- def technical_wma(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
39
+ def technical_wma(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
40
40
  """Weighted moving average chart."""
41
41
  if "ma_type" not in kwargs:
42
42
  kwargs["ma_type"] = "wma"
43
43
  return _ta_ma(**kwargs)
44
44
 
45
45
  @staticmethod
46
- def technical_zlma(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
46
+ def technical_zlma(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
47
47
  """Zero lag moving average chart."""
48
48
  if "ma_type" not in kwargs:
49
49
  kwargs["ma_type"] = "zlma"
50
50
  return _ta_ma(**kwargs)
51
51
 
52
52
  @staticmethod
53
- def technical_aroon(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
53
+ def technical_aroon(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
54
54
  """Technical Aroon Chart."""
55
55
  # pylint: disable=import-outside-toplevel
56
56
  from openbb_charting.core.plotly_ta.ta_class import PlotlyTA
@@ -95,7 +95,7 @@ class TechnicalViews:
95
95
  return fig, content
96
96
 
97
97
  @staticmethod
98
- def technical_macd(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
98
+ def technical_macd(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
99
99
  """Plot moving average convergence divergence chart."""
100
100
  # pylint: disable=import-outside-toplevel
101
101
  from openbb_charting.core.plotly_ta.ta_class import PlotlyTA
@@ -138,7 +138,7 @@ class TechnicalViews:
138
138
  return fig, content
139
139
 
140
140
  @staticmethod
141
- def technical_adx(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
141
+ def technical_adx(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
142
142
  """Average directional movement index chart."""
143
143
  # pylint: disable=import-outside-toplevel
144
144
  from openbb_charting.core.plotly_ta.ta_class import PlotlyTA
@@ -178,7 +178,7 @@ class TechnicalViews:
178
178
  return fig, content
179
179
 
180
180
  @staticmethod
181
- def technical_rsi(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
181
+ def technical_rsi(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
182
182
  """Relative strength index chart."""
183
183
  # pylint: disable=import-outside-toplevel
184
184
  from openbb_charting.core.plotly_ta.ta_class import PlotlyTA
@@ -218,7 +218,7 @@ class TechnicalViews:
218
218
  return fig, content
219
219
 
220
220
  @staticmethod
221
- def technical_cones(**kwargs) -> Tuple["OpenBBFigure", Dict[str, Any]]:
221
+ def technical_cones(**kwargs) -> tuple["OpenBBFigure", dict[str, Any]]:
222
222
  """Volatility Cones Chart."""
223
223
  # pylint: disable=import-outside-toplevel
224
224
  from openbb_charting.core.chart_style import ChartStyle
@@ -337,7 +337,7 @@ class TechnicalViews:
337
337
  @staticmethod
338
338
  def technical_relative_rotation(
339
339
  **kwargs: Any,
340
- ) -> Tuple["OpenBBFigure", Dict[str, Any]]:
340
+ ) -> tuple["OpenBBFigure", dict[str, Any]]:
341
341
  """Relative Rotation Chart."""
342
342
  # pylint: disable=import-outside-toplevel
343
343
  from openbb_charting.charts import relative_rotation # noqa
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "openbb-technical"
3
- version = "1.4.1"
3
+ version = "1.4.2"
4
4
  description = "Technical Analysis extension for OpenBB"
5
5
  authors = ["OpenBB Team <hello@openbb.co>"]
6
6
  license = "AGPL-3.0-only"
@@ -9,7 +9,7 @@ packages = [{ include = "openbb_technical" }]
9
9
 
10
10
  [tool.poetry.dependencies]
11
11
  python = ">=3.9,<3.13"
12
- openbb-core = "^1.4.0"
12
+ openbb-core = "^1.4.3"
13
13
  pandas-ta-openbb = "^0.4.20"
14
14
  scikit-learn = "^1.6.0"
15
15