virgo-modules 0.8.1__py3-none-any.whl → 0.8.2__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.
- virgo_modules/src/edge_utils/edge_utils.py +5 -4
- {virgo_modules-0.8.1.dist-info → virgo_modules-0.8.2.dist-info}/METADATA +15 -6
- {virgo_modules-0.8.1.dist-info → virgo_modules-0.8.2.dist-info}/RECORD +6 -6
- {virgo_modules-0.8.1.dist-info → virgo_modules-0.8.2.dist-info}/WHEEL +1 -1
- {virgo_modules-0.8.1.dist-info → virgo_modules-0.8.2.dist-info/licenses}/LICENSE +0 -0
- {virgo_modules-0.8.1.dist-info → virgo_modules-0.8.2.dist-info}/top_level.txt +0 -0
|
@@ -450,7 +450,7 @@ def edge_probas_lines(data, threshold, plot = False, look_back = 750):
|
|
|
450
450
|
fig.show()
|
|
451
451
|
return fig
|
|
452
452
|
|
|
453
|
-
def get_rolling_probs(data, window = 3,plot = False, look_back = 750):
|
|
453
|
+
def get_rolling_probs(data, window = 3,plot = False, look_back = 750, rets_eval=7):
|
|
454
454
|
"""
|
|
455
455
|
produce a plotly plot of smoothed edges and closing prices
|
|
456
456
|
|
|
@@ -465,6 +465,7 @@ def get_rolling_probs(data, window = 3,plot = False, look_back = 750):
|
|
|
465
465
|
"""
|
|
466
466
|
prob_cols = ['proba_target_down','proba_target_up']
|
|
467
467
|
df = data[prob_cols+['Date','log_return','Close']].iloc[-look_back:]
|
|
468
|
+
df["eval_rets"] = (df["Close"]/df["Close"].shift(rets_eval)-1)*100
|
|
468
469
|
for colx in prob_cols:
|
|
469
470
|
df[f'roll_{colx}'] = df.sort_values('Date')[colx].rolling(window, min_periods=1).mean()
|
|
470
471
|
df['roll_edge'] = np.where(df['roll_proba_target_up'] > df['roll_proba_target_down'],'up','down')
|
|
@@ -480,14 +481,14 @@ def get_rolling_probs(data, window = 3,plot = False, look_back = 750):
|
|
|
480
481
|
fig = make_subplots(
|
|
481
482
|
rows=2, cols=2,shared_xaxes=False,vertical_spacing=0.08,
|
|
482
483
|
specs=[[{"colspan": 2, "secondary_y":True}, None],[{}, {}]],
|
|
483
|
-
subplot_titles=("Smooth edge probabilities", "expected
|
|
484
|
+
subplot_titles=("Smooth edge probabilities", f"expected return {rets_eval} days", "Duration"))
|
|
484
485
|
fig.add_trace(go.Scatter(x=df.Date, y=df.Close,mode='lines+markers',name='Close price'))
|
|
485
486
|
fig.add_trace(go.Scatter(x=df.Date, y=df.roll_proba_target_down,mode='lines',marker = dict(color = 'coral'),name='go down'),secondary_y=True,col=1,row=1)
|
|
486
487
|
fig.add_trace(go.Scatter(x=df.Date, y=df.roll_proba_target_up,mode='lines',marker = dict(opacity=0.1,size=80), name='go up'),secondary_y=True,col=1,row=1)
|
|
487
488
|
|
|
488
489
|
for re in df['roll_edge'].unique():
|
|
489
|
-
fig.add_trace(go.Box(x=df[df['roll_edge']==re]["
|
|
490
|
-
|
|
490
|
+
fig.add_trace(go.Box(x=df[df['roll_edge']==re]["eval_rets"],name=re,marker_color=colors.get(re),showlegend=False),col=1,row=2)
|
|
491
|
+
fig.add_vline(x=0, line_width=2, line_dash="dash", line_color="grey", col=1,row=2)
|
|
491
492
|
df_ = df.groupby(['roll_edge','chain'],as_index=False).agg(max_duration = ('chain_id','max'))
|
|
492
493
|
for re in df_['roll_edge'].unique():
|
|
493
494
|
fig.add_trace(go.Box(x=df_[df_['roll_edge']==re]["max_duration"],name=re,marker_color=colors.get(re),showlegend=False),col=2,row=2)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 0.8.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: virgo_modules
|
|
3
|
+
Version: 0.8.2
|
|
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
|
|
7
7
|
Author-email: miguelmayhem92@gmail.com
|
|
8
8
|
License: MIT
|
|
9
|
-
Platform: UNKNOWN
|
|
10
9
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
10
|
Classifier: Programming Language :: Python :: 3.9
|
|
12
11
|
Classifier: Operating System :: OS Independent
|
|
@@ -14,7 +13,18 @@ Requires-Python: >=3.9
|
|
|
14
13
|
Description-Content-Type: text/markdown
|
|
15
14
|
License-File: LICENSE
|
|
16
15
|
Provides-Extra: dev
|
|
17
|
-
Requires-Dist: pytest
|
|
16
|
+
Requires-Dist: pytest>=7.0; extra == "dev"
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: license
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
Dynamic: provides-extra
|
|
26
|
+
Dynamic: requires-python
|
|
27
|
+
Dynamic: summary
|
|
18
28
|
|
|
19
29
|
# Virgo Package
|
|
20
30
|
|
|
@@ -35,4 +45,3 @@ obj = stock_eda_panel(stock_code = 'PEP', n_days = 20)
|
|
|
35
45
|
obj.get_data()
|
|
36
46
|
print(obj.df.shape)
|
|
37
47
|
```
|
|
38
|
-
|
|
@@ -9,14 +9,14 @@ virgo_modules/src/ticketer_source.py,sha256=528WhGoANOm4IKnxGSWsbQxxUh3-qlZfvGRN
|
|
|
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
|
|
12
|
-
virgo_modules/src/edge_utils/edge_utils.py,sha256=
|
|
12
|
+
virgo_modules/src/edge_utils/edge_utils.py,sha256=8xdcmeEPyfD76c-mcdfkHqWjwtJOPoUsit5UH3cRJTg,20207
|
|
13
13
|
virgo_modules/src/edge_utils/feature_selection.py,sha256=HYbQ0JLPDiRYhn-5-C438YEKbuNduDmuvboFC_VkHww,2453
|
|
14
14
|
virgo_modules/src/edge_utils/shap_utils.py,sha256=FgcHkfddvdFSeUqEubYa2ExRGVAWSthqK4b-eKagEmo,2333
|
|
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.
|
|
19
|
-
virgo_modules-0.8.
|
|
20
|
-
virgo_modules-0.8.
|
|
21
|
-
virgo_modules-0.8.
|
|
22
|
-
virgo_modules-0.8.
|
|
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,,
|
|
File without changes
|
|
File without changes
|