Skip to content
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

Indicator methods generalization #130

Open
Arkoniak opened this issue Apr 4, 2021 · 2 comments
Open

Indicator methods generalization #130

Arkoniak opened this issue Apr 4, 2021 · 2 comments

Comments

@Arkoniak
Copy link
Member

Arkoniak commented Apr 4, 2021

This one is related in some sense to JuliaQuant/MarketData.jl#71 and #93. On one hand, we have few data types for time series and it's hard to say which one is better (actually it is possible that all of them are good just in different circumstances). On the other hand, we have few packages with similar functionality and developers' efforts and users' attention has diverged between them.

The idea is vague right now, but mainly, most of the indicators require rather simple input, most of the time something Vector or Matrix like, so algorithms on their own do not care about external data type and it should be utilized.

I think, that it is possible to do something like this

function indicator(input::T) where T
  v_input = unwrap(input) # convert input to Vector
  # ...
  # do calculations
  # ...
  
  wrap(v_output, T) # convert resulting vector to the type of the initial structure
end

Probably we can even put this wrap/unwrap in a macro so only actual implementation will be left. Wrapping and unwrapping can depend on type (DataFrame, TimeArray, Temporal) thus making resulting alorithm type agnostic.

We can start small, with moving averages and see how it works out.

@iblislin
Copy link
Member

iblislin commented Apr 4, 2021

How about implement the unwrap/wrap by applying Tables.jl API?

We can start small, with moving averages and see how it works out.

I guess the first problem is that the we might need to rewrite lots of time-related operations (which are already done in TimeSeries.jl) for Vector/Martrix, e.g. lag, lead, moving.

but yeah, we still can try it, then check out it's worthy or not.

@Arkoniak
Copy link
Member Author

Arkoniak commented Apr 5, 2021

How about implement the unwrap/wrap by applying Tables.jl API?

That's a good idea, I will look in Tables.jl documentation, probably it shouldn't be that hard to do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants