Create One's Own Daily OHLC data

Create One's Own Daily OHLC data

Manage alerts

Loading saved threads...

babelproofreader · External communityPost link
External question — Quantitative Finance Stack Exchange Author: babelproofreader Original post: https://quant.stackexchange.com/questions/37271 License: CC BY-SA 3.0 — https://creativecommons.org/licenses/by-sa/3.0/ Adaptation: HTML converted to plain text; contact email addresses removed. Given that it's possible to download hourly bars, usually with a UTC timestamp, from most brokers, it then becomes possible to create one's own daily bars. I am thinking of doing this and would like to hear opinions on whether it is advisable or not. Specifically, I want to take the UTC timestamp, parse it into both London and New York time taking into account daylight saving time during the summer months, and create daily bars that begin with the opening of the Asian session and end with the closing of the New York session, effectively having bars that run from approximately 5pm to 5pm New York time midweek, and starting at @ 10pm London time on Sundays for Monday's daily bar.
Quote
Report
joaoavf · External communityPost link
External answer — Quantitative Finance Stack Exchange Author: joaoavf Original post: https://quant.stackexchange.com/a/37283 License: CC BY-SA 3.0 — https://creativecommons.org/licenses/by-sa/3.0/ Adaptation: HTML converted to plain text; contact email addresses removed. I have implemented something similar to what you want to do. How to implement is highly dependent on what will you do with that OHLC daily data and how much data you are dealing with. The most viable implementations for that I can see are: 1. MS Excel If you are doing some spreadsheet analysis or something of the sort and you are only aggregating this data once a day, you can easily do that on MS Excel and it will probably be the easiest and hassle-free path to achieve your goal. (not entirely sure on how to deal with timezones here) 2. Python pandas Another very easy solution to implement is to use the Python pandas library ( https://pandas.pydata.org/ - which I am a huge fan of by the way), and use its aggregation functions. It already has 'OHLC' aggregation built into it (you will probably have to tweak it a little bit to adjust for the timezones - but it is definitely viable, Python has a library called 'pytz' that deals with timezones). The advantage of using the pandas library is that it is super fast. So if you are dealing with lots of data and MS Excel is not performant enough, I would suggest this route. 3. General Purpose Coding This was actually the route I personally chose, I did implement it with pandas before, but as I was doing really a LOT of those 'OHLC' aggregations on live streams, performance was not very good as it was always reaggregating the whole data (maybe there is a better way to implement this in pandas, but I don't know). So to avoid reaggregating the data all the time, I did a somewhat optimized code to aggregate this data and built it exactly customized to my needs. This is a lot more work intensive than other solutions, and I would only recommend it if you really need performance AND to work with live 'OHLC' aggregation (updating the OHLC aggregation for every tick data for example). As for timezones I coded in Python and used 'pytz' library. 4. NinjaTrader I don't know what you do with the 'OHLC' data, but in case you using it for visualizing purposes, I would recommend you to take a look at NinjaTrader. You can do some custom aggregations over there.
Quote
Report
Scott Skiles · External communityPost link
External answer — Quantitative Finance Stack Exchange Author: Scott Skiles Original post: https://quant.stackexchange.com/a/40642 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. BL: Use open source tools, such as Plotly: https://plot.ly/python/ohlc-charts/ Summary: I think it is important to separate the question from the data preparation and the actual plotting. I would say it is inadvisable to do all the plotting work on your own, unless you're simply interested in the mechanics and the problem itself. If you have prepared the data already, libraries like Plotly will take care of the rest for you, also using pandas: https://plot.ly/python/ohlc-charts/
Quote
Report

Post Reply

Checking account access…
Create One's Own Daily OHLC data | Forex.com.bd