Category : stock

I am having trouble trying to find the element of the time period. The next step i will do is to select the Max period and then download the data. I tried inspect element but could not find a suitable element for XPATH. Here’s my code enter code here import selenium import time from selenium.webdriver.common.keys ..

Read more

I have this part of the code done, but I would like to be able to add more columns like the Volume, Open, High. import pandas as pd import numpy as np from datetime import datetime import matplotlib.pyplot as plt plt.style.use("fivethirtyeight") from pandas.plotting import register_matplotlib_converters register_matplotlib_converters() assets = ["LAC", "NIO"] weights = np.array([0.5, 0.5]) stockStartDate ..

Read more

-> source code to create a LSTM model def create_model(learning_rate, num_dense_layers,num_input_nodes, num_dense_nodes, activation, adam_decay): model = Sequential() model.add(LSTM(units = num_input_nodes, input_shape= (30,4), activation=activation, return_sequences=True)) model.add(LSTM(units = 10, activation=activation)) for i in range(num_dense_layers): name = ‘layer_dense_{0}’.format(i+1) model.add(Dense(num_dense_nodes, activation=activation, name=name )) model.add(Dense(units=1)) adam = Adam(lr=learning_rate, decay= adam_decay) loss=Huber() model.compile(optimizer=adam, loss=loss) return model -> I got the optimized ..

Read more

I want to ask how I can download all market data at once and store it in a data frame. Also, is it possible to download all stocks in the specific industry? I know how to download individual stocks, but I want to download all stocks to analyze the correlations. Source: Python..

Read more

This is my code to get 2 years intraday data from Alpha Vantage API. from alpha_vantage.timeseries import TimeSeries import csv import time API_key = ‘XXXXXXXXXXXXXXXXX’ ticker = ‘AAPL’ ts = TimeSeries(key=API_key, output_format=’csv’) for yr in range(2): for mo in range(12): data = ts.get_intraday_extended(ticker, interval=’15min’, slice=’year’+str(yr+1)+’month’+str(mo+1)) with open(ticker+’.csv’, ‘a’, newline=”) as write_csvfile: writer = csv.writer(write_csvfile, dialect=’excel’) ..

Read more