alpacahq / marketstore

DataFrame Server for Financial Timeseries Data
Apache License 2.0
1.89k stars 232 forks source link

Write dataframe from alpaca-py #623

Open christrt9 opened 1 year ago

christrt9 commented 1 year ago

I want to save panda dataframe to marketstore but i cannot find the way. I am not sure why it doesn't support writing from the alpaca api.

How i can convert dataframe to marketstore, not sure if is possible

I have this from alpaca-py

stock_request = StockBarsRequest(
                    symbol_or_symbols=["SPY"],
                    timeframe=TimeFrame.Minute,
                    start=datetime.strptime("2022-12-30", '%Y-%m-%d')
                )

bars = stock_client.get_stock_bars(stock_request)

How i can convert all timestamps from a range

                                      open      high      low    close   volume  trade_count        vwap
symbol timestamp                                                                                        
SPY    2022-12-30 00:00:00+00:00  382.7900  382.8300  382.790  382.830   4215.0         14.0  382.819234