plotguy 2.1.4__tar.gz → 2.1.6__tar.gz
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.
- {plotguy-2.1.4 → plotguy-2.1.6}/PKG-INFO +1 -1
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy/__init__.py +11 -3
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy/components.py +4 -3
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy.egg-info/PKG-INFO +1 -1
- {plotguy-2.1.4 → plotguy-2.1.6}/setup.py +1 -1
- {plotguy-2.1.4 → plotguy-2.1.6}/README.md +0 -0
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy/aggregate.py +0 -0
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy/equity_curves.py +0 -0
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy/signals.py +0 -0
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy.egg-info/SOURCES.txt +0 -0
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy.egg-info/dependency_links.txt +0 -0
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy.egg-info/requires.txt +0 -0
- {plotguy-2.1.4 → plotguy-2.1.6}/plotguy.egg-info/top_level.txt +0 -0
- {plotguy-2.1.4 → plotguy-2.1.6}/setup.cfg +0 -0
|
@@ -60,8 +60,13 @@ def get_all_para_combination(para_dict, backtest_attribute, df_dict, sec_profile
|
|
|
60
60
|
|
|
61
61
|
all_para_combination[ref_code] = para_combination
|
|
62
62
|
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
print('5 second countdown before running backtest()')
|
|
64
|
+
for i in range(5):
|
|
65
|
+
print(5 - i)
|
|
66
|
+
time.sleep(1)
|
|
67
|
+
print(0)
|
|
68
|
+
|
|
69
|
+
print(datetime.datetime.now().strftime('%H:%M:%S'), 'start running backtest()')
|
|
65
70
|
|
|
66
71
|
return all_para_combination
|
|
67
72
|
|
|
@@ -156,6 +161,9 @@ def save_backtest_result(df, para_combination_item):
|
|
|
156
161
|
price_annualized_sr = round(price_annualized_sr, 2)
|
|
157
162
|
price_net_profit_to_mdd = round(100 * price_net_profit_to_mdd, 2)
|
|
158
163
|
|
|
164
|
+
last_action = df['action'].iloc[-1]
|
|
165
|
+
if last_action == 'open':
|
|
166
|
+
df = df.drop(df.index[-1])
|
|
159
167
|
df_count = df[(df['trd_side'] == 'BUY') | (df['trd_side'] == 'SELL_SHORT')].copy()
|
|
160
168
|
|
|
161
169
|
if len(df_count) == 0:
|
|
@@ -220,7 +228,7 @@ def save_backtest_result(df, para_combination_item):
|
|
|
220
228
|
|
|
221
229
|
######## resample to daily #############
|
|
222
230
|
if 'summary_mode' in para_combination:
|
|
223
|
-
if
|
|
231
|
+
if para_combination['summary_mode']:
|
|
224
232
|
eqiuty_curve_non_summary_save_path = os.path.join('', equity_curve_folder, f'{ref_code}_non-summary-intraday.parquet')
|
|
225
233
|
df.to_parquet(eqiuty_curve_non_summary_save_path)
|
|
226
234
|
|
|
@@ -498,8 +498,8 @@ class Components:
|
|
|
498
498
|
filter_options = {
|
|
499
499
|
'num_of_trade':'Number of Trade',
|
|
500
500
|
'equity_return_on_capital': 'Return on Capital',
|
|
501
|
-
'
|
|
502
|
-
'
|
|
501
|
+
'equity_annualized_return': 'Annualized Return',
|
|
502
|
+
'equity_annualized_sr': 'Sharpe Ratio',
|
|
503
503
|
'equity_mdd_pct':'MDD Percentage',
|
|
504
504
|
'cov_count':'COV (Count)',
|
|
505
505
|
'cov_return': 'COV (Return)',
|
|
@@ -509,11 +509,12 @@ class Components:
|
|
|
509
509
|
}
|
|
510
510
|
|
|
511
511
|
def update_filter_div(self, filter_list):
|
|
512
|
+
|
|
512
513
|
filter_btn = []
|
|
513
514
|
for i, element in enumerate(filter_list):
|
|
514
515
|
element = filter_list[i]
|
|
515
516
|
filter_full = []
|
|
516
|
-
filter_full.append(html.Div(self.
|
|
517
|
+
filter_full.append(html.Div(self.filter_options[element[0]], style={'margin-right': '15px', 'display': 'inline'}))
|
|
517
518
|
filter_full.append(html.Div(element[1], style={'margin-right': '15px', 'display': 'inline'}))
|
|
518
519
|
filter_full.append(html.Div(element[2], style={'margin-right': '15px', 'display': 'inline'}))
|
|
519
520
|
filter_btn.append(dbc.Row([
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|