-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Differences between MarketTechnicals.jl, Indicators.jl and TALib.jl / Differences between Timeseries.jl and Temporal.jl #93
Comments
Hi @femtotrader .
I think the blocker is the time array implementation.
Please checkout the repo at https://github.com/JuliaQuant |
Thanks @iblis17 for your answer So there is (at least) 2 Julia time series array implementation. (I was aware of this situation) There is also JuliaTS on top of IndexedTables.jl from @JuliaComputing (pinging @shashi @JeffBezanson @ararslan ... ) What are the pros and cons of each implementation? What features are required from a timeseries implementation (for backtesting but also in a live trading context)? Is there some features overlap in these implementations? What features are still missing? I really think that answering to these questions could lead us to find collegially a roadmap. |
@femtotrader Yes there are indeed a few package that whose functionality and objectives definitely intersect, and I think a more organized development plan could go a long way. TimeSeries and MarketTechnicals were already around when I started work on Temporal and Indicators. The main reason I decided to start new packages altogether was that I didn't really care for some of the existing design decisions and semantics. In the hopes of starting a deeper discussion about things like this if we want to start combining efforts & collaborating, I'll give a few examples of things I remember wanting to change.
@iblis17 Not trying to start a sword fight by any means, but these are important design decisions in my opinion that have a big impact on how one works with these objects and functions. Would be happy to debate any of the above points at greater length. But long story short, these are the things that matter to me when interacting with the language (particularly in the REPL), and I would love to collaborate if there's shared interest in adding them to the JuliaQuant work. But if I'm just being overly picky and few agree, then I can just continue developing these packages in parallel in case any other users would appreciate the extra optionality. |
Oh, last thing — would love to be a part of the systematic strategy backtesting work. I have some really interesting ideas about how Julia could be a wicked awesome strategy research language, which I have been planning on making my next big project. Happy to discuss that effort with anyone that wants to work together on building this functionality. |
There is
:-o I just bowse the source code of I guess your main concern about building Indicators on |
One important feature for a timeseries implementation is to be able to resample them easily. That's the reason why I did TimeSeriesResampler.jl and TimeFrames.jl. An other point, is that to be able to use a Julia TimeSeries implementation, we also have to think about streaming data, and how prices (for example) could be stored real time to a datastructure (similar to a circular buffer) and how such a datastructure could interact with a technical analysis library to avoid to calculate ALL values of an indicator (we just need to calculate/update latest values) I suggest to have a look at TA-Lib source function. |
A question flashed into my mind. Seems there are 2 ways to extend new feature on a package:
@femtotrader What are the main pros and cons of creating a new repo like Make a single, feature rich project is more common in Python's community, e.g. Pandas contains both time series (with rich features, resampling included) and dataframe datatype just in a single project. I can install it and carefreely start my work. But seems Julia's community decides to split those feature into different project. I'm curious about the reason... Is the language designer intended? |
I come from Python so the Julia approach was also surprising to me. But I understand that with Julia approach it's easier to reuse small "parts" without too much dependencies. For example I'm pretty sure TimeFrames.jl could be reused in several projects... but problems could occur when many differents implementations for a same concept exists (date offsets, time series...). Let's take an example. If I want to support them all, I need to add a dependency for each library that looks like a table data structure !!!
Fortunately DataStreams.jl could help, but in such a case, Temporal should support it. Same for TimeSeries.jl I'm not blaming @dysonance neither @milktrader . It may be an hard work. But I just want draw you the landscape... |
I agree this point.
I will propose that just add new dependencies into the original repo if possible. (Not sure how the optional dependency can be implemented in Julia). Before you show me the Let me show you the picture in my mind, e.g.: @femtotrader Quote from your original post:
After previous deeper discussions, I think my answer is |
Haha wow, this discussion got really deep since I last opened it, glad to see you guys are equally interested in organizing our efforts around this! I'll try to hit on the major discussion points separately. Repo/Project OrganizationI was also generally quite surprised that so many efforts with similar objectives in the Julia community have appeared to splinter into separate packages. Coming from either R or Python, this can be somewhat overwhelming. @femtotrader As for GitHub organizations, there is already JuliaQuant. Perhaps we should ask the owners of that org their thoughts on all this, and what it would take to get some of these various efforts put into that organization? But it's odd right, because TimeSeries is owner by the JuliaStats GitHub organization. How do we consolidate all this? Because TimeSeries has broader stats purposes than just finance, but a key domain for it (especially in Julia IMHO) will definitely be finance. So... who should get custody of all this? Maybe JuliaStats can keep TimeSeries, and JuliaQuant could take ownership of Temporal (but perhaps with a more descriptive name specifying its relevance to finance in particular)? Or something along these lines? Again, these are things we should really ask the owners of these orgs their thoughts on. Indexing
@iblis17 Yes, the key problem with getting the string-based date indexing functional in TimeSeries is that right now the objects use strings to index columns, and use integers/arrays to index rows. This is why I wrote Temporal to index rows with integers, arrays, dates, or strings, and to index columns with integers, arrays, or symbols. (It could also be written to index both rows and columns with strings, but I personally think making Symbols specifically for columns allows for far cleaner, understandable, and robust syntax.) I'm also not sure if TimeSeries permits the use of indexing expressions like DataObviously streaming data would be a huge win in the future, but I think it's important to not put the cart before the horse so to speak. This I think would be something we would want to focus on implementing after Julia v1.0 is officially released and we can make more assumptions about syntax. Not that I expect many differences, but I think there's lower-hanging fruit to grab in the meantime that would be equally useful for the bulk of use-cases. That being said, we should ensure development proceeds with an eye towards this objective being achieved down the line. With Temporal.jl I added the ability to get data from the API's provided by Quandl, Yahoo Finance, and (more recently) Google Finance, specifically because these data sources focus specifically on time series data, which allows certain assumptions about the data structure received from the API calls. Having a specific package for each of these in particular sounds clunky in my opinion. But then, I added this functionality because, at least when I started, the Quandl package was made for TimeSeries. I personally think it makes it a lot easier to get up and running having many of these features fully integrated into one time series package. What happens if the chief maintainers of some data fetching package stop maintaining it and/or your PR's to get new features incorporated take longer to get merged? These are just some concerns I'd have with outsourcing data acquisition capabilities to other projects. If we want time series data, let's just write some methods to get time series data. ConclusionSorry for the stream-of-consciousness style dissertation this ended up becoming. Let's keep the conversation going :) |
I wonder if @JuliaComputing have a roadmap to create timeseries implementation on top of IndexedTables.jl (like JuliaTS.jl was for NDSparseData). Pinging @shashi @JeffBezanson |
I am happy to grant access to developers within this organization. I agree it's best to consolidate our efforts here. Please advise what projects, packages or groups you're interested in. 😄 |
@dysonance can you elaborate what features in As far as getting data from Quandl, FRED and Yahoo, all those have been implemented at some point. The Quandl.jl api is in need of some refreshing so feel free to jump in. I would be happy to give you access privileges. |
On my side I'm ok to move DataReaders.jl and TALib.jl to @JuliaQuant I'm still not sure what is the best organisation for TimeSeriesResampler.jl TimeFrames.jl and TimeSeriesIO.jl Given the fact TimeSeries.jl is part of @JuliaStats I think it could be the right place for them. I just want to still have access to these repositories My first step is to invite @iblis17 @milktrader in all these repositories as they are involved in development of projects belonging to @JuliaQuant and @JuliaStats |
Hierarchy of Packages this is over two years old but there is a Roadmap for JuliaQuant that would be a good place to continue this discussion. |
@milktrader Could you tell more about this repo https://github.com/JuliaQuant/FinancialSeries.jl ? |
It was basically a specialized time series for financial data. I had some doubts about its performance and as you can tell have not developed it in some time. IIRC, there was an important utility for it in downstream packages (in theory) |
Just a comment about streaming data... You might have a look at this Python project We should have something like this for Julia (with OHLC resampling) |
Maintaining and adding new features (like dysonance/Temporal.jl#30 and JuliaStats/TimeSeries.jl#390) to both Timeseries.jl and Temporal.jl is a waste of time I think we should really see how we could merge Temporal and Timeseries. To achieve this task we probably need to write a wiki table with features of each library (ie avoid long text paragraph) to concentrate our efforts on highlighting differences, forces and weakness of each lib). I personally think that something is missing in both libraries: N dimensions data. For example OHLC prices of several stocks is a 3 dimensions data
We can even say that OHLC prices can be a 4 dimensions data
Something like Python library xarray I think we should add in this wiki features that are not present in both library but are something we would like to see implemented. |
Sorry for reviving this thread, but I've stumbled on this issue and I think, that it can be solved in a rather simple fashion: let everybody uses the time format which they prefer, just add some conversion utilities. It is the same approach that is used in You can find it here: https://github.com/Arkoniak/ProtoMarketData.jl With this approach, users can switch from one format to another and we can have as many indicator/processing/whatever packages we want. Sorry for directing, but @femtotrader @dysonance what would you say? |
Sorry for answering so lately... I was quite busy You should also have a look at dysonance/Temporal.jl#48 (comment) Maybe a first start could be to define what features are requested for a very good Julia timeseries library. The concept of timeframe is important to provide a nice API for resampling timeseries (a very old and limited implementation can be found at https://github.com/femtotrader/TimeFrames.jl). Supporting statistics based on line algorithms https://joshday.github.io/OnlineStats.jl/latest/ / streaming features ... dysonance/Temporal.jl#1 could be a great feature to have. A last comment is that timeseries are not only tables... they are hypercubes... |
I like the idea of writing code generically and allowing easy use of whatever type people want to use to represent their time series. I like the approach Indicators.jl takes of writing core functionality in Implemeting core functionality in native types is a good default approach IMO. As far as resampling and TS specific operations, I've been doing everything with DataFrame and haven't had trouble implementing downsampling, downaggregation, shift, and other TS operations. I don't see the need for a separate time series aware package when you can use DateTime and ZonedDateTime as indexes/arrays in most tabular packages, but I think the user should have the option to use whatever types they want without sacrificing functionality. |
I want to apply methods from MarketTechnicals.jl (and Indicators.jl) on I was wondering if as of early 2023 the |
I think TS-aware tables are fine, but to me they just add a bit of syntactic sugar. I don't see much added benefit to using them. A multivariate time series is a table where one of the columns, the index column, is a timestamp. You can just treat a time index like any other ordinal index in a table and do all the same operations without anything specific for time series. I realized that there are basically two reasons I want a table for time series stuff, as opposed to for example an SOA-like thing:
DataFrames gives # 2 automatically. For # 1, I made this small package for timestamp index methods: DateTimeDataFrames.jl. It doesn't use a special table type, it just requires you to specify either the name or integer location of the timestamp index (by default, it's called For doing things further downstream in the analysis pipeline that (further away from TS boilerplate), I write methods that work with I recognize the potential value of having timeseries aware table types. I don't think DataFrame is a good choice for the core data though. The main advantage I see of DataFrames, aside from its maturity, is it's flexibility. If you want type-stability or more powerful dispatching, there are other table pacakges for that. I think it would be cool to be able to specify the type(s) of columns and be able to write implementations of things for specific column configurations. Using Julia's type system could allow for nice code reuse along with stricter encoding of what your data is. I played around with StructArrays.jl to investigate this. You could define your row type as a struct and then dispatch on the subtype of StructArray you want for your implementation. This or some other type-aware table would be cool. I haven't looked into it enough, maybe when I get more time I will |
I wonder if an incremental implementation of technical indicators similar to https://github.com/nardew/talipp couldn't be interesting for Julia. PS : see https://discourse.julialang.org/t/incremental-technical-analysis-indicators/107844 |
Hello,
I wrote some months ago a Julia wrapper for TA-Lib : TALib.jl
So it's financial market technical analysis & indicators in Julia using TA-Lib library.
I think it's better to have a pure Julia Technical analysis package
but I wonder what are differences between and MarketTechnicals.jl from @JuliaQuant (@iblislin @milktrader ...) and Indicators.jl from @dysonance
Isn't there a way to merge our efforts to make Julia stronger in finance field?
(for technical analysis but also to build a better Julia backtester, paper trade, live trade application for stocks but also for cfd (with bracket orders, with trailing stop, ...)
Kind regards
The text was updated successfully, but these errors were encountered: