virgo-modules 0.8.2__py3-none-any.whl → 0.8.3__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.

Potentially problematic release.


This version of virgo-modules might be problematic. Click here for more details.

@@ -1421,6 +1421,11 @@ def extract_data_traintest(object_stock,features_to_search,configs, target_confi
1421
1421
  last_signal_featlist = last_signal_featlist.split('//')
1422
1422
  if feature_name in last_signal_featlist:
1423
1423
  object_stock.compute_last_signal(feature_name, False)
1424
+ volatility_features = configs.get('custom_transformations',{}).get('volatility_features', False)
1425
+ if volatility_features:
1426
+ for al in volatility_features:
1427
+ object_stock.lag_log_return(lags = al, feature="Close", feature_name=f"asset_{al}_logreturn")
1428
+ object_stock.produce_log_volatility(trad_days=al,feature=f"asset_{al}_logreturn",feature_name=f"asset_{al}_volatility")
1424
1429
  market_interaction_features = configs.get('custom_transformations',{}).get('market_interaction_features', False)
1425
1430
  if market_interaction_features:
1426
1431
  for stage in market_interaction_features.keys():
@@ -142,6 +142,8 @@ class stock_eda_panel(object):
142
142
  extract new asset data and merge it to the main asset data
143
143
  lag_log_return(lags=int, feature=str, feature_name=str):
144
144
  compute log return given some lags
145
+ produce_log_volatility(trad_days=int, feature=str, feature_name=str):
146
+ compute volatility
145
147
  signal_plotter(feature_name=str):
146
148
  display analysis plot of a feature with high and low signals
147
149
  log_features_standard(feature_name=str):
@@ -727,6 +729,23 @@ class stock_eda_panel(object):
727
729
 
728
730
  feature_name = feature_name if feature_name else f"{feature}_log_return"
729
731
  self.df[feature_name] = np.log(self.df[feature]/self.df[feature].shift(lags))
732
+
733
+ def produce_log_volatility(self, trad_days, feature, feature_name=False):
734
+ """
735
+ compute log return given some lags
736
+
737
+ Parameters
738
+ ----------
739
+ trad_days (int): window function to calculate standard deviation
740
+ feature (str): feature to apply computation
741
+ feature_name (str): resulting feature name
742
+
743
+ Returns
744
+ -------
745
+ None
746
+ """
747
+ feature_name = feature_name if feature_name else f"{feature}_log_return_{trad_days}"
748
+ self.df[feature_name] = self.df.sort_values("Date")[feature].rolling(window = trad_days).std()*np.sqrt(252)
730
749
 
731
750
  def signal_plotter(self, feature_name):
732
751
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: virgo_modules
3
- Version: 0.8.2
3
+ Version: 0.8.3
4
4
  Summary: data processing and statistical modeling using stock market data
5
5
  Home-page: https://github.com/miguelmayhem92/virgo_module
6
6
  Author: Miguel Mayhuire
@@ -4,8 +4,8 @@ virgo_modules/src/aws_utils.py,sha256=QCyxJwZ6bNCkMpuuxzxkNxejj-hJf4kj2arb1SQPNu
4
4
  virgo_modules/src/backtester.py,sha256=OhiWyzDX0PthXGuhChyWUmDN3cLkzVYe95zS4nGtia8,22106
5
5
  virgo_modules/src/hmm_utils.py,sha256=D7axAnCdSe1_1EgRyli2PAnM2f6699hTY9GcxjPXG-o,21221
6
6
  virgo_modules/src/pull_artifacts.py,sha256=5OPrgR7pcMSdpbevDRhf0ebk7g7ZRjff4NpTIIWAKjE,1989
7
- virgo_modules/src/re_utils.py,sha256=GZCkAfgw2tVJRJ_Gw5Yewc14ebiE9wSImPiYQN8FsW0,75095
8
- virgo_modules/src/ticketer_source.py,sha256=528WhGoANOm4IKnxGSWsbQxxUh3-qlZfvGRNAafMMcE,103883
7
+ virgo_modules/src/re_utils.py,sha256=AQlhyO0cvU-G42dolhedz5E-sniRzeFhf40RD5QVYpo,75506
8
+ virgo_modules/src/ticketer_source.py,sha256=ig6kgR6qSPhyFePRuO52pNmVsYawpgUXCn7RIO3xf5E,104623
9
9
  virgo_modules/src/transformer_utils.py,sha256=SnYdtsFPnSF6u4UFIat0-X3-qVuUWvv_T46kiB-H0Sk,13682
10
10
  virgo_modules/src/edge_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  virgo_modules/src/edge_utils/conformal_utils.py,sha256=cKm4KSM261Eu1FJn4oowKYiKIesW81VbqITIvopGSVk,5410
@@ -15,8 +15,8 @@ virgo_modules/src/edge_utils/shap_utils.py,sha256=FgcHkfddvdFSeUqEubYa2ExRGVAWSt
15
15
  virgo_modules/src/edge_utils/stack_model.py,sha256=QqE91uLo2KauGEj91AVNANB1xE7J4Fa49YOX7k5mFng,4257
16
16
  virgo_modules/src/market/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
17
17
  virgo_modules/src/market/market_tools.py,sha256=vBt66_7E3ANz7avzfeNw_RHMGvG9lh5PRhxmcf_Oyjc,6880
18
- virgo_modules-0.8.2.dist-info/licenses/LICENSE,sha256=pNgFyCYgmimaw0o6V20JupZLROycAnOA_HDDh1tX2V4,1097
19
- virgo_modules-0.8.2.dist-info/METADATA,sha256=XU1VhD9yFBTwoHukEDwy4TaEZ2_SI2IW4rJstkqAu7M,1122
20
- virgo_modules-0.8.2.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
21
- virgo_modules-0.8.2.dist-info/top_level.txt,sha256=ZjI-qEkDtT-8mFwGAWnXfqPOKEGlIhWRW1es1VyXc60,14
22
- virgo_modules-0.8.2.dist-info/RECORD,,
18
+ virgo_modules-0.8.3.dist-info/licenses/LICENSE,sha256=pNgFyCYgmimaw0o6V20JupZLROycAnOA_HDDh1tX2V4,1097
19
+ virgo_modules-0.8.3.dist-info/METADATA,sha256=an7Yx_L5o_jC_P_cVGwdndeQGAfYGeCzIeGubxK_z4Y,1122
20
+ virgo_modules-0.8.3.dist-info/WHEEL,sha256=lTU6B6eIfYoiQJTZNc-fyaR6BpL6ehTzU3xGYxn2n8k,91
21
+ virgo_modules-0.8.3.dist-info/top_level.txt,sha256=ZjI-qEkDtT-8mFwGAWnXfqPOKEGlIhWRW1es1VyXc60,14
22
+ virgo_modules-0.8.3.dist-info/RECORD,,