- improved

git-svn-id: http://moon:8086/svn/projects/Stock@347 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
2020-01-07 17:46:24 +00:00
parent 82063b1006
commit 0eca00b8b6
2 changed files with 12 additions and 8 deletions
+11 -4
View File
@@ -11,12 +11,18 @@
# 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
do_plot = 1
if do_plot:
import matplotlib.pyplot as plt
import matplotlib as mpl
mpl.rc('figure', max_open_warning = 0)
from stock import Stock
params = {
'show_range_days' : 5,
'btfd' : {'thresh_max' : -10, 'thresh_min' : 1, 'cand_window' : 5},
'show_range_days' : 10,
'btfd' : {'thresh_max' : -7, 'thresh_min' : 1, 'cand_window' : 5},
'k_euro' : 1 / 1.11,
'ema_alpha' : 0.75,
'sma_days' : 10,
@@ -136,7 +142,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:
@@ -180,6 +186,7 @@ for symbol in buy_list:
if num_stocks > 0:
print ('Gain total = {} %'.format(gain_accum/num_stocks))
if do_plot:
plt.show()
+1 -4
View File
@@ -7,10 +7,7 @@ import os
import time
import agent
from functions import *
#import matplotlib.pyplot as plt
#import matplotlib as mpl
#mpl.rc('figure', max_open_warning = 0)
import matplotlib.pyplot as plt
key = '0UO7Z2MVZ2YSQSVE'