siat 3.1.22__py3-none-any.whl → 3.1.23__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.
siat/stock_technical.py
CHANGED
@@ -183,7 +183,8 @@ def calc_technical(df,start,end, \
|
|
183
183
|
CCI_days=14, \
|
184
184
|
WR_days=[10,6], \
|
185
185
|
ROC_day=12,ROC_madays=6, \
|
186
|
-
DMI_DIdays=14,DMI_ADXdays=6
|
186
|
+
DMI_DIdays=14,DMI_ADXdays=6, \
|
187
|
+
more_details=False):
|
187
188
|
"""
|
188
189
|
功能:计算股票的技术分析指标
|
189
190
|
输入:df,四种股价Open/Close/High/Low,成交量Volume
|
@@ -222,6 +223,7 @@ def calc_technical(df,start,end, \
|
|
222
223
|
RSI_days=[RSI_days]
|
223
224
|
for d in RSI_days:
|
224
225
|
df['rsi'+str(d)] = talib.RSI(df['Close'], timeperiod=d)
|
226
|
+
#注意:rsi1没有意义
|
225
227
|
|
226
228
|
#=========== OBV:能量潮
|
227
229
|
"""
|
@@ -258,8 +260,9 @@ def calc_technical(df,start,end, \
|
|
258
260
|
OBV_days=[OBV_days]
|
259
261
|
for d in OBV_days:
|
260
262
|
df['obv_ma'+str(d)] = talib.MA(df['obv'],timeperiod=d)
|
261
|
-
|
262
|
-
|
263
|
+
|
264
|
+
if not more_details:
|
265
|
+
df.drop(columns = ['obv'],inplace=True)
|
263
266
|
|
264
267
|
#=========== MA: 简单、加权移动平均
|
265
268
|
"""
|
@@ -435,7 +438,11 @@ def calc_technical(df,start,end, \
|
|
435
438
|
for d in CR_madays:
|
436
439
|
df['cr_ma'+str(d)] = talib.MA(df['cr'],timeperiod=d)
|
437
440
|
|
438
|
-
|
441
|
+
if more_details:
|
442
|
+
#保留cr
|
443
|
+
df.drop(columns = ['m_price','h_m','m_l','h_m_sum','m_l_sum'],inplace=True)
|
444
|
+
else:
|
445
|
+
df.drop(columns = ['m_price','h_m','m_l','h_m_sum','m_l_sum','cr'],inplace=True)
|
439
446
|
|
440
447
|
#=========== EMV: 简易波动指标
|
441
448
|
"""
|
@@ -506,8 +513,10 @@ def calc_technical(df,start,end, \
|
|
506
513
|
TRIX_madays=[TRIX_madays]
|
507
514
|
for d in TRIX_madays:
|
508
515
|
df['trix_ma'+str(d)] = talib.MA(df['trix'],timeperiod=d)
|
509
|
-
|
510
|
-
|
516
|
+
|
517
|
+
if not more_details:
|
518
|
+
#不保留TRIX
|
519
|
+
df.drop(columns = ['trix'],inplace=True)
|
511
520
|
|
512
521
|
#=========== DMA: 平均线差
|
513
522
|
"""
|
@@ -529,6 +538,7 @@ def calc_technical(df,start,end, \
|
|
529
538
|
DMA_madays=[DMA_madays]
|
530
539
|
for d in DMA_madays:
|
531
540
|
df['dma'+str(d)] = talib.MA(df['ddd'],timeperiod=d)
|
541
|
+
#注意:dma1似乎没有意义
|
532
542
|
|
533
543
|
df.drop(columns = ['ma_shortperiod','ma_longperiod','ddd'],inplace=True)
|
534
544
|
|
@@ -559,7 +569,7 @@ def calc_technical(df,start,end, \
|
|
559
569
|
CCI_days=[CCI_days]
|
560
570
|
for d in CCI_days:
|
561
571
|
df['cci'+str(d)] = talib.CCI(df['High'],df['Low'],df['Close'],timeperiod=d)
|
562
|
-
|
572
|
+
|
563
573
|
#=========== W%R: 威廉指标
|
564
574
|
"""
|
565
575
|
N日W%R = [(Hn-Ct)/(Hn-Ln)]*100
|
@@ -599,8 +609,11 @@ def calc_technical(df,start,end, \
|
|
599
609
|
ROC_madays=[ROC_madays]
|
600
610
|
for d in ROC_madays:
|
601
611
|
df['roc_ma'+str(d)] = talib.MA(df['roc'],timeperiod=d)
|
612
|
+
|
613
|
+
if not more_details:
|
614
|
+
#不保留roc
|
615
|
+
df.drop(columns = ['roc'],inplace=True)
|
602
616
|
|
603
|
-
df.drop(columns = ['roc'],inplace=True)
|
604
617
|
#=========== DMI: 趋向指标
|
605
618
|
"""
|
606
619
|
|
@@ -2452,7 +2465,9 @@ def security_technical2(ticker,start='default',end='default', \
|
|
2452
2465
|
ticker_type='auto', \
|
2453
2466
|
|
2454
2467
|
attention_values=[0,30,50,80], \
|
2455
|
-
facecolor='papayawhip',price_line_color='red'
|
2468
|
+
facecolor='papayawhip',price_line_color='red', \
|
2469
|
+
|
2470
|
+
more_details=False):
|
2456
2471
|
"""
|
2457
2472
|
|
2458
2473
|
功能:计算和绘制证券技术分析指标的简易图,仅供进一步探索使用,仅用于单个证券(股债基)
|
@@ -2542,7 +2557,9 @@ def security_technical2(ticker,start='default',end='default', \
|
|
2542
2557
|
CCI_days=CCI_days, \
|
2543
2558
|
WR_days=WR_days, \
|
2544
2559
|
ROC_day=ROC_day,ROC_madays=ROC_madays, \
|
2545
|
-
DMI_DIdays=DMI_DIdays,DMI_ADXdays=DMI_ADXdays
|
2560
|
+
DMI_DIdays=DMI_DIdays,DMI_ADXdays=DMI_ADXdays, \
|
2561
|
+
|
2562
|
+
more_details=more_details)
|
2546
2563
|
|
2547
2564
|
#技术指标的绘图线
|
2548
2565
|
tech_line_default={'RSI':['rsi'],
|
@@ -112,7 +112,7 @@ siat/stock_list_china_test.py,sha256=gv14UwMMvkZqtb6G7DCTSuehIwVHuVwu7w60p6gyHoo
|
|
112
112
|
siat/stock_prices_kneighbors.py,sha256=WfZvo5EyeBsm-T37zDj7Sl9dPSRq5Bx4JxIJ9IUum6s,36738
|
113
113
|
siat/stock_prices_linear.py,sha256=-OUKRr27L2aStQgJSlJOrJ4gay_G7P-m-7t7cU2Yoqk,13991
|
114
114
|
siat/stock_profile.py,sha256=B3eIwzEmiCqiCaxIlhfdEPsQBoW1PFOe1hkiY3mVF6Y,26038
|
115
|
-
siat/stock_technical.py,sha256=
|
115
|
+
siat/stock_technical.py,sha256=_b4oRMemnG9eJtOciaMzcnPpxrzAeooujCrQIcZEGlM,114462
|
116
116
|
siat/stock_test.py,sha256=E9YJAvOw1VEGJSDI4IZuEjl0tGoisOIlN-g9UqA_IZE,19475
|
117
117
|
siat/stooq.py,sha256=dOc_S5HLrYg48YAKTCs1eX8UTJOOkPM8qLL2KupqlLY,2470
|
118
118
|
siat/temp.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
|
@@ -133,7 +133,7 @@ siat/valuation.py,sha256=NKfeZMdDJOW42oLVHob6eSVBXUqlN1OCnnzwyGAst8c,48855
|
|
133
133
|
siat/valuation_china.py,sha256=Tde2LzPDQy3Z7xOQQDw4ckQMPdROp_z0-GjFE6Z5_lI,67639
|
134
134
|
siat/valuation_market_china_test.py,sha256=gbJ0ioauuo4koTPH6WKUkqcXiQPafnbhU5eKJ6lpdLA,1571
|
135
135
|
siat/var_model_validation.py,sha256=f-oDewg7bPzyNanz_Y_jLH68NowAA3gXFehW_weKGG0,14898
|
136
|
-
siat-3.1.
|
137
|
-
siat-3.1.
|
138
|
-
siat-3.1.
|
139
|
-
siat-3.1.
|
136
|
+
siat-3.1.23.dist-info/METADATA,sha256=OSzi5L0CybWsNdSshB0Ke0Ge6IcDdrIdbE3985Dl9jE,1448
|
137
|
+
siat-3.1.23.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
138
|
+
siat-3.1.23.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
|
139
|
+
siat-3.1.23.dist-info/RECORD,,
|
File without changes
|
File without changes
|