- improved

git-svn-id: http://moon:8086/svn/projects/Stock@346 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2020-01-07 17:36:21 +00:00
parent f6b4bbe649
commit 82063b1006
2 changed files with 15 additions and 9 deletions
+10 -4
View File
@@ -11,7 +11,7 @@
# https://www.investopedia.com/articles/technical/02/050602.asp
# https://ntguardian.wordpress.com/2016/09/19/introduction-stock-market-data-python-1
import matplotlib.pyplot as plt
#import matplotlib.pyplot as plt
from stock import Stock
params = {
@@ -26,6 +26,7 @@ params = {
show_symbols = ['OHB.DE', 'ITMPF', 'PLUG', 'MOR.DE', 'CSCO', 'ERCA.DE', 'AVGO', 'DIS', 'UBSFF', 'DHER.DE', 'AIR']
show_symbols = ['CSCO']
#show_symbols = ['PCELF']
#show_symbols = ['OHB.DE']
#show_symbols = ['UBSFF']
#show_symbols = ['DHER.DE']
@@ -34,6 +35,9 @@ show_symbols = ['CSCO']
show_symbols = []
symbols = {
'KEP' : {'name' : 'Korea Electric Power Corporation', 'currency' : '$'},
'MRK.DE' : {'name' : 'Merck', 'currency' : ''},
'TOM.F' : {'name' : 'Toyota Motor Corporation', 'currency' : ''},
'SSHPF' : {'name' : 'Scanship Holding ASA', 'currency' : '$'},
'RIG' : {'name' : 'Transocean Ltd.', 'currency' : '$'},
'BBIO' : {'name' : 'BridgeBio Pharma, Inc.', 'currency' : '$'},
@@ -132,7 +136,7 @@ def buy_callback(data):
buy_list[name]['items'].append(item)
print(data)
do_plot = 0
figNum = 1
if len(show_symbols) > 0:
for symbol in show_symbols:
@@ -142,6 +146,7 @@ if len(show_symbols) > 0:
title.statistics()
try:
ind = title.analyze(buy_callback, range_days=params['show_range_days'])
if do_plot:
title.show(ind, figNum=figNum)
figNum += 1
except:
@@ -156,6 +161,7 @@ else:
ind = title.analyze(buy_callback, range_days=params['show_range_days'])
if Stock.has_candidate(ind, 'BTFD'):
print('-----------------------------------------------')
if do_plot:
title.show(ind, figNum=figNum)
figNum += 1
except:
@@ -174,6 +180,6 @@ for symbol in buy_list:
if num_stocks > 0:
print ('Gain total = {} %'.format(gain_accum/num_stocks))
plt.show()
if do_plot:
plt.show()
+3 -3
View File
@@ -7,10 +7,10 @@ import os
import time
import agent
from functions import *
import matplotlib.pyplot as plt
import matplotlib as mpl
#import matplotlib.pyplot as plt
#import matplotlib as mpl
mpl.rc('figure', max_open_warning = 0)
#mpl.rc('figure', max_open_warning = 0)
key = '0UO7Z2MVZ2YSQSVE'