Exemple #1
0
def get_symbol(ticker):

    if ticker is None:
        return 'Missing parameter: ' + _PARAM_TICKER

    name = pg.get_symbol_name(ticker)

    if name is None:
        return f'Symbol with ticker {ticker} NOT found!'
    else:
        return name[0]
Exemple #2
0
import numpy as np
import pandas as pd

import dash
import dash_core_components as dcc
import dash_html_components as html

from sklearn.linear_model import LinearRegression

import utils.AlphaVantageUtils as av
import utils.PostgresUtils as pg
import utils.ModelUtils as mdl

name = pg.get_symbol_name(av._TIC_MICROSOFT)
df_prices = pg.get_prices_with_features(av._TIC_MICROSOFT, av._INT_DAILY, None,
                                        None, None)

df_prices.drop(columns=['open', 'high', 'low', 'volume'], inplace=True)

print(df_prices.info())

df_train, df_test = mdl.train_test_split(df_prices, 1000)

predictions = []

train = df_train.drop(pg._COL_DATETIME, axis=1)
test = df_test.drop(pg._COL_DATETIME, axis=1)

print(train.shape)
print(test.shape)