- store stocks in JSON file

- use convenient command line params

git-svn-id: http://moon:8086/svn/projects/Stock@348 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2020-01-07 20:00:46 +00:00
parent 0eca00b8b6
commit 76731eeceb
2 changed files with 41 additions and 111 deletions
+3 -3
View File
@@ -24,7 +24,7 @@ class Stock(object):
self.fig = None
self.currency = symbol_params['currency']
self.currency_corr = 1
if '$' in self.currency:
if 'USD' in self.currency:
self.currency_corr = self.params['k_euro']
self.data = {}
@@ -135,7 +135,7 @@ class Stock(object):
def __plot(self, id, data, keys):
ax = plt.subplot(id)
N = len(data['index'])
start = max(0, N - self.params['show_range_days'])
start = max(0, N - self.params['plot_range_days'])
stop = N
xr = list(range(start, stop))
sliced = Stock.slice(data, start, stop)
@@ -153,7 +153,7 @@ class Stock(object):
def __ind(self, data, keys):
N = len(data['index'])
start = max(0, N - self.params['show_range_days'])
start = max(0, N - self.params['plot_range_days'])
stop = N
xr = list(range(start, stop))
sliced = Stock.slice(data, start, stop)