- improved
git-svn-id: http://moon:8086/svn/projects/Stock@347 fda53097-d464-4ada-af97-ba876c37ca34
This commit is contained in:
@@ -11,12 +11,18 @@
|
|||||||
# https://www.investopedia.com/articles/technical/02/050602.asp
|
# https://www.investopedia.com/articles/technical/02/050602.asp
|
||||||
# https://ntguardian.wordpress.com/2016/09/19/introduction-stock-market-data-python-1
|
# 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
|
from stock import Stock
|
||||||
|
|
||||||
params = {
|
params = {
|
||||||
'show_range_days' : 5,
|
'show_range_days' : 10,
|
||||||
'btfd' : {'thresh_max' : -10, 'thresh_min' : 1, 'cand_window' : 5},
|
'btfd' : {'thresh_max' : -7, 'thresh_min' : 1, 'cand_window' : 5},
|
||||||
'k_euro' : 1 / 1.11,
|
'k_euro' : 1 / 1.11,
|
||||||
'ema_alpha' : 0.75,
|
'ema_alpha' : 0.75,
|
||||||
'sma_days' : 10,
|
'sma_days' : 10,
|
||||||
@@ -136,7 +142,7 @@ def buy_callback(data):
|
|||||||
buy_list[name]['items'].append(item)
|
buy_list[name]['items'].append(item)
|
||||||
|
|
||||||
print(data)
|
print(data)
|
||||||
do_plot = 0
|
|
||||||
figNum = 1
|
figNum = 1
|
||||||
if len(show_symbols) > 0:
|
if len(show_symbols) > 0:
|
||||||
for symbol in show_symbols:
|
for symbol in show_symbols:
|
||||||
@@ -180,6 +186,7 @@ for symbol in buy_list:
|
|||||||
|
|
||||||
if num_stocks > 0:
|
if num_stocks > 0:
|
||||||
print ('Gain total = {} %'.format(gain_accum/num_stocks))
|
print ('Gain total = {} %'.format(gain_accum/num_stocks))
|
||||||
|
|
||||||
if do_plot:
|
if do_plot:
|
||||||
plt.show()
|
plt.show()
|
||||||
|
|
||||||
|
|||||||
@@ -7,10 +7,7 @@ import os
|
|||||||
import time
|
import time
|
||||||
import agent
|
import agent
|
||||||
from functions import *
|
from functions import *
|
||||||
#import matplotlib.pyplot as plt
|
import matplotlib.pyplot as plt
|
||||||
#import matplotlib as mpl
|
|
||||||
|
|
||||||
#mpl.rc('figure', max_open_warning = 0)
|
|
||||||
|
|
||||||
key = '0UO7Z2MVZ2YSQSVE'
|
key = '0UO7Z2MVZ2YSQSVE'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user