siat 3.1.15__py3-none-any.whl → 3.1.21__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
@@ -2451,14 +2451,18 @@ def security_technical2(ticker,start='default',end='default', \
2451
2451
  loc1='best',loc2='best', \
2452
2452
  ticker_type='auto', \
2453
2453
 
2454
- facecolor='papayawhip'):
2454
+ attention_values=[0,30,50,80], \
2455
+ facecolor='papayawhip',price_line_color='gray'):
2455
2456
  """
2456
2457
 
2457
2458
  功能:计算和绘制证券技术分析指标的简易图,仅供进一步探索使用,仅用于单个证券(股债基)
2459
+
2458
2460
  支持的探索指标:仅供探索使用
2459
2461
  OBV、SAR、VOL、PSY、ARBR、CR、EMV、TRIX、DMA、BIAS、CCI、W%R、ROC、DMI
2460
2462
  支持的其他指标:不如单独的指令功能强
2461
2463
  MACD、RSI、KDJ、BOLL
2464
+
2465
+ 关注的阈值:默认[0,30,50,80],可以自定义,但0线一般要保留。
2462
2466
  """
2463
2467
  #检查证券代码
2464
2468
  if not isinstance(ticker,str):
@@ -2622,6 +2626,7 @@ def security_technical2(ticker,start='default',end='default', \
2622
2626
  #plt.gca().set_facecolor('whitesmoke')
2623
2627
  fig.gca().set_facecolor(facecolor) #放在这里生效,放尾部不生效
2624
2628
 
2629
+ """
2625
2630
  line0=False; line30=False; line50=False; line80=False
2626
2631
  for l in tech_line_collist:
2627
2632
  lmax=df1[l].max(); lmin=df1[l].min()
@@ -2644,6 +2649,28 @@ def security_technical2(ticker,start='default',end='default', \
2644
2649
  #绘制50线
2645
2650
  if line80:
2646
2651
  plt.axhline(y=80,ls=":",c="black",linewidth=2)
2652
+ """
2653
+ color_list=['k','g','b','c','m','y','r']
2654
+ attention_draws=[False] * len(attention_values)
2655
+
2656
+ for l in tech_line_collist:
2657
+ ax.plot(df1.index,df1[l],label=l.upper())
2658
+
2659
+ #判断是否绘制关注线
2660
+ lmax=df1[l].max(); lmin=df1[l].min()
2661
+
2662
+ for al in attention_values:
2663
+ pos=attention_values.index(al)
2664
+
2665
+ line_al=False
2666
+ if lmax >= al >= lmin:
2667
+ line_al=True
2668
+
2669
+ #如果需要绘制关注线,且尚未绘制过,则绘制
2670
+ if line_al and not attention_draws[pos]:
2671
+ plt.axhline(y=attention_values[pos],ls=":",c=color_list[pos],linewidth=2)
2672
+
2673
+ attention_draws[pos]=True
2647
2674
 
2648
2675
  ylabeltxt1=technical1+'指标'
2649
2676
  if mag_label != '':
@@ -2654,7 +2681,7 @@ def security_technical2(ticker,start='default',end='default', \
2654
2681
  ax2 = ax.twinx()
2655
2682
  ylabeltxt2='收盘价'
2656
2683
  ax2.set_ylabel(ylabeltxt2,fontsize=ylabel_txt_size)
2657
- ax2.plot(df1.index,df1[indicator],label=ylabeltxt2,linestyle='dotted',color='gray')
2684
+ ax2.plot(df1.index,df1[indicator],label=ylabeltxt2,linestyle='dotted',color=price_line_color)
2658
2685
  ax2.legend(loc=loc2,fontsize=legend_txt_size)
2659
2686
 
2660
2687
  titletxt=ticker_name(ticker)+': '+tech_list[technical1]+technical1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 3.1.15
3
+ Version: 3.1.21
4
4
  Summary: Securities Investment Analysis Tools (siat)
5
5
  Home-page: https://pypi.org/project/siat/
6
6
  Author: Prof. WANG Dehong, International Business School, Beijing Foreign Studies University
@@ -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=YGfvsV5Uu9xaZgJO7dwl1FsvszwX3jsGyJxqJgNamQk,112859
115
+ siat/stock_technical.py,sha256=v84ZcykDJG4fj3zevqjIZRfnQKvM69XZ3cn6b8DVP7I,113818
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.15.dist-info/METADATA,sha256=hzUOjL_42SOIUQJyxLmvKaDmWLU5k6U6_Bx0XB8Oq_c,1448
137
- siat-3.1.15.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
138
- siat-3.1.15.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
139
- siat-3.1.15.dist-info/RECORD,,
136
+ siat-3.1.21.dist-info/METADATA,sha256=USf7kX9nSPN3E3jLaESifAfvZBR6tPudAjRsMdGLAJk,1448
137
+ siat-3.1.21.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
138
+ siat-3.1.21.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
139
+ siat-3.1.21.dist-info/RECORD,,
File without changes