goldhand 15.7__tar.gz → 15.10__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.

Potentially problematic release.


This version of goldhand might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: goldhand
3
- Version: 15.7
3
+ Version: 15.10
4
4
  Summary: A package working with financial data
5
5
  Home-page: https://github.com/misrori/goldhand
6
6
  Author: Mihaly
@@ -17,6 +17,38 @@ Requires-Dist: requests
17
17
  Requires-Dist: cloudscraper
18
18
  Requires-Dist: tqdm
19
19
 
20
+ class Backtest:
21
+ """
22
+ The Backtest class represents a simulation of a trading strategy on historical data.
23
+
24
+ Attributes:
25
+ strategy (Strategy): The trading strategy to be backtested.
26
+ data (pd.DataFrame): The historical data used for the backtest.
27
+ capital (float): The initial capital for the backtest.
28
+ """
29
+
30
+ def __init__(self, strategy, data, capital):
31
+ """
32
+ Initializes a new instance of the Backtest class.
33
+
34
+ Args:
35
+ strategy (Strategy): The trading strategy to be backtested.
36
+ data (pd.DataFrame): The historical data used for the backtest.
37
+ capital (float): The initial capital for the backtest.
38
+ """
39
+ self.strategy = strategy
40
+ self.data = data
41
+ self.capital = capital
42
+
43
+ def run(self):
44
+ """
45
+ Runs the backtest using the specified strategy and data.
46
+
47
+ Returns:
48
+ pd.DataFrame: The results of the backtest, including performance metrics.
49
+ """
50
+ # Implementation details...
51
+ pass
20
52
  # Goldhand
21
53
  The ultimate python package to work with stock and crypto data
22
54
 
@@ -64,6 +96,9 @@ tw.get_sec_plot('AMD').show()
64
96
 
65
97
  # Goldhand class
66
98
 
99
+ The `GoldHand` class is a part of the `goldhand` Python package, which provides functionality for working with stock and crypto data. This class allows users to retrieve detailed information and charts for a specific stock.
100
+
101
+
67
102
 
68
103
  ```python
69
104
 
@@ -78,10 +113,12 @@ t.df.tail().T
78
113
  ```python
79
114
 
80
115
  # Get a detailed chart of a stock AMD
81
- ticker = "AMD"
116
+ ticker = "TSLA"
82
117
  t = GoldHand(ticker)
83
118
  t.plotly_last_year(tw.get_plotly_title(ticker)).show()
84
119
 
