goldhand 13.5__tar.gz → 14.2__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: 13.5
3
+ Version: 14.2
4
4
  Summary: A package working with financial data
5
5
  Home-page: https://github.com/misrori/goldhand
6
6
  Author: Mihaly
@@ -143,22 +143,22 @@ class GoldHand:
143
143
  self.df.loc[states[i], 'local_text'] = f'{temj}{fall}%<br>${round(current_low, 2)}'
144
144
 
145
145
 
146
- def plotly_last_year(self, plot_title, plot_height=900):
147
- tdf = self.df.tail(500)
146
+ def plotly_last_year(self, plot_title, plot_height=900, ndays=500, ad_local_min_max=True):
147
+ tdf = self.df.tail(ndays)
148
148
 
149
149
  fig = go.Figure(data=go.Ohlc(x=tdf['date'], open=tdf['open'], high=tdf['high'], low=tdf['low'],close=tdf['close']))
150
-
151
- for index, row in tdf[tdf['local']!=''].iterrows():
152
- direction = row['local']
153
- tdate = row['date']
154
- local_text = row['local_text']
155
- min_price = row['low']
156
- max_price = row['high']
157
- if direction == 'maximum':
158
- fig.add_annotation( x=tdate, y=max_price, text=local_text, showarrow=True, align="center", bordercolor="#c7c7c7", font=dict(family="Courier New, monospace", size=16, color="#214e34" ), borderwidth=2, borderpad=4, bgcolor="#f4fdff", opacity=0.8, arrowhead=2, arrowsize=1, arrowwidth=1, ax=-45,ay=-45)
159
-
160
- if direction == 'minimum':
161
- fig.add_annotation( x=tdate, y=min_price, text=local_text, showarrow=True, align="center", bordercolor="#c7c7c7", font=dict(family="Courier New, monospace", size=16, color="red" ), borderwidth=2, borderpad=4, bgcolor="#f4fdff", opacity=0.8, arrowhead=2, arrowsize=1, arrowwidth=1, ax=45,ay=45)
150
+ if ad_local_min_max:
151
+ for index, row in tdf[tdf['local']!=''].iterrows():
152
+ direction = row['local']
153
+ tdate = row['date']
154
+ local_text = row['local_text']
155
+ min_price = row['low']
156
+ max_price = row['high']
157
+ if direction == 'maximum':
158
+ fig.add_annotation( x=tdate, y=max_price, text=local_text, showarrow=True, align="center", bordercolor="#c7c7c7", font=dict(family="Courier New, monospace", size=16, color="#214e34" ), borderwidth=2, borderpad=4, bgcolor="#f4fdff", opacity=0.8, arrowhead=2, arrowsize=1, arrowwidth=1, ax=-45,ay=-45)
159
+
160
+ if direction == 'minimum':
161
+ fig.add_annotation( x=tdate, y=min_price, text=local_text, showarrow=True, align="center", bordercolor="#c7c7c7", font=dict(family="Courier New, monospace", size=16, color="red" ), borderwidth=2, borderpad=4, bgcolor="#f4fdff", opacity=0.8, arrowhead=2, arrowsize=1, arrowwidth=1, ax=45,ay=45)
162
162
 
163
163
  fig.update_layout(showlegend=False, plot_bgcolor='white', height=plot_height, title= plot_title)
164
164
 
@@ -169,7 +169,7 @@ class GoldHand:
169
169
  fig.add_trace( go.Scatter(x=tdf['date'], y=tdf['sma_200'], opacity =0.7, line=dict(color='red', width = 2.5) , name = 'SMA 200') )
170
170
  return(fig)
171
171
 
172
- def plot_goldhand_line(self, plot_title, plot_height=900):
172
+ def plot_goldhand_line(self, plot_title, plot_height=900, ndays=800, ad_local_min_max=True):
173
173
 
174
174
  data = self.df.copy()
175
175
  # Apply SMMA to the dataframe
@@ -190,9 +190,22 @@ class GoldHand:
190
190
  # Create a 'group' column and increase the value only when there's a color change
191
191
  data['group'] = (data['color_change']).cumsum()
192
192
 
193
- tdf = data.tail(800)
193
+ tdf = data.tail(ndays)
194
194
 
195
195
  fig = go.Figure(data=go.Ohlc(x=tdf['date'], open=tdf['open'], high=tdf['high'], low=tdf['low'],close=tdf['close']))
196
+ if ad_local_min_max:
197
+ for index, row in tdf[tdf['local']!=''].iterrows():
198
+ direction = row['local']
199
+ tdate = row['date']
200
+ local_text = row['local_text']
201
+ min_price = row['low']
202
+ max_price = row['high']
203
+ if direction == 'maximum':
204
+ fig.add_annotation( x=tdate, y=max_price, text=local_text, showarrow=True, align="center", bordercolor="#c7c7c7", font=dict(family="Courier New, monospace", size=16, color="#214e34" ), borderwidth=2, borderpad=4, bgcolor="#f4fdff", opacity=0.8, arrowhead=2, arrowsize=1, arrowwidth=1, ax=-45,ay=-45)
205
+
206
+ if direction == 'minimum':
207
+ fig.add_annotation( x=tdate, y=min_price, text=local_text, showarrow=True, align="center", bordercolor="#c7c7c7", font=dict(family="Courier New, monospace", size=16, color="red" ), borderwidth=2, borderpad=4, bgcolor="#f4fdff", opacity=0.8, arrowhead=2, arrowsize=1, arrowwidth=1, ax=45,ay=45)
208
+
196
209
 
197
210
  fig.update_xaxes( mirror=True, ticks='outside', showline=True, linecolor='black', gridcolor='lightgrey' )
198
211
  fig.update_yaxes( mirror=True, ticks='outside', showline=True, linecolor='black', gridcolor='lightgrey')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: goldhand
3
- Version: 13.5
3
+ Version: 14.2
4
4
  Summary: A package working with financial data
5
5
  Home-page: https://github.com/misrori/goldhand
6
6
  Author: Mihaly
@@ -8,7 +8,7 @@ long_description = (this_directory / "README.md").read_text()
8
8
 
9
9
  setup(
10
10
  name="goldhand",
11
- version="13.5",
11
+ version="14.2",
12
12
  author="Mihaly",
13
13
  author_email="ormraat.pte@gmail.com",
14
14
  description="A package working with financial data",
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes