plotguy 2.1.3__tar.gz → 2.1.5__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plotguy
3
- Version: 2.1.3
3
+ Version: 2.1.5
4
4
  Summary: Plotguy
5
5
  Home-page: https://pypi.org/project/plotguy/
6
6
  Author: Plotguy Team
@@ -8,7 +8,7 @@ Author-email: plotguy.info@gmail.com
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Operating System :: OS Independent
10
10
  Description-Content-Type: text/markdown
11
- Requires-Dist: setuptools
11
+ Requires-Dist: setuptools==80.10.2
12
12
  Requires-Dist: numpy==2.4.2
13
13
  Requires-Dist: pandas==2.3.3
14
14
  Requires-Dist: hkfdb
@@ -156,6 +156,9 @@ def save_backtest_result(df, para_combination_item):
156
156
  price_annualized_sr = round(price_annualized_sr, 2)
157
157
  price_net_profit_to_mdd = round(100 * price_net_profit_to_mdd, 2)
158
158
 
159
+ last_action = df['action'].iloc[-1]
160
+ if last_action == 'open':
161
+ df = df.drop(df.index[-1])
159
162
  df_count = df[(df['trd_side'] == 'BUY') | (df['trd_side'] == 'SELL_SHORT')].copy()
160
163
 
161
164
  if len(df_count) == 0:
@@ -397,13 +397,22 @@ class Components:
397
397
  year_return = '-----'
398
398
  else:
399
399
  format_content = value['year_win_rate']
400
- year_win_rate = "{:d} %".format(int(format_content))
400
+ if np.isnan(format_content):
401
+ year_win_rate = 'nan'
402
+ else:
403
+ year_win_rate = "{:d} %".format(int(format_content))
401
404
 
402
405
  format_content = value['year_return']
403
- year_return = "{:d} %".format(int(format_content))
406
+ if np.isnan(format_content):
407
+ year_return = 'nan'
408
+ else:
409
+ year_return = "{:d} %".format(int(format_content))
404
410
 
405
411
  format_content = value['year_trade_count']
406
- year_trade_count = str(int(format_content))
412
+ if np.isnan(format_content):
413
+ year_trade_count = 'nan'
414
+ else:
415
+ year_trade_count = str(int(format_content))
407
416
 
408
417
  if idx%2 == 1:
409
418
  year_col1.append(
@@ -489,8 +498,8 @@ class Components:
489
498
  filter_options = {
490
499
  'num_of_trade':'Number of Trade',
491
500
  'equity_return_on_capital': 'Return on Capital',
492
- 'annualized_return': 'Annualized Return',
493
- 'equity_annualized_return': 'Sharpe Ratio',
501
+ 'equity_annualized_return': 'Annualized Return',
502
+ 'equity_annualized_sr': 'Sharpe Ratio',
494
503
  'equity_mdd_pct':'MDD Percentage',
495
504
  'cov_count':'COV (Count)',
496
505
  'cov_return': 'COV (Return)',
@@ -500,11 +509,12 @@ class Components:
500
509
  }
501
510
 
502
511
  def update_filter_div(self, filter_list):
512
+
503
513
  filter_btn = []
504
514
  for i, element in enumerate(filter_list):
505
515
  element = filter_list[i]
506
516
  filter_full = []
507
- filter_full.append(html.Div(self. filter_options[element[0]], style={'margin-right': '15px', 'display': 'inline'}))
517
+ filter_full.append(html.Div(self.filter_options[element[0]], style={'margin-right': '15px', 'display': 'inline'}))
508
518
  filter_full.append(html.Div(element[1], style={'margin-right': '15px', 'display': 'inline'}))
509
519
  filter_full.append(html.Div(element[2], style={'margin-right': '15px', 'display': 'inline'}))
510
520
  filter_btn.append(dbc.Row([
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: plotguy
3
- Version: 2.1.3
3
+ Version: 2.1.5
4
4
  Summary: Plotguy
5
5
  Home-page: https://pypi.org/project/plotguy/
6
6
  Author: Plotguy Team
@@ -8,7 +8,7 @@ Author-email: plotguy.info@gmail.com
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: Operating System :: OS Independent
10
10
  Description-Content-Type: text/markdown
11
- Requires-Dist: setuptools
11
+ Requires-Dist: setuptools==80.10.2
12
12
  Requires-Dist: numpy==2.4.2
13
13
  Requires-Dist: pandas==2.3.3
14
14
  Requires-Dist: hkfdb
@@ -1,4 +1,4 @@
1
- setuptools
1
+ setuptools==80.10.2
2
2
  numpy==2.4.2
3
3
  pandas==2.3.3
4
4
  hkfdb
@@ -5,14 +5,14 @@ with open("README.md", "r") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="plotguy",
8
- version="2.1.3",
8
+ version="2.1.5",
9
9
  author="Plotguy Team",
10
10
  author_email="plotguy.info@gmail.com",
11
11
  description="Plotguy",
12
12
  long_description=long_description,
13
13
  long_description_content_type="text/markdown",
14
14
  install_requires=[
15
- 'setuptools',
15
+ 'setuptools==80.10.2',
16
16
  'numpy==2.4.2',
17
17
  'pandas==2.3.3',
18
18
  'hkfdb',
File without changes
File without changes
File without changes
File without changes