siat 3.1.15__py3-none-any.whl → 3.1.20__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,19 @@ 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
+ facecolor='papayawhip', \
2455
+
2456
+ attention_values=[0,30,50,80]):
2455
2457
  """
2456
2458
 
2457
2459
  功能:计算和绘制证券技术分析指标的简易图,仅供进一步探索使用,仅用于单个证券(股债基)
2460
+
2458
2461
  支持的探索指标:仅供探索使用
2459
2462
  OBV、SAR、VOL、PSY、ARBR、CR、EMV、TRIX、DMA、BIAS、CCI、W%R、ROC、DMI
2460
2463
  支持的其他指标:不如单独的指令功能强
2461
2464
  MACD、RSI、KDJ、BOLL
2465
+
2466
+ 关注的阈值:默认[0,30,50,80],可以自定义,但0线一般要保留。
2462
2467
  """
2463
2468
  #检查证券代码
2464
2469
  if not isinstance(ticker,str):
@@ -2622,6 +2627,7 @@ def security_technical2(ticker,start='default',end='default', \
2622
2627
  #plt.gca().set_facecolor('whitesmoke')
2623
2628
  fig.gca().set_facecolor(facecolor) #放在这里生效,放尾部不生效
2624
2629
 
2630
+ """
2625
2631
  line0=False; line30=False; line50=False; line80=False
2626
2632
  for l in tech_line_collist:
2627
2633
  lmax=df1[l].max(); lmin=df1[l].min()
@@ -2644,6 +2650,28 @@ def security_technical2(ticker,start='default',end='default', \
2644
2650
  #绘制50线
2645
2651
  if line80:
2646
2652
  plt.axhline(y=80,ls=":",c="black",linewidth=2)
2653
+ """
2654
+ color_list=['k','g','b','c','m','y','r']
2655
+ attention_draws=[False] * len(attention_values)
2656
+
2657
+ for l in tech_line_collist:
2658
+ ax.plot(df1.index,df1[l],label=l.upper())
2659
+
2660
+ #判断是否绘制关注线
2661
+ lmax=df1[l].max(); lmin=df1[l].min()
2662
+
2663
+ for al in attention_values:
2664
+ pos=attention_values.index(al)
2665
+
2666
+ line_al=False
2667
+ if lmax >= al >= lmin:
2668
+ line_al=True
2669
+
2670
+ #如果需要绘制关注线,且尚未绘制过,则绘制
2671
+ if line_al and not attention_draws[pos]:
2672
+ plt.axhline(y=attention_values[pos],ls=":",c=color_list[pos],linewidth=2)
2673
+
2674
+ attention_draws[pos]=True
2647
2675
 
2648
2676
  ylabeltxt1=technical1+'指标'
2649
2677
  if mag_label != '':
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: siat
3
- Version: 3.1.15
3
+ Version: 3.1.20
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=ufFjRt9XplGXYhodGs2EgczCjRucOnNcdZqROCIntYo,113806
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.20.dist-info/METADATA,sha256=AA6DPN51RIA-Y4EWWDnHFvi8koH_7k7lhZbypMCX98U,1448
137
+ siat-3.1.20.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
138
+ siat-3.1.20.dist-info/top_level.txt,sha256=r1cVyL7AIKqeAmEJjNR8FMT20OmEzufDstC2gv3NvEY,5
139
+ siat-3.1.20.dist-info/RECORD,,
File without changes