plotguy 2.1.9__tar.gz → 2.2.0__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.9 → plotguy-2.2.0}/PKG-INFO +2 -2
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy/components.py +68 -67
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy.egg-info/PKG-INFO +2 -2
- {plotguy-2.1.9 → plotguy-2.2.0}/setup.py +2 -2
- {plotguy-2.1.9 → plotguy-2.2.0}/README.md +0 -0
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy/__init__.py +0 -0
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy/aggregate.py +0 -0
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy/equity_curves.py +0 -0
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy/signals.py +0 -0
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy.egg-info/SOURCES.txt +0 -0
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy.egg-info/dependency_links.txt +0 -0
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy.egg-info/requires.txt +1 -1
- {plotguy-2.1.9 → plotguy-2.2.0}/plotguy.egg-info/top_level.txt +0 -0
- {plotguy-2.1.9 → plotguy-2.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotguy
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Plotguy
|
|
5
5
|
Home-page: https://pypi.org/project/plotguy/
|
|
6
6
|
Author: Plotguy Team
|
|
@@ -15,9 +15,9 @@ Requires-Dist: hkfdb
|
|
|
15
15
|
Requires-Dist: pyarrow==23.0.0
|
|
16
16
|
Requires-Dist: fastparquet
|
|
17
17
|
Requires-Dist: polars==0.18.15
|
|
18
|
+
Requires-Dist: dash==2.9.3
|
|
18
19
|
Requires-Dist: plotly==5.18.0
|
|
19
20
|
Requires-Dist: lxml
|
|
20
|
-
Requires-Dist: dash==2.9.3
|
|
21
21
|
Requires-Dist: dash_bootstrap_components
|
|
22
22
|
Requires-Dist: dash_daq
|
|
23
23
|
Requires-Dist: dash_dangerously_set_inner_html
|
|
@@ -798,73 +798,74 @@ class Components:
|
|
|
798
798
|
saved_strategies_path = os.path.join(str_dir, 'saved_strategies.parquet')
|
|
799
799
|
saved_strategies_df = pd.read_parquet(saved_strategies_path)
|
|
800
800
|
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
801
|
+
if len(saved_strategies_df.columns) > 1:
|
|
802
|
+
for i, row in saved_strategies_df.iterrows():
|
|
803
|
+
equity_path = os.path.join(str_dir, row['equity_curve_folder'], str(row['ref_code']) + '.parquet')
|
|
804
|
+
#df_equity = pd.read_parquet(equity_path)
|
|
805
|
+
|
|
806
|
+
yearly_stats_string = row['yearly_stats_string']
|
|
807
|
+
para_keys_str = row['para_keys_str']
|
|
808
|
+
para_keys_list = para_keys_str.split('|')
|
|
809
|
+
|
|
810
|
+
parameters = {}
|
|
811
|
+
for para_keys in para_keys_list:
|
|
812
|
+
parameters[para_keys] = str(row[para_keys])
|
|
813
|
+
|
|
814
|
+
equity_curve_dict = {}
|
|
815
|
+
|
|
816
|
+
equity_curve_dict['folder'] = str_dir
|
|
817
|
+
equity_curve_dict['backtest_name'] = row['backtest_name']
|
|
818
|
+
equity_curve_dict['equity_path'] = equity_path
|
|
819
|
+
equity_curve_dict['parameters'] = parameters
|
|
820
|
+
|
|
821
|
+
equity_curve_dict['performance'] = {
|
|
822
|
+
'initial_capital': row['initial_capital'],
|
|
823
|
+
'sharpe_ratio': row['equity_annualized_sr'],
|
|
824
|
+
'annualized_return': row['equity_annualized_return'],
|
|
825
|
+
'net_profit_to_mdd': row['equity_net_profit_to_mdd'],
|
|
826
|
+
'net_profit': row['equity_net_profit'],
|
|
827
|
+
'mdd_dollar': row['equity_mdd_dollar'],
|
|
828
|
+
'mdd_pct': row['equity_mdd_pct'],
|
|
829
|
+
'num_of_trade': row['num_of_trade'],
|
|
830
|
+
'num_of_win': row['num_of_win'],
|
|
831
|
+
'return_on_capital': row['equity_return_on_capital'],
|
|
832
|
+
'total_commission': row['total_commission'],
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
ref_code = str(row['ref_code'])
|
|
836
|
+
equity_curve_dict['ref_code'] = ref_code
|
|
837
|
+
|
|
838
|
+
yearly_stats_dict = {}
|
|
839
|
+
years_data = yearly_stats_string.split("|")
|
|
840
|
+
|
|
841
|
+
for year_data in years_data:
|
|
842
|
+
parts = year_data.split(",")
|
|
843
|
+
year = parts[0]
|
|
844
|
+
yearly_stats_dict[year] = {}
|
|
845
|
+
|
|
846
|
+
for item in parts[1:]:
|
|
847
|
+
key, value = item.split(":")
|
|
848
|
+
yearly_stats_dict[year][key] = float(value)
|
|
849
|
+
|
|
850
|
+
for idx, (year, value) in enumerate(yearly_stats_dict.items()):
|
|
851
|
+
year_trade_count = value['year_trade_count']
|
|
852
|
+
year_win_rate = value['year_win_rate']
|
|
853
|
+
year_return = value['year_return']
|
|
854
|
+
|
|
855
|
+
year_win_count = year_trade_count * year_win_rate * 0.01
|
|
856
|
+
|
|
857
|
+
### dont remove ###
|
|
858
|
+
# year_trade_count = "{:d}".format(int(year_trade_count))
|
|
859
|
+
# year_win_count = "{:d}".format(int(year_win_count))
|
|
860
|
+
# year_win_rate = "{:d}%".format(int(year_win_rate))
|
|
861
|
+
# year_return = "{:.2f} %".format(int(year_return))
|
|
862
|
+
|
|
863
|
+
equity_curve_dict['performance'][f'{year} Count'] = year_trade_count
|
|
864
|
+
equity_curve_dict['performance'][f'{year} Win Rate'] = year_win_rate
|
|
865
|
+
equity_curve_dict['performance'][f'{year} Win Count'] = year_win_count
|
|
866
|
+
equity_curve_dict['performance'][f'{year} Return'] = year_return
|
|
867
|
+
|
|
868
|
+
equity_curves_dict_list.append(equity_curve_dict)
|
|
868
869
|
|
|
869
870
|
line_colour = []
|
|
870
871
|
for c in range(len(equity_curves_dict_list)):
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: plotguy
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: Plotguy
|
|
5
5
|
Home-page: https://pypi.org/project/plotguy/
|
|
6
6
|
Author: Plotguy Team
|
|
@@ -15,9 +15,9 @@ Requires-Dist: hkfdb
|
|
|
15
15
|
Requires-Dist: pyarrow==23.0.0
|
|
16
16
|
Requires-Dist: fastparquet
|
|
17
17
|
Requires-Dist: polars==0.18.15
|
|
18
|
+
Requires-Dist: dash==2.9.3
|
|
18
19
|
Requires-Dist: plotly==5.18.0
|
|
19
20
|
Requires-Dist: lxml
|
|
20
|
-
Requires-Dist: dash==2.9.3
|
|
21
21
|
Requires-Dist: dash_bootstrap_components
|
|
22
22
|
Requires-Dist: dash_daq
|
|
23
23
|
Requires-Dist: dash_dangerously_set_inner_html
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="plotguy",
|
|
8
|
-
version="2.
|
|
8
|
+
version="2.2.0",
|
|
9
9
|
author="Plotguy Team",
|
|
10
10
|
author_email="plotguy.info@gmail.com",
|
|
11
11
|
description="Plotguy",
|
|
@@ -19,9 +19,9 @@ setuptools.setup(
|
|
|
19
19
|
'pyarrow==23.0.0',
|
|
20
20
|
'fastparquet',
|
|
21
21
|
'polars==0.18.15',
|
|
22
|
+
'dash==2.9.3',
|
|
22
23
|
'plotly==5.18.0',
|
|
23
24
|
'lxml',
|
|
24
|
-
'dash==2.9.3',
|
|
25
25
|
'dash_bootstrap_components',
|
|
26
26
|
'dash_daq',
|
|
27
27
|
'dash_dangerously_set_inner_html',
|
|
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
|