120
+ ## Stock Chart
121
+
85
122
  ```
86
123
  !['Detailed stock chart'](https://github.com/misrori/goldhand/blob/main/img/stock_plot.png?raw=true "Stock plot")
87
124
 
@@ -99,3 +136,20 @@ t.plotly_last_year(tw.get_plotly_title(ticker)).show()
99
136
 
100
137
 
101
138
 
139
+ ## GoldHand Line indicator
140
+
141
+ ```python
142
+ ticker = "TSLA"
143
+ t = GoldHand(ticker)
144
+ t.plot_goldhand_line(tw.get_plotly_title(ticker)).show()
145
+
146
+ ```
147
+ !['Detailed crypto chart'](https://github.com/misrori/goldhand/blob/main/img/goldhandline_plot.png?raw=true "crypto plot")
148
+
149
+
150
+
151
+ # Backtest
152
+
153
+ The Backtest class is a powerful tool for evaluating the performance of trading strategies using historical data. It allows you to simulate trades and calculate various performance metrics to assess the profitability and risk of your strategy.
154
+
155
+ It takes a data and a function and display the trades.
@@ -0,0 +1,136 @@
1
+ class Backtest:
2
+ """
3
+ The Backtest class represents a simulation of a trading strategy on historical data.
4
+
5
+ Attributes:
6
+ strategy (Strategy): The trading strategy to be backtested.
7
+ data (pd.DataFrame): The historical data used for the backtest.
8
+ capital (float): The initial capital for the backtest.
9
+ """
10
+
11
+ def __init__(self, strategy, data, capital):
12
+ """
13
+ Initializes a new instance of the Backtest class.
14
+
15
+ Args:
16
+ strategy (Strategy): The trading strategy to be backtested.
17
+ data (pd.DataFrame): The historical data used for the backtest.
18
+ capital (float): The initial capital for the backtest.
19
+ """
20
+ self.strategy = strategy
21
+ self.data = data
22
+ self.capital = capital
23
+
24
+ def run(self):
25
+ """
26
+ Runs the backtest using the specified strategy and data.
27
+
28
+ Returns:
29
+ pd.DataFrame: The results of the backtest, including performance metrics.
30
+ """
31
+ # Implementation details...
32
+ pass
33
+ # Goldhand
34
+ The ultimate python package to work with stock and crypto data
35
+
36
+ ```bash
37
+ pip install goldhand
38
+ ```
39
+
40
+
41
+ # TradingView
42
+
43
+
44
+ ```python
45
+ from goldhand import *
46
+
47
+ # tradingView data
48
+ tw = Tw()
49
+
50
+ # data frame of the stocks
51
+ tw.stock
52
+
53
+ # data frame of the top 300 crypto currency
54
+ tw.crypto
55
+
56
+ # data frame of the top 3000 etf
57
+ tw.etf
58
+
59
+ ```
60
+
61
+ ```python
62
+ # Get a plot of the stock to see the location in the sector
63
+ tw.get_sec_plot('AMD').show()
64
+
65
+ ```
66
+ ![Sector plot](https://github.com/misrori/goldhand/blob/main/img/sec_plot.png?raw=true "Sector location of FDS")
67
+
68
+
69
+ ```python
70
+ # Get a plot of the stock to see the location in the industry
71
+ tw.get_sec_plot('AMD').show()
72
+
73
+ ```
74
+ ![Sector plot](https://github.com/misrori/goldhand/blob/main/img/ind_plot.png?raw=true "Sector location of FDS")
75
+
76
+
77
+
78
+ # Goldhand class
79
+
80
+ The `GoldHand` class is a part of the `goldhand` Python package, which provides functionality for working with stock and crypto data. This class allows users to retrieve detailed information and charts for a specific stock.
81
+
82
+
83
+
84
+ ```python
85
+
86
+ # Get a detailed chart of a stock AMD
87
+ ticker = "AMD"
88
+ t = GoldHand(ticker)
89
+ t.df.tail().T
90
+ ```
91
+ ![data structure](https://github.com/misrori/goldhand/blob/main/img/df_structure.png?raw=true "data structure")
92
+
93
+
94
+ ```python
95
+
96
+ # Get a detailed chart of a stock AMD
97
+ ticker = "TSLA"
98
+ t = GoldHand(ticker)
99
+ t.plotly_last_year(tw.get_plotly_title(ticker)).show()
100
+
101
+ ## Stock Chart
102
+
103
+ ```
104
+ !['Detailed stock chart'](https://github.com/misrori/goldhand/blob/main/img/stock_plot.png?raw=true "Stock plot")
105
+
106
+ ```python
107
+
108
+ # Get a detailed chart of a crypto
109
+ ticker = "BTC-USD"
110
+ t = GoldHand(ticker)
111
+ t.plotly_last_year(tw.get_plotly_title(ticker)).show()
112
+
113
+
114
+ ```
115
+ !['Detailed crypto chart'](https://github.com/misrori/goldhand/blob/main/img/crypto_plot.png?raw=true "crypto plot")
116
+
117
+
118
+
119
+
120
+ ## GoldHand Line indicator
121
+
122
+ ```python
123
+ ticker = "TSLA"
124
+ t = GoldHand(ticker)
125
+ t.plot_goldhand_line(tw.get_plotly_title(ticker)).show()
126
+
127
+ ```
128
+ !['Detailed crypto chart'](https://github.com/misrori/goldhand/blob/main/img/goldhandline_plot.png?raw=true "crypto plot")
129
+
130
+
131
+
132
+ # Backtest
133
+
134
+ The Backtest class is a powerful tool for evaluating the performance of trading strategies using historical data. It allows you to simulate trades and calculate various performance metrics to assess the profitability and risk of your strategy.
135
+
136
+ It takes a data and a function and display the trades.
@@ -73,10 +73,15 @@ class Backtest:
73
73
  'max_lost(%)' : round(((self.trades['result'].min()-1)*100),2),
74
74
 
75
75
  'first_trade_buy' : min(self.trades['buy_date']),
76
- 'first_close_price' : self.data['close'].iloc[0],
77
- 'first_date' : self.data['date'].iloc[0],
78
- 'last_price' : self.data['close'].iloc[-1],
79
- 'hold_result' : round(((self.data['close'].iloc[-1] / self.data['close'].iloc[0])-1)*100,2)
76
+
77
+
78
+ 'first_data_date' : self.data['date'].iloc[0],
79
+ 'first_open_price' : self.data['open'].iloc[0],
80
+
81
+ 'last_data_date' : self.data['date'].iloc[-1],
82
+ 'last_close_price' : self.data['close'].iloc[-1],
83
+
84
+ 'hold_result' : f"{round(self.data['close'].iloc[-1] / self.data['open'].iloc[0],2)} x",
80
85
 
81
86
 
82
87
  }
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: goldhand
3
- Version: 15.7
3
+ Version: 15.10
4
4
  Summary: A package working with financial data
5
5
  Home-page: https://github.com/misrori/goldhand
6
6
  Author: Mihaly
@@ -17,6 +17,38 @@ Requires-Dist: requests
17
17
  Requires-Dist: cloudscraper
18
18
  Requires-Dist: tqdm
19
19
 
20
+ class Backtest:
21
+ """
22
+ The Backtest class represents a simulation of a trading strategy on historical data.
23
+
24
+ Attributes:
25
+ strategy (Strategy): The trading strategy to be backtested.
26
+ data (pd.DataFrame): The historical data used for the backtest.
27
+ capital (float): The initial capital for the backtest.
28
+ """
29
+
30
+ def __init__(self, strategy, data, capital):
31
+ """
32
+ Initializes a new instance of the Backtest class.
33
+
34
+ Args:
35
+ strategy (Strategy): The trading strategy to be backtested.
36
+ data (pd.DataFrame): The historical data used for the backtest.
37
+ capital (float): The initial capital for the backtest.
38
+ """
39
+ self.strategy = strategy
40
+ self.data = data
41
+ self.capital = capital
42
+
43
+ def run(self):
44
+ """
45
+ Runs the backtest using the specified strategy and data.
46
+
47
+ Returns:
48
+ pd.DataFrame: The results of the backtest, including performance metrics.
49
+ """
50
+ # Implementation details...
51
+ pass
20
52
  # Goldhand
21
53
  The ultimate python package to work with stock and crypto data
22
54
 
@@ -64,6 +96,9 @@ tw.get_sec_plot('AMD').show()
64
96
 
65
97
  # Goldhand class
66
98
 
99
+ The `GoldHand` class is a part of the `goldhand` Python package, which provides functionality for working with stock and crypto data. This class allows users to retrieve detailed information and charts for a specific stock.
100
+
101
+
67
102
 
68
103
  ```python
