siat 3.5.12__py3-none-any.whl → 3.6.6__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/capm_beta2.py +49 -24
- siat/grafix.py +505 -26
- siat/option_china.py +1 -1
- siat/risk_adjusted_return2.py +91 -52
- siat/security_trend2.py +71 -15
- siat/stock.py +65 -17
- siat/translate.py +1 -1
- siat/valuation.py +28 -12
- {siat-3.5.12.dist-info → siat-3.6.6.dist-info}/METADATA +1 -1
- {siat-3.5.12.dist-info → siat-3.6.6.dist-info}/RECORD +13 -13
- {siat-3.5.12.dist-info → siat-3.6.6.dist-info}/LICENSE +0 -0
- {siat-3.5.12.dist-info → siat-3.6.6.dist-info}/WHEEL +0 -0
- {siat-3.5.12.dist-info → siat-3.6.6.dist-info}/top_level.txt +0 -0
siat/capm_beta2.py
CHANGED
@@ -331,9 +331,12 @@ if __name__=='__main__':
|
|
331
331
|
betas=compare_mticker_1beta(ticker,start,end)
|
332
332
|
|
333
333
|
def compare_mticker_1beta(ticker,start,end, \
|
334
|
-
|
334
|
+
adjust='', \
|
335
335
|
RF=0,regression_period=365, \
|
336
|
-
|
336
|
+
attention_value='',attention_value_area='', \
|
337
|
+
attention_point='',attention_point_area='', \
|
338
|
+
axhline_value=1,axhline_label='', \
|
339
|
+
graph=True,facecolor='whitesmoke',loc='best', \
|
337
340
|
annotate=False,annotate_value=False, \
|
338
341
|
mark_top=False,mark_bottom=False,mark_end=False, \
|
339
342
|
mktidx='auto',source='auto',ticker_type='auto'):
|
@@ -427,9 +430,11 @@ def compare_mticker_1beta(ticker,start,end, \
|
|
427
430
|
draw_lines(df1,y_label,x_label=footnotex, \
|
428
431
|
axhline_value=axhline_value,axhline_label=axhline_label, \
|
429
432
|
title_txt=title_txt,data_label=False, \
|
433
|
+
attention_value=attention_value,attention_value_area=attention_value_area, \
|
434
|
+
attention_point=attention_point,attention_point_area=attention_point_area, \
|
430
435
|
annotate=annotate,annotate_value=annotate, \
|
431
436
|
mark_top=mark_top,mark_bottom=mark_bottom,mark_end=mark_end,
|
432
|
-
facecolor=facecolor)
|
437
|
+
facecolor=facecolor,loc=loc)
|
433
438
|
|
434
439
|
return df
|
435
440
|
|
@@ -454,13 +459,16 @@ if __name__=='__main__':
|
|
454
459
|
|
455
460
|
def compare_1ticker_mRF(ticker,start,end, \
|
456
461
|
adjust='', \
|
457
|
-
|
458
|
-
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
462
|
+
RF=[0,0.02,0.05], \
|
463
|
+
regression_period=365, \
|
464
|
+
attention_value='',attention_value_area='', \
|
465
|
+
attention_point='',attention_point_area='', \
|
466
|
+
axhline_value=1,axhline_label='', \
|
467
|
+
graph=True,facecolor='whitesmoke',loc='best', \
|
468
|
+
annotate=False,annotate_value=False, \
|
469
|
+
mark_top=False,mark_bottom=False,mark_end=False, \
|
470
|
+
mktidx='auto',source='auto', \
|
471
|
+
ticker_type='auto'):
|
464
472
|
"""
|
465
473
|
功能:一只股票,不同的无风险收益率
|
466
474
|
"""
|
@@ -548,9 +556,11 @@ def compare_1ticker_mRF(ticker,start,end, \
|
|
548
556
|
draw_lines(df1,y_label,x_label=footnotex, \
|
549
557
|
axhline_value=axhline_value,axhline_label=axhline_label, \
|
550
558
|
title_txt=title_txt,data_label=False, \
|
559
|
+
attention_value=attention_value,attention_value_area=attention_value_area, \
|
560
|
+
attention_point=attention_point,attention_point_area=attention_point_area, \
|
551
561
|
annotate=annotate,annotate_value=annotate, \
|
552
562
|
mark_top=mark_top,mark_bottom=mark_bottom,mark_end=mark_end, \
|
553
|
-
facecolor=facecolor)
|
563
|
+
facecolor=facecolor,loc=loc)
|
554
564
|
|
555
565
|
return df
|
556
566
|
|
@@ -572,10 +582,13 @@ if __name__=='__main__':
|
|
572
582
|
betas=compare_1ticker_mregression_period(ticker,start,end,RF,regression_period)
|
573
583
|
|
574
584
|
def compare_1ticker_mregression_period(ticker,start,end, \
|
575
|
-
|
585
|
+
adjust='', \
|
576
586
|
RF=0, \
|
577
587
|
regression_period=[183,365,730], \
|
578
|
-
|
588
|
+
attention_value='',attention_value_area='', \
|
589
|
+
attention_point='',attention_point_area='', \
|
590
|
+
axhline_value=1,axhline_label='', \
|
591
|
+
graph=True,facecolor='whitesmoke',loc='best', \
|
579
592
|
annotate=False,annotate_value=False, \
|
580
593
|
mark_top=False,mark_bottom=False,mark_end=False, \
|
581
594
|
mktidx='auto',source='auto', \
|
@@ -662,9 +675,11 @@ def compare_1ticker_mregression_period(ticker,start,end, \
|
|
662
675
|
draw_lines(df1,y_label,x_label=footnotex, \
|
663
676
|
axhline_value=axhline_value,axhline_label=axhline_label, \
|
664
677
|
title_txt=title_txt,data_label=False, \
|
678
|
+
attention_value=attention_value,attention_value_area=attention_value_area, \
|
679
|
+
attention_point=attention_point,attention_point_area=attention_point_area, \
|
665
680
|
annotate=annotate,annotate_value=annotate, \
|
666
681
|
mark_top=mark_top,mark_bottom=mark_bottom,mark_end=mark_end, \
|
667
|
-
facecolor=facecolor)
|
682
|
+
facecolor=facecolor,loc=loc)
|
668
683
|
|
669
684
|
return df
|
670
685
|
|
@@ -693,11 +708,13 @@ if __name__=='__main__':
|
|
693
708
|
def compare_beta_security(ticker,start,end, \
|
694
709
|
adjust='', \
|
695
710
|
RF=0,regression_period=365, \
|
711
|
+
attention_value='',attention_value_area='', \
|
712
|
+
attention_point='',attention_point_area='', \
|
696
713
|
graph=True,facecolor='whitesmoke', \
|
697
714
|
annotate=False,annotate_value=False, \
|
698
715
|
mark_top=False,mark_bottom=False,mark_end=False, \
|
699
716
|
mktidx='auto',source='auto', \
|
700
|
-
ticker_type='auto'):
|
717
|
+
ticker_type='auto',loc="best"):
|
701
718
|
"""
|
702
719
|
功能:组合情况,可能多只股票、多个投资组合或投资组合与股票的混合,多个无风险收益率
|
703
720
|
|
@@ -712,7 +729,9 @@ def compare_beta_security(ticker,start,end, \
|
|
712
729
|
df=compare_mticker_1beta(ticker,start,end, \
|
713
730
|
adjust=adjust, \
|
714
731
|
RF=RF,regression_period=regression_period, \
|
715
|
-
|
732
|
+
attention_value=attention_value,attention_value_area=attention_value_area, \
|
733
|
+
attention_point=attention_point,attention_point_area=attention_point_area, \
|
734
|
+
graph=graph,facecolor=facecolor,loc=loc, \
|
716
735
|
annotate=annotate,annotate_value=annotate, \
|
717
736
|
mark_top=mark_top,mark_bottom=mark_bottom,mark_end=mark_end, \
|
718
737
|
mktidx=mktidx,source=source, \
|
@@ -728,11 +747,13 @@ def compare_beta_security(ticker,start,end, \
|
|
728
747
|
df=compare_1ticker_mRF(ticker,start,end, \
|
729
748
|
adjust=adjust, \
|
730
749
|
RF=RF,regression_period=regression_period, \
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
750
|
+
attention_value=attention_value,attention_value_area=attention_value_area, \
|
751
|
+
attention_point=attention_point,attention_point_area=attention_point_area, \
|
752
|
+
graph=graph,facecolor=facecolor,loc=loc, \
|
753
|
+
annotate=annotate,annotate_value=annotate, \
|
754
|
+
mark_top=mark_top,mark_bottom=mark_bottom,mark_end=mark_end, \
|
755
|
+
mktidx=mktidx,source=source, \
|
756
|
+
ticker_type=ticker_type)
|
736
757
|
return df
|
737
758
|
else:
|
738
759
|
#实际上是单个RF
|
@@ -742,9 +763,11 @@ def compare_beta_security(ticker,start,end, \
|
|
742
763
|
if isinstance(regression_period,list):
|
743
764
|
if len(regression_period) > 1:
|
744
765
|
df=compare_1ticker_mregression_period(ticker,start,end, \
|
745
|
-
|
766
|
+
adjust=adjust, \
|
746
767
|
RF=RF,regression_period=regression_period, \
|
747
|
-
|
768
|
+
attention_value=attention_value,attention_value_area=attention_value_area, \
|
769
|
+
attention_point=attention_point,attention_point_area=attention_point_area, \
|
770
|
+
graph=graph,facecolor=facecolor,loc=loc, \
|
748
771
|
annotate=annotate,annotate_value=annotate, \
|
749
772
|
mark_top=mark_top,mark_bottom=mark_bottom,mark_end=mark_end, \
|
750
773
|
mktidx=mktidx,source=source, \
|
@@ -758,7 +781,9 @@ def compare_beta_security(ticker,start,end, \
|
|
758
781
|
df=compare_mticker_1beta(ticker,start,end, \
|
759
782
|
adjust=adjust, \
|
760
783
|
RF=RF,regression_period=regression_period, \
|
761
|
-
|
784
|
+
attention_value=attention_value,attention_value_area=attention_value_area, \
|
785
|
+
attention_point=attention_point,attention_point_area=attention_point_area, \
|
786
|
+
graph=graph,facecolor=facecolor,loc=loc, \
|
762
787
|
annotate=annotate,annotate_value=annotate, \
|
763
788
|
mark_top=mark_top,mark_bottom=mark_bottom,mark_end=mark_end, \
|
764
789
|
mktidx=mktidx,source=source, \
|