stocks

efficient way to find several rows above and below a subset of data

送分小仙女□ 提交于 2021-02-20 09:04:08
问题 I'm wondering if there's an efficient way to get X number of rows below and above a subset of rows. I've created a basic implementation below, but I'm sure there's a better way. The subset that I care about is buyindex, which is the indices of rows that have the buy signal. I want to get several rows above and below the sellindex to verify that my algorithm is working correctly. How do I do it in an efficient way? My way seems roundabout. buyindex = list(data2[data2['buy'] == True].index)

Reinforcement Learning Using Multiple Stock Ticker’s Datasets?

老子叫甜甜 提交于 2021-02-19 07:49:05
问题 Here’s a general question that maybe someone could point me in the right direction. I’m getting into Reinforcement Learning with Python 3.6/Tensorflow and I have found/tweaked my own model to train on historical data from a particular stock. My question is, is it possible to train this model on more than just one stock’s dataset? Every single machine learning article I’ve read on time series prediction and RL uses one dataset for training and testing, but my goal is to train a model on a

Find running minimum and Max in R

假装没事ソ 提交于 2021-02-04 08:28:04
问题 I have a vector of stock prices throughout the day: > head(bidStock) [,1] [1,] 1179.754 [2,] 1178.000 [3,] 1178.438 [4,] 1178.367 [5,] 1178.830 [6,] 1178.830 I want to find two things. As I the algorithm goes through the day. I want it to find how far the current point is from the historical minimum and maxim throughout the day. There is a function called 'mdd' in the 'stocks' package which finds the maximum draw down throughout the day (i.e. the lowest value which corresponds to a point

xtsible object, looping in quantmod

谁都会走 提交于 2021-01-29 01:49:45
问题 I would like to loop through a list of stock symbols and print them with chartSeries . It would be easier than always changing the argument. Unfortunatly I always get an error, when I want to loop or subset: Error in try.xts(x, error = "chartSeries requires an xtsible object"): chartSeries requires an xtsible object Here the code that produces the error: library(quantmod) stocks <- c("FIS", "AXP", "AVB") symbols <- (getSymbols(stocks, src='yahoo')) for (i in symbols){ chartSeries(i, theme=

xtsible object, looping in quantmod

自闭症网瘾萝莉.ら 提交于 2021-01-29 01:49:34
问题 I would like to loop through a list of stock symbols and print them with chartSeries . It would be easier than always changing the argument. Unfortunatly I always get an error, when I want to loop or subset: Error in try.xts(x, error = "chartSeries requires an xtsible object"): chartSeries requires an xtsible object Here the code that produces the error: library(quantmod) stocks <- c("FIS", "AXP", "AVB") symbols <- (getSymbols(stocks, src='yahoo')) for (i in symbols){ chartSeries(i, theme=

xtsible object, looping in quantmod

那年仲夏 提交于 2021-01-29 01:48:35
问题 I would like to loop through a list of stock symbols and print them with chartSeries . It would be easier than always changing the argument. Unfortunatly I always get an error, when I want to loop or subset: Error in try.xts(x, error = "chartSeries requires an xtsible object"): chartSeries requires an xtsible object Here the code that produces the error: library(quantmod) stocks <- c("FIS", "AXP", "AVB") symbols <- (getSymbols(stocks, src='yahoo')) for (i in symbols){ chartSeries(i, theme=

xtsible object, looping in quantmod

好久不见. 提交于 2021-01-29 01:42:02
问题 I would like to loop through a list of stock symbols and print them with chartSeries . It would be easier than always changing the argument. Unfortunatly I always get an error, when I want to loop or subset: Error in try.xts(x, error = "chartSeries requires an xtsible object"): chartSeries requires an xtsible object Here the code that produces the error: library(quantmod) stocks <- c("FIS", "AXP", "AVB") symbols <- (getSymbols(stocks, src='yahoo')) for (i in symbols){ chartSeries(i, theme=

How can I download stock price data with Python?

半腔热情 提交于 2020-01-01 04:59:25
问题 I have installed pandas-daatreader but both the Google and Yahoo APIs for downloading historical stock price data have been deprecated. import pandas_datareader.data as web start_date = '2018-01-01' end_date = '2018-06-08' panel_data = web.DataReader('SPY', 'yahoo', start_date, end_date) ImmediateDeprecationError: Yahoo Daily has been immediately deprecated due to large breaks in the API without the introduction of a stable replacement. Pull Requests to re-enable these data connectors are