plotguy 2.1.1__tar.gz → 2.1.3__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.1 → plotguy-2.1.3}/PKG-INFO +1 -1
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy/__init__.py +11 -3
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy.egg-info/PKG-INFO +1 -1
- {plotguy-2.1.1 → plotguy-2.1.3}/setup.py +1 -1
- {plotguy-2.1.1 → plotguy-2.1.3}/README.md +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy/aggregate.py +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy/components.py +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy/equity_curves.py +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy/signals.py +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy.egg-info/SOURCES.txt +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy.egg-info/dependency_links.txt +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy.egg-info/requires.txt +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/plotguy.egg-info/top_level.txt +0 -0
- {plotguy-2.1.1 → plotguy-2.1.3}/setup.cfg +0 -0
|
@@ -160,13 +160,14 @@ def save_backtest_result(df, para_combination_item):
|
|
|
160
160
|
|
|
161
161
|
if len(df_count) == 0:
|
|
162
162
|
num_of_trade = 0
|
|
163
|
-
|
|
164
163
|
equity_net_profit = 0
|
|
165
164
|
equity_return_on_capital = 0
|
|
166
165
|
equity_annualized_return = 0
|
|
167
166
|
equity_annualized_std = 0
|
|
168
167
|
equity_annualized_sr = 0
|
|
169
168
|
equity_net_profit_to_mdd = np.inf
|
|
169
|
+
equity_mdd_dollar = 0
|
|
170
|
+
equity_mdd_pct = 0
|
|
170
171
|
|
|
171
172
|
num_of_win = 0
|
|
172
173
|
num_of_trade = 0
|
|
@@ -177,6 +178,15 @@ def save_backtest_result(df, para_combination_item):
|
|
|
177
178
|
cov_count = 0
|
|
178
179
|
total_commission = 0
|
|
179
180
|
|
|
181
|
+
start_year = df.index[0].year
|
|
182
|
+
end_year = df.index[-1].year
|
|
183
|
+
|
|
184
|
+
yearly_stats_string = ''
|
|
185
|
+
for year in range(start_year, end_year + 1):
|
|
186
|
+
yearly_stats_string += f'{year},year_trade_count:0.00,year_win_rate:00.00,year_return:-00.00|'
|
|
187
|
+
|
|
188
|
+
yearly_stats_string = yearly_stats_string[:-1]
|
|
189
|
+
|
|
180
190
|
elif len(df_count) > 0:
|
|
181
191
|
|
|
182
192
|
########### by year count, win rate and return ###############
|
|
@@ -279,7 +289,6 @@ def save_backtest_result(df, para_combination_item):
|
|
|
279
289
|
'equity_annualized_std': equity_annualized_std,
|
|
280
290
|
'equity_annualized_sr': equity_annualized_sr,
|
|
281
291
|
'equity_net_profit_to_mdd': equity_net_profit_to_mdd,
|
|
282
|
-
|
|
283
292
|
'equity_mdd_dollar': equity_mdd_dollar,
|
|
284
293
|
'equity_mdd_pct': equity_mdd_pct,
|
|
285
294
|
|
|
@@ -289,7 +298,6 @@ def save_backtest_result(df, para_combination_item):
|
|
|
289
298
|
'price_annualized_std': price_annualized_std,
|
|
290
299
|
'price_annualized_sr': price_annualized_sr,
|
|
291
300
|
'price_net_profit_to_mdd': price_net_profit_to_mdd,
|
|
292
|
-
|
|
293
301
|
'price_mdd_dollar': price_mdd_dollar,
|
|
294
302
|
'price_mdd_pct': price_mdd_pct,
|
|
295
303
|
|
|
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
|
|
File without changes
|