-
Notifications
You must be signed in to change notification settings - Fork 3
/
talib_indicators.py
1054 lines (721 loc) · 28.4 KB
/
talib_indicators.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# QTPyLib: Quantitative Trading Python Library
# https://github.com/ranaroussi/qtpylib
#
# Copyright 2016-2018 Ran Aroussi
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
import sys
from pandas import Series, DataFrame
TALIB_MISSING = False
try:
import talib
except ImportError:
TALIB_MISSING = True
raise ImportError("TA-Lib is not installed on this system!")
# =============================================
# check min, python version
if sys.version_info < (3, 4):
raise SystemError("QTPyLib requires Python version >= 3.4")
# =============================================
# ---------------------------------------------
def _check_talib_presence():
if TALIB_MISSING:
raise ImportError("TA-Lib is not installed on this system!")
# ---------------------------------------------
def _extract_series(data):
values = None
if isinstance(data, Series):
values = data.values
else:
if "last" in data.columns:
values = data['last'].values
elif "close" in data.columns:
values = data['close'].values
if values is None:
raise ValueError(
"data must be Pandas Series or DataFrame with a 'last' or 'close' column")
return values
# ---------------------------------------------
def _extract_ohlc(data):
if isinstance(data, DataFrame):
if "open" in data.columns and "high" in data.columns \
and "low" in data.columns and "close" in data.columns \
and "volume" in data.columns:
return data[['open', 'high', 'low', 'close', 'volume']].T.values
raise ValueError("data must be Pandas with OLHC columns")
# ---------------------------------------------
# Overlap Studies
# ---------------------------------------------
def BBANDS(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.BBANDS(prices, **kwargs)
def DEMA(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.DEMA(prices, **kwargs)
def EMA(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.EMA(prices, **kwargs)
def HT_TRENDLINE(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.HT_TRENDLINE(prices, **kwargs)
def KAMA(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.KAMA(prices, **kwargs)
def MA(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.MA(prices, **kwargs)
def MAMA(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.MAMA(prices, **kwargs)
def MAVP(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.MAVP(prices, **kwargs)
def MIDPOINT(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.MIDPOINT(prices, **kwargs)
def MIDPRICE(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.MIDPRICE(phigh, plow, **kwargs)
def SAR(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.SAR(phigh, plow, **kwargs)
def SAREXT(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.SAREXT(prices, **kwargs)
def SMA(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.SMA(phigh, plow, **kwargs)
def T3(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.T3(prices, **kwargs)
def TEMA(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.TEMA(prices, **kwargs)
def TRIMA(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.TRIMA(prices, **kwargs)
def WMA(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.WMA(prices, **kwargs)
# ---------------------------------------------
# Momentum Indicators
# ---------------------------------------------
def ADX(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.ADX(phigh, plow, pclose, **kwargs)
def ADXR(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.ADXR(phigh, plow, pclose, **kwargs)
def APO(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.APO(prices, **kwargs)
def AROON(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.AROON(phigh, plow, **kwargs)
def AROONOSC(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.AROONOSC(phigh, plow, **kwargs)
def BOP(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.BOP(popen, phigh, plow, pclose, **kwargs)
def CCI(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CCI(phigh, plow, pclose, **kwargs)
def CMO(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.CMO(prices, **kwargs)
def DX(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.DX(phigh, plow, pclose, **kwargs)
def MACD(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.MACD(prices, **kwargs)
def MACDEXT(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.MACDEXT(prices, **kwargs)
def MACDFIX(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.MACDFIX(prices, **kwargs)
def MFI(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, pvolume = _extract_ohlc(data)
return talib.MFI(popen, phigh, plow, pclose, pvolume, **kwargs)
def MINUS_DI(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.MINUS_DI(phigh, plow, pclose, **kwargs)
def MINUS_DM(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.MINUS_DM(phigh, plow, **kwargs)
def MOM(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.MOM(prices, **kwargs)
def PLUS_DI(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.PLUS_DI(phigh, plow, pclose, **kwargs)
def PLUS_DM(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.PLUS_DM(phigh, plow, **kwargs)
def PPO(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.PPO(prices, **kwargs)
def ROC(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.ROC(prices, **kwargs)
def ROCP(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.ROCP(prices, **kwargs)
def ROCR(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.ROCR(prices, **kwargs)
def ROCR100(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.ROCR100(prices, **kwargs)
def RSI(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.RSI(prices, **kwargs)
def STOCH(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.STOCH(phigh, plow, pclose, **kwargs)
def STOCHF(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.STOCHF(phigh, plow, pclose, **kwargs)
def STOCHRSI(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.STOCHRSI(prices, **kwargs)
def TRIX(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.TRIX(prices, **kwargs)
def ULTOSC(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.ULTOSC(phigh, plow, pclose, **kwargs)
def WILLR(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.WILLR(phigh, plow, pclose, **kwargs)
# ---------------------------------------------
# Volume Indicators
# ---------------------------------------------
def AD(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, pvolume = _extract_ohlc(data)
return talib.AD(popen, phigh, plow, pclose, pvolume, **kwargs)
def ADOSC(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, pvolume = _extract_ohlc(data)
return talib.ADOSC(popen, phigh, plow, pclose, pvolume, **kwargs)
def OBV(data, **kwargs):
_check_talib_presence()
_, _, _, _, pvolume = _extract_ohlc(data)
return talib.OBV(pvolume, **kwargs)
# ---------------------------------------------
# Cycle Indicators
# ---------------------------------------------
def HT_DCPERIOD(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.HT_DCPERIOD(prices, **kwargs)
def HT_DCPHASE(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.HT_DCPHASE(prices, **kwargs)
def HT_PHASOR(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.HT_PHASOR(prices, **kwargs)
def HT_SINE(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.HT_SINE(prices, **kwargs)
def HT_TRENDMODE(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.HT_TRENDMODE(prices, **kwargs)
# ---------------------------------------------
# Price Transform
# ---------------------------------------------
def AVGPRICE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.AVGPRICE(popen, phigh, plow, pclose, **kwargs)
def MEDPRICE(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.MEDPRICE(phigh, plow, **kwargs)
def TYPPRICE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.TYPPRICE(popen, phigh, plow, pclose, **kwargs)
def WCLPRICE(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.WCLPRICE(phigh, plow, pclose, **kwargs)
# ---------------------------------------------
# Volatility Indicators
# ---------------------------------------------
def ATR(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.ATR(phigh, plow, pclose, **kwargs)
def NATR(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.NATR(phigh, plow, pclose, **kwargs)
def TRANGE(data, **kwargs):
_check_talib_presence()
_, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.TRANGE(phigh, plow, pclose, **kwargs)
# ---------------------------------------------
# Parrern Recognition
# ---------------------------------------------
def CDL2CROWS(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDL2CROWS(popen, phigh, plow, pclose, **kwargs)
def CDL3BLACKCROWS(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDL3BLACKCROWS(popen, phigh, plow, pclose, **kwargs)
def CDL3INSIDE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDL3INSIDE(popen, phigh, plow, pclose, **kwargs)
def CDL3LINESTRIKE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDL3LINESTRIKE(popen, phigh, plow, pclose, **kwargs)
def CDL3OUTSIDE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDL3OUTSIDE(popen, phigh, plow, pclose, **kwargs)
def CDL3STARSINSOUTH(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDL3STARSINSOUTH(popen, phigh, plow, pclose, **kwargs)
def CDL3WHITESOLDIERS(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDL3WHITESOLDIERS(popen, phigh, plow, pclose, **kwargs)
def CDLABANDONEDBABY(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLABANDONEDBABY(popen, phigh, plow, pclose, **kwargs)
def CDLADVANCEBLOCK(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLADVANCEBLOCK(popen, phigh, plow, pclose, **kwargs)
def CDLBELTHOLD(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLBELTHOLD(popen, phigh, plow, pclose, **kwargs)
def CDLBREAKAWAY(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLBREAKAWAY(popen, phigh, plow, pclose, **kwargs)
def CDLCLOSINGMARUBOZU(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLCLOSINGMARUBOZU(popen, phigh, plow, pclose, **kwargs)
def CDLCONCEALBABYSWALL(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLCONCEALBABYSWALL(popen, phigh, plow, pclose, **kwargs)
def CDLCOUNTERATTACK(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLCOUNTERATTACK(popen, phigh, plow, pclose, **kwargs)
def CDLDARKCLOUDCOVER(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLDARKCLOUDCOVER(popen, phigh, plow, pclose, **kwargs)
def CDLDOJI(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLDOJI(popen, phigh, plow, pclose, **kwargs)
def CDLDOJISTAR(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLDOJISTAR(popen, phigh, plow, pclose, **kwargs)
def CDLDRAGONFLYDOJI(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLDRAGONFLYDOJI(popen, phigh, plow, pclose, **kwargs)
def CDLENGULFING(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLENGULFING(popen, phigh, plow, pclose, **kwargs)
def CDLEVENINGDOJISTAR(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLEVENINGDOJISTRAR(popen, phigh, plow, pclose, **kwargs)
def CDLEVENINGSTAR(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLEVENINGSTAR(popen, phigh, plow, pclose, **kwargs)
def CDLGAPSIDESIDEWHITE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLGAPSIDESIDEWHITEITE(popen, phigh, plow, pclose, **kwargs)
def CDLGRAVESTONEDOJI(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLGRAVESTONEDOJII(popen, phigh, plow, pclose, **kwargs)
def CDLHAMMER(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLHAMMER(popen, phigh, plow, pclose, **kwargs)
def CDLHANGINGMAN(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLHANGINGMAN(popen, phigh, plow, pclose, **kwargs)
def CDLHARAMI(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLHARAMI(popen, phigh, plow, pclose, **kwargs)
def CDLHARAMICROSS(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLHARAMICROSS(popen, phigh, plow, pclose, **kwargs)
def CDLHIGHWAVE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLHIGHWAVE(popen, phigh, plow, pclose, **kwargs)
def CDLHIKKAKE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLHIKKAKE(popen, phigh, plow, pclose, **kwargs)
def CDLHIKKAKEMOD(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLHIKKAKEMOD(popen, phigh, plow, pclose, **kwargs)
def CDLHOMINGPIGEON(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLHOMINGPIGEON(popen, phigh, plow, pclose, **kwargs)
def CDLIDENTICAL3CROWS(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLIDENTICAL3CROWS(popen, phigh, plow, pclose, **kwargs)
def CDLINNECK(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLINNECK(popen, phigh, plow, pclose, **kwargs)
def CDLINVERTEDHAMMER(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLINVERTEDHAMMER(popen, phigh, plow, pclose, **kwargs)
def CDLKICKING(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLKICKING(popen, phigh, plow, pclose, **kwargs)
def CDLKICKINGBYLENGTH(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLKICKINGBYLENGTH(popen, phigh, plow, pclose, **kwargs)
def CDLLADDERBOTTOM(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLLADDERBOTTOM(popen, phigh, plow, pclose, **kwargs)
def CDLLONGLEGGEDDOJI(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLLONGLEGGEDDOJI(popen, phigh, plow, pclose, **kwargs)
def CDLLONGLINE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLLONGLINE(popen, phigh, plow, pclose, **kwargs)
def CDLMARUBOZU(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLMARUBOZU(popen, phigh, plow, pclose, **kwargs)
def CDLMATCHINGLOW(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLMATCHINGLOW(popen, phigh, plow, pclose, **kwargs)
def CDLMATHOLD(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLMATHOLD(popen, phigh, plow, pclose, **kwargs)
def CDLMORNINGDOJISTAR(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLMORNINGDOJISTAR(popen, phigh, plow, pclose, **kwargs)
def CDLMORNINGSTAR(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLMORNINGSTAR(popen, phigh, plow, pclose, **kwargs)
def CDLONNECK(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLONNECK(popen, phigh, plow, pclose, **kwargs)
def CDLPIERCING(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLPIERCING(popen, phigh, plow, pclose, **kwargs)
def CDLRICKSHAWMAN(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLRICKSHAWMAN(popen, phigh, plow, pclose, **kwargs)
def CDLRISEFALL3METHODS(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLRISEFALL3METHODS(popen, phigh, plow, pclose, **kwargs)
def CDLSEPARATINGLINES(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLSEPARATINGLINES(popen, phigh, plow, pclose, **kwargs)
def CDLSHOOTINGSTAR(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLSHOOTINGSTAR(popen, phigh, plow, pclose, **kwargs)
def CDLSHORTLINE(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLSHORTLINE(popen, phigh, plow, pclose, **kwargs)
def CDLSPINNINGTOP(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLSPINNINGTOP(popen, phigh, plow, pclose, **kwargs)
def CDLSTALLEDPATTERN(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLSTALLEDPATTERN(popen, phigh, plow, pclose, **kwargs)
def CDLSTICKSANDWICH(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLSTICKSANDWICH(popen, phigh, plow, pclose, **kwargs)
def CDLTAKURI(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLTAKURI(popen, phigh, plow, pclose, **kwargs)
def CDLTASUKIGAP(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLTASUKIGAP(popen, phigh, plow, pclose, **kwargs)
def CDLTHRUSTING(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLTHRUSTING(popen, phigh, plow, pclose, **kwargs)
def CDLTRISTAR(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLTRISTAR(popen, phigh, plow, pclose, **kwargs)
def CDLUNIQUE3RIVER(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLUNIQUE3RIVER(popen, phigh, plow, pclose, **kwargs)
def CDLUPSIDEGAP2CROWS(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLUPSIDEGAP2CROWS(popen, phigh, plow, pclose, **kwargs)
def CDLXSIDEGAP3METHODS(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, _ = _extract_ohlc(data)
return talib.CDLXSIDEGAP3METHODS(popen, phigh, plow, pclose, **kwargs)
# ---------------------------------------------
# Statistic Functions
# ---------------------------------------------
def BETA(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.BETA(phigh, plow, **kwargs)
def CORREL(data, **kwargs):
_check_talib_presence()
_, phigh, plow, _, _ = _extract_ohlc(data)
return talib.CORREL(phigh, plow, **kwargs)
def LINEARREG(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.LINEARREG(prices, **kwargs)
def LINEARREG_ANGLE(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.LINEARREG_ANGLE(prices, **kwargs)
def LINEARREG_INTERCEPT(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.LINEARREG_INTERCEPT(prices, **kwargs)
def LINEARREG_SLOPE(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.LINEARREG_SLOPE(prices, **kwargs)
def STDDEV(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.STDDEV(prices, **kwargs)
def TSF(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.TSF(prices, **kwargs)
def VAR(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.VAR(prices, **kwargs)
# ---------------------------------------------
# Math Transform
# ---------------------------------------------
def ACOS(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.ACOS(prices, **kwargs)
def ASIN(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.ASIN(prices, **kwargs)
def ATAN(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.ATAN(prices, **kwargs)
def CEIL(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.CEIL(prices, **kwargs)
def COS(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.COS(prices, **kwargs)
def COSH(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.COSH(prices, **kwargs)
def EXP(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.EXP(prices, **kwargs)
def FLOOR(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.FLOOR(prices, **kwargs)
def LN(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.LN(prices, **kwargs)
def LOG10(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.LOG10(prices, **kwargs)
def SIN(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.SIN(prices, **kwargs)
def SINH(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.SINH(prices, **kwargs)
def SQRT(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.SQRT(prices, **kwargs)
def TAN(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.TAN(prices, **kwargs)
def TANH(data, **kwargs):
_check_talib_presence()
prices = _extract_series(data)
return talib.TANH(prices, **kwargs)
# ---------------------------------------------
# Math Operators
# ---------------------------------------------
def ADD(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, pvolume = _extract_ohlc(data)
return talib.ADD(phigh, plow, **kwargs)
def DIV(data, **kwargs):
_check_talib_presence()
popen, phigh, plow, pclose, pvolume = _extract_ohlc(data)
return talib.DIV(phigh, plow, **kwargs)