69
104
 
@@ -78,10 +113,12 @@ t.df.tail().T
78
113
  ```python
79
114
 
80
115
  # Get a detailed chart of a stock AMD
81
- ticker = "AMD"
116
+ ticker = "TSLA"
82
117
  t = GoldHand(ticker)
83
118
  t.plotly_last_year(tw.get_plotly_title(ticker)).show()
84
119
 
120
+ ## Stock Chart
121
+
85
122
  ```
86
123
  !['Detailed stock chart'](https://github.com/misrori/goldhand/blob/main/img/stock_plot.png?raw=true "Stock plot")
87
124
 
@@ -99,3 +136,20 @@ t.plotly_last_year(tw.get_plotly_title(ticker)).show()
99
136
 
100
137
 
101
138
 
139
+ ## GoldHand Line indicator
140
+
141
+ ```python
142
+ ticker = "TSLA"
143
+ t = GoldHand(ticker)
144
+ t.plot_goldhand_line(tw.get_plotly_title(ticker)).show()
145
+
146
+ ```
147
+ !['Detailed crypto chart'](https://github.com/misrori/goldhand/blob/main/img/goldhandline_plot.png?raw=true "crypto plot")
148
+
149
+
150
+
151
+ # Backtest
152
+
153
+ The Backtest class is a powerful tool for evaluating the performance of trading strategies using historical data. It allows you to simulate trades and calculate various performance metrics to assess the profitability and risk of your strategy.
154
+
155
+ It takes a data and a function and display the trades.
@@ -8,7 +8,7 @@ long_description = (this_directory / "README.md").read_text()
8
8
 
9
9
  setup(
10
10
  name="goldhand",
11
- version="15.7",
11
+ version="15.10",
12
12
  author="Mihaly",
13
13
  author_email="ormraat.pte@gmail.com",
14
14
  description="A package working with financial data",
goldhand-15.7/README.md DELETED
@@ -1,82 +0,0 @@
1
- # Goldhand
2
- The ultimate python package to work with stock and crypto data
3
-
4
- ```bash
5
- pip install goldhand
6
- ```
7
-
8
-
9
- # TradingView
10
-
11
-
12
- ```python
13
- from goldhand import *
14
-
15
- # tradingView data
16
- tw = Tw()
17
-
18
- # data frame of the stocks
19
- tw.stock
20
-
21
- # data frame of the top 300 crypto currency
22
- tw.crypto
23
-
24
- # data frame of the top 3000 etf
25
- tw.etf
26
-
27
- ```
28
-
29
- ```python
30
- # Get a plot of the stock to see the location in the sector
31
- tw.get_sec_plot('AMD').show()
32
-
33
- ```
34
- ![Sector plot](https://github.com/misrori/goldhand/blob/main/img/sec_plot.png?raw=true "Sector location of FDS")
35
-
36
-
37
- ```python
38
- # Get a plot of the stock to see the location in the industry
39
- tw.get_sec_plot('AMD').show()
40
-
41
- ```
42
- ![Sector plot](https://github.com/misrori/goldhand/blob/main/img/ind_plot.png?raw=true "Sector location of FDS")
43
-
44
-
45
-
46
- # Goldhand class
47
-
48
-
49
- ```python
50
-
51
- # Get a detailed chart of a stock AMD
52
- ticker = "AMD"
53
- t = GoldHand(ticker)
54
- t.df.tail().T
55
- ```
56
- ![data structure](https://github.com/misrori/goldhand/blob/main/img/df_structure.png?raw=true "data structure")
57
-
58
-
59
- ```python
60
-
61
- # Get a detailed chart of a stock AMD
62
- ticker = "AMD"
63
- t = GoldHand(ticker)
64
- t.plotly_last_year(tw.get_plotly_title(ticker)).show()
65
-
66
- ```
67
- !['Detailed stock chart'](https://github.com/misrori/goldhand/blob/main/img/stock_plot.png?raw=true "Stock plot")
68
-
69
- ```python
70
-
71
- # Get a detailed chart of a crypto
72
- ticker = "BTC-USD"
73
- t = GoldHand(ticker)
74
- t.plotly_last_year(tw.get_plotly_title(ticker)).show()
75
-
76
-
77
- ```
78
- !['Detailed crypto chart'](https://github.com/misrori/goldhand/blob/main/img/crypto_plot.png?raw=true "crypto plot")
79
-
80
-
81
-
82
-
File without changes
File without changes
File without changes
File without changes
File without changes