finance

Convert data to OHLC (Open, High, Low, Close) in JavaScript?

£可爱£侵袭症+ 提交于 2019-11-28 12:54:34
Similar to create an OHLC data from Date, time, price using C# , how does one take the theory of converting basic trade data to OHLC (or Open, High, Low, Close) and apply it to this distinct case? var data = [{ "tid": 283945, "date": 1384934366, "amount": "0.08180000", "price": "501.30" }, { "tid": 283947, "date": 1384934066, "amount": "0.06110000", "price": "490.66" }, ... ]; function convertToOHLC(data) { // What goes here? } convertToOHLC(data); Here is the fiddle: https://jsfiddle.net/5dfjhnLw/ This is a working function for converting the data to OHLC: function convertToOHLC(data) { data

Remove duplicate rows from xts object

泪湿孤枕 提交于 2019-11-28 09:30:52
I am having trouble deleting duplicated rows in an xts object. I have a R script that will download tick financial data of a currency and convert it to an xts object of OHLC format. The script also pulls new data every 15 minutes. The new data is downloaded from the first trade of today to the last recorded trade of today. The old previous data downloaded was stored in .Rdata format and called. Then the new data is added to the old data and it overwrites the old data in .Rdata format. Here is an example of what my data looks like: .Open .High .Low .Close .Volume .Adjusted 2012-01-07 00:00:11 6

Google finance converter stopped working or changed its url? [closed]

做~自己de王妃 提交于 2019-11-28 08:36:25
https://finance.google.com/finance/converter now redirects to https://www.google.com/search Have they changed the url ? I found a workaround this url is working: https://finance.google.co.uk/bctzjpnsun/converter you can view old pages by inserting this 'bctzjpnsun' in the url. For instance portfolio view with issues in the layout: https://finance.google.co.uk/bctzjpnsun/portfolio?action=view&pid=1&pview=sview They are unfortunately in the process of removing it to push a new sleek layout www.google.com/finance without portfolio management features. Obviously many are complaining but that did

How to get a matplotlib Axes instance to plot to?

断了今生、忘了曾经 提交于 2019-11-28 06:08:53
I need to make a candlestick chart (something like this) using some stock data. For this I want to use the function matplotlib.finance.candlestick() . To this function I need to supply quotes and " an Axes instance to plot to ". I created some sample quotes as follows: quotes = [(1, 5, 6, 7, 4), (2, 6, 9, 9, 6), (3, 9, 8, 10, 8), (4, 8, 8, 9, 8), (5, 8, 11, 13, 7)] I now also need an Axes instance though, at which I am a bit lost. I created plots before using matplotlib.pyplot. I think I now need to do something with matplotlib.axes though, but I am unsure what exactly. Could anybody help me

create an OHLC series from ticker data using R

北城余情 提交于 2019-11-28 03:51:23
问题 This seems like it should be a common thing, but all my searching comes up with half or unfinished answers. I have a set of data in a csv. But the data is set up so it is time, price, volume. To properly analyze my data I need it in OHLCV format: open, high, low, close, volume. Does anyone have an idea how to reformat into OHLCV? Here is a sample of a data set: time,price,volume, 7/18/10 0:09,0.04951,20, 7/18/10 4:43,0.05941,50.01, 7/18/10 18:48,0.0808,5, 7/18/10 22:44,0.08585,10, 7/18/10 23

Alternatives to the Yahoo Finance API? [closed]

拟墨画扇 提交于 2019-11-28 03:49:51
Yahoo finance recently discontinued their API. I have been looking for alternatives. The ones I've found so far are Google Finance and Quandl. Google Finance was deprecated in 2011 but still appears to work somewhat. However, there is little to no documentation, and I need to pull dividend data which I was unable to find. Quandl appears to work well but the data is spread across multiple databases which makes getting appropriate access timely and costly. Does anyone know of any other viable alternatives? Alpha Vantage have real-time intraday as well as historical daily time series in JSON

MySQL: Use CASE/ELSE value as join parameter

杀马特。学长 韩版系。学妹 提交于 2019-11-28 03:09:54
问题 I'm trying to join the NAME and PHOTO from USERS table to the TRANSACTIONS table based on who is the payer or payee. It keeps telling me can't find the table this -- What am I doing wrong? SELECT `name`,`photo`,`amount`,`comment`, ( CASE `payer_id` WHEN 72823 THEN `payee_id` ELSE `payer_id` END ) AS `this` FROM `transactions` RIGHT JOIN `users` ON (`users`.`id`=`this`) WHERE `payee_id`=72823 OR `payer_id`=72823 回答1: From the documentation about aliases: The alias is used as the expression's

Getting data from Yahoo Finance

孤街浪徒 提交于 2019-11-28 02:52:49
I read about the YQL, but I didn't understand how can I get some simple data (like company ticker, market cap, stock price, etc.), for ALL COMPANIES? And an additional question, how can I get all Yahoo Finance tables and theirs fields that can be queried by YQL? To your first question, you can't really do any query through YQL to get data for all companies. It's more oriented towards obtaining data for a smaller query. (I.e., it's not going to give you a full data dump of the whole Yahoo! Finance database.) To your second question, here's how you can get started exploring the Yahoo! Finance

How to calculate rolling cumulative product on Pandas DataFrame

*爱你&永不变心* 提交于 2019-11-28 00:18:07
问题 I have a time series of returns, rolling beta, and rolling alpha in a pandas DataFrame. How can I calculate a rolling annualized alpha for the alpha column of the DataFrame? (I want to do the equivalent to =PRODUCT(1+[trailing 12 months])-1 in excel) SPX Index BBOEGEUS Index Beta Alpha 2006-07-31 0.005086 0.001910 1.177977 -0.004081 2006-08-31 0.021274 0.028854 1.167670 0.004012 2006-09-30 0.024566 0.009769 1.101618 -0.017293 2006-10-31 0.031508 0.030692 1.060355 -0.002717 2006-11-30 0.016467

source of historical stock data [closed]

会有一股神秘感。 提交于 2019-11-27 16:33:09
I'm trying to make a stock market simulator (perhaps eventually growing into a predicting AI), but I'm having trouble finding data to use. I'm looking for a (hopefully free) source of historical stock market data. Ideally, it would be a very fine-grained (second or minute interval) data set with price and volume of every symbol on NASDAQ and NYSE (and perhaps others if I get adventurous). Does anyone know of a source for such info? I found this question which indicates Yahoo offers historical data in CSV format, but I've been unable to find out how to get it in a cursory examination of the