seolpyo-mplchart 0.0.5__py3-none-any.whl → 0.0.31__py3-none-any.whl
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 seolpyo-mplchart might be problematic. Click here for more details.
- seolpyo_mplchart/draw.py +9 -9
- seolpyo_mplchart/slider.py +5 -13
- {seolpyo_mplchart-0.0.5.dist-info → seolpyo_mplchart-0.0.31.dist-info}/METADATA +6 -10
- {seolpyo_mplchart-0.0.5.dist-info → seolpyo_mplchart-0.0.31.dist-info}/RECORD +6 -6
- {seolpyo_mplchart-0.0.5.dist-info → seolpyo_mplchart-0.0.31.dist-info}/WHEEL +0 -0
- {seolpyo_mplchart-0.0.5.dist-info → seolpyo_mplchart-0.0.31.dist-info}/top_level.txt +0 -0
seolpyo_mplchart/draw.py
CHANGED
|
@@ -54,7 +54,7 @@ class DataMixin(Base):
|
|
|
54
54
|
if k in _set_key: raise Exception(f'you can not set "self.{i}" value in {_set_key}.\nself.{i}={k!r}')
|
|
55
55
|
if i != 'date':
|
|
56
56
|
dtype = df[k].dtype
|
|
57
|
-
if not isinstance(dtype,
|
|
57
|
+
if not isinstance(dtype, np.dtypes.Float64DType): raise TypeError(f'Data column type must be "float64".(excluding "date" column)\ndf[{k!r}].dtype={dtype!r}')
|
|
58
58
|
|
|
59
59
|
for i in self.list_ma: df[f'ma{i}'] = df[self.close].rolling(i).mean()
|
|
60
60
|
|
|
@@ -66,25 +66,25 @@ class DataMixin(Base):
|
|
|
66
66
|
df['vleft'] = df['x'] - volumewidth_half
|
|
67
67
|
df['vright'] = df['x'] + volumewidth_half
|
|
68
68
|
|
|
69
|
-
df['top'] = np.where(df[
|
|
70
|
-
df['top'] = np.where(df[
|
|
71
|
-
df['bottom'] = np.where(df[
|
|
72
|
-
df['bottom'] = np.where(df[
|
|
69
|
+
df['top'] = np.where(df['open'] <= df['close'], df['close'], df['open'])
|
|
70
|
+
df['top'] = np.where(df['close'] < df['open'], df['open'], df['close'])
|
|
71
|
+
df['bottom'] = np.where(df['open'] <= df['close'], df['open'], df['close'])
|
|
72
|
+
df['bottom'] = np.where(df['close'] < df['open'], df['close'], df['open'])
|
|
73
73
|
|
|
74
74
|
# 양봉
|
|
75
75
|
df.loc[:, ['facecolor', 'edgecolor']] = (self.color_up, self.color_up)
|
|
76
76
|
if self.color_up != self.color_down:
|
|
77
77
|
# 음봉
|
|
78
|
-
df.loc[df[
|
|
78
|
+
df.loc[df['close'] < df['open'], ['facecolor', 'edgecolor']] = (self.color_down, self.color_down)
|
|
79
79
|
if self.color_up != self.color_flat:
|
|
80
80
|
# 보합
|
|
81
|
-
df.loc[df[
|
|
81
|
+
df.loc[df['close'] == df['open'], ['facecolor', 'edgecolor']] = (self.color_flat, self.color_flat)
|
|
82
82
|
if self.color_up != self.color_up_down:
|
|
83
83
|
# 양봉(비우기)
|
|
84
|
-
df.loc[(df['facecolor'] == self.color_up) & (df[
|
|
84
|
+
df.loc[(df['facecolor'] == self.color_up) & (df['close'] < df['close'].shift(1)), 'facecolor'] = self.color_up_down
|
|
85
85
|
if self.color_down != self.color_down_up:
|
|
86
86
|
# 음봉(비우기)
|
|
87
|
-
df.loc[(df['facecolor'] == self.color_down) & (df[
|
|
87
|
+
df.loc[(df['facecolor'] == self.color_down) & (df['close'].shift(1) < df['close']), ['facecolor']] = self.color_down_up
|
|
88
88
|
|
|
89
89
|
self.df = df
|
|
90
90
|
return
|
seolpyo_mplchart/slider.py
CHANGED
|
@@ -329,7 +329,7 @@ class LimMixin(DrawMixin):
|
|
|
329
329
|
|
|
330
330
|
class SimpleMixin(LimMixin):
|
|
331
331
|
simpler = False
|
|
332
|
-
limit_volume =
|
|
332
|
+
limit_volume = 2_000
|
|
333
333
|
|
|
334
334
|
def __init__(self, *args, **kwargs):
|
|
335
335
|
super().__init__(*args, **kwargs)
|
|
@@ -351,7 +351,7 @@ class SimpleMixin(LimMixin):
|
|
|
351
351
|
seg = self.df[['x', self.high, self.low]].agg(get_wickline, axis=1)
|
|
352
352
|
self.blitcandle.set_segments(seg)
|
|
353
353
|
self.blitcandle.set_edgecolor(self.df['edgecolor'])
|
|
354
|
-
self.priceline.set_verts(
|
|
354
|
+
self.priceline.set_verts([self.df[['x', self.close]].apply(tuple, axis=1).tolist()])
|
|
355
355
|
|
|
356
356
|
volmax = self.df[self.volume].max()
|
|
357
357
|
l = self.df.__len__()
|
|
@@ -381,20 +381,12 @@ class SimpleMixin(LimMixin):
|
|
|
381
381
|
self.ax_price.xaxis.draw(renderer)
|
|
382
382
|
self.ax_price.yaxis.draw(renderer)
|
|
383
383
|
|
|
384
|
-
|
|
385
|
-
Range = right - left
|
|
386
|
-
if self.simpler:
|
|
387
|
-
if Range < 1_000: self.blitcandle.draw(renderer)
|
|
388
|
-
else: self.priceline.draw(renderer)
|
|
384
|
+
if self.simpler: self.blitcandle.draw(renderer)
|
|
389
385
|
elif self.candle_on_ma:
|
|
390
386
|
self.macollection.draw(renderer)
|
|
391
|
-
|
|
392
|
-
elif 800 < Range: self.blitcandle.draw(renderer)
|
|
393
|
-
else: self.candlecollection.draw(renderer)
|
|
387
|
+
self.candlecollection.draw(renderer)
|
|
394
388
|
else:
|
|
395
|
-
|
|
396
|
-
elif 800 < Range: self.blitcandle.draw(renderer)
|
|
397
|
-
else: self.candlecollection.draw(renderer)
|
|
389
|
+
self.candlecollection.draw(renderer)
|
|
398
390
|
self.macollection.draw(renderer)
|
|
399
391
|
|
|
400
392
|
self.ax_volume.xaxis.draw(renderer)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: seolpyo-mplchart
|
|
3
|
-
Version: 0.0.
|
|
4
|
-
Summary: Fast candlestick chart using Python.
|
|
3
|
+
Version: 0.0.31
|
|
4
|
+
Summary: Fast candlestick chart using Python.
|
|
5
5
|
Author-email: white-seolpyo <white-seolpyo@naver.com>
|
|
6
6
|
License: MIT License
|
|
7
7
|
Project-URL: Homepage, https://white.seolpyo.com/
|
|
@@ -22,8 +22,8 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
23
|
Requires-Python: >=3.11
|
|
24
24
|
Description-Content-Type: text/markdown
|
|
25
|
-
Requires-Dist: matplotlib>=3.
|
|
26
|
-
Requires-Dist: pandas>=2.
|
|
25
|
+
Requires-Dist: matplotlib>=3.9.2
|
|
26
|
+
Requires-Dist: pandas>=2.2.2
|
|
27
27
|
|
|
28
28
|
# Donation
|
|
29
29
|
Bitcoin: 1MKCHW8smDZv5DFMiVkA5G3DeXcMn871ZX
|
|
@@ -38,10 +38,6 @@ Ethereum: 0x1c5fb8a5e0b1153cd4116c91736bd16fabf83520
|
|
|
38
38
|
|
|
39
39
|
|
|
40
40
|
# Sample
|
|
41
|
-

|
|
42
42
|
|
|
43
|
-

|
|
46
|
-
|
|
47
|
-

|
|
43
|
+

|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
seolpyo_mplchart/__init__.py,sha256=bsfjo70OG4go5ZNaFziLpXPMZ9wWSGQdx1ujuaGBzCQ,1289
|
|
2
2
|
seolpyo_mplchart/base.py,sha256=vQ4OOBm3nGwjJ4wjDLaD_3LGxYzlP6AWpI6SZrZiwnQ,3600
|
|
3
3
|
seolpyo_mplchart/cursor.py,sha256=-IUk2JcjvIM-TjHyeJx3lJFVI_Sx0xccDcO_RL-Co4c,17185
|
|
4
|
-
seolpyo_mplchart/draw.py,sha256=
|
|
5
|
-
seolpyo_mplchart/slider.py,sha256=
|
|
4
|
+
seolpyo_mplchart/draw.py,sha256=GSvZBUIUyrlztdcxYD6_Ef1d5ZBdxi9uyLvAYb0WWVQ,12786
|
|
5
|
+
seolpyo_mplchart/slider.py,sha256=0ZDJIs5rR1spoc3my5chuKXkKOJsXUjbDk6utDBABcU,23060
|
|
6
6
|
seolpyo_mplchart/test.py,sha256=cW2hoaVbRtoSXlpmA4i1BKHBjI3-FAqYq__kryxkrC8,1007
|
|
7
7
|
seolpyo_mplchart/utils.py,sha256=-8cq4-WwiqKQxtwu3NPxOVTDDvoWH28tu4OTWr4hPTg,1208
|
|
8
8
|
seolpyo_mplchart/data/apple.txt,sha256=0izAfweu1lLsC0IwVthdVlo9reG8KGbKGTSX5knI5Zc,1380864
|
|
9
9
|
seolpyo_mplchart/data/samsung.txt,sha256=UejaSkbzr4E5K3lkelCT0yJiWUPfmViBEaTyoXyphIs,2476424
|
|
10
|
-
seolpyo_mplchart-0.0.
|
|
11
|
-
seolpyo_mplchart-0.0.
|
|
12
|
-
seolpyo_mplchart-0.0.
|
|
13
|
-
seolpyo_mplchart-0.0.
|
|
10
|
+
seolpyo_mplchart-0.0.31.dist-info/METADATA,sha256=57WzTcNibE2Lgqbn7Y-YHKQ88ZL2FHNCXjFnxq2gSZo,1880
|
|
11
|
+
seolpyo_mplchart-0.0.31.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
|
12
|
+
seolpyo_mplchart-0.0.31.dist-info/top_level.txt,sha256=KgqFn7rKWize7OjMaTCHxKm9ie6vqnyb5c8fN7y_tSo,17
|
|
13
|
+
seolpyo_mplchart-0.0.31.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|