eguidotti / bidask

Efficient Estimation of Bid-Ask Spreads from Open, High, Low, and Close Prices
https://doi.org/10.1016/j.jfineco.2024.103916
GNU General Public License v3.0
99 stars 26 forks source link

vectorized version #9

Closed igaloly closed 3 months ago

igaloly commented 6 months ago

Is that possible to get a vectorized python version?

eguidotti commented 6 months ago

What do you mean exactly? Maybe a function to compute rolling spreads as proposed in https://github.com/eguidotti/bidask/pull/8?

igaloly commented 6 months ago

@eguidotti The edge procedure gets a list of open, high, low, close, and returns a number, right? the spread. Imagine i want to do this to all the expending subsets of the list. In other words, and efficient way do to that: [edge(open[:i], high[:i], close[:i], low[:i]) for i in range(len(open))]

eguidotti commented 3 months ago

I prefer not to add complexity in the implementation here to maintain consistency with the implementations in other languages. Hopefully, your solution should already be fast enough