Ejemplo n.º 1
0
def stockValueOverTime():
    print(
        "enter the code for the company you want to check the predictions of:")
    companyCode = input()
    print("Enter the start Date(SYNTAX: YYYY-MM-DD)")
    start_date = input(datetime.date)
    print("Enter the end Date(SYNTAX: YYYY-MM-DD)")
    end_date = input(datetime.date)
    print("Enter number of shares")
    nshares = int(input())
    st = Stocker(companyCode)
    st.buy_and_hold(start_date, end_date, nshares)
Ejemplo n.º 2
0
# In[34]:

f = open('msft4.txt', 'w')
f.write(
    str(
        microsoft.plot_stock(start_date='2015-01-01',
                             end_date=None,
                             stats=['Adj. Volume'],
                             plot_type='pct')))
f.close()

# In[35]:

microsoft.buy_and_hold(start_date='1986-03-13',
                       end_date='2018-01-16',
                       nshares=100)

# In[36]:

f = open('msft5.txt', 'w')
f.write(
    str(
        microsoft.buy_and_hold(start_date='1986-03-13',
                               end_date='2018-01-16',
                               nshares=100)))
f.close()

# In[37]:

microsoft.buy_and_hold(start_date='1999-01-05',
Ejemplo n.º 3
0
                     stats = ['Adj. Volume'], plot_type='pct')


# In[13]:


f = open('./BMI/bmi4.txt','w')
f.write(str(britishmidland.plot_stock(start_date = '2015-01-01', end_date = None, 
                     stats = ['Adj. Volume'], plot_type='pct')))
f.close()


# In[14]:


britishmidland.buy_and_hold(start_date='1986-03-13', end_date='2018-01-16', nshares=100)


# In[15]:


f = open('./BMI/bmi5.txt','w')
f.write(str(britishmidland.buy_and_hold(start_date='1986-03-13', end_date='2018-01-16', nshares=100)))
f.close()


# In[16]:


britishmidland.buy_and_hold(start_date='1999-01-05', end_date='2002-01-03', nshares=100)
Ejemplo n.º 4
0
get_ipython().system('pip install quandl')
get_ipython().system('pip install fbprophet')
get_ipython().system('pip install pytrends')

from stocker import Stocker
import quandl
quandl.ApiConfig.api_key = 'AsJgrNdvc_MbnWxwNB4V'
import matplotlib.pyplot as plt

ms = Stocker('MSFT')

ms.plot_stock()
ms.changepoint_date_analysis()
ms.buy_and_hold(start_date='2017-09-01', end_date='2018-03-01', nshares=100)
model, future = ms.create_prophet_model(days=180)