-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Accept and process multiple Candle Resolutions #266
Comments
My apologies for the delayed response. The The Date field is primarily used for charting and reporting, where you have full control over the date formatting. Elsewhere, the code operates on the values without explicit time knowledge. This means you should be able to use data with resolutions like 1 minute, 15 minutes, or 1 hour without issues. I'm planning to add functionality for converting between different time resolutions. Currently, functions like Sum, Avg, and Last can downsample from high to low resolution, but upsampling is not yet supported. To help me understand your needs better, could you provide some examples of what you're trying to achieve? This will help me guide you on how to best utilize the library and prioritize any missing features that might be beneficial. |
In the Snapshot struct
The custom 'format' struct tag forces a day level field data to be stored in the CSV file format from the asset/file_system_repository.go via the csv.go class reference here. Line 54 in 3ae91ac
indicator/asset/file_system_repository.go Line 92 in 3ae91ac
So the data in the file is stored at the day level (YYYY-MM-DD) so that class is not usable for anything other than day level candles. I myself will be creating my own repository class anyway due to embedded nature of my internal database. Great library! |
Great catch! Yes, that doesn't look right. Let me see if I can find a solution. Regarding database support, I have some code that works with PostgreSQL and can be extended to support other databases and languages. If you haven't written yours yet, I can try to incorporate those into this project over the weekend. |
If you can add a passed function to convert the date -> string allowing it to be passed in that would solve the 'scale of the candle' issue. The Snapshot, of coarse, is a candle meaning it represents a range of time and I need to save partial 'times' at the minute or hour level. Storing at the 15 second level get even more 'interesting' :) My needs are a bit more complicated but thanks. |
Let me take care of that quickly today. Yes, better to make that configurable. Meanwhile, just checked in the SQL Repository base files. I'll try to find a way to add the PostgreSQL portion also. Just in case if it helps with your implementation. |
# Describe Request Added SQL repository support for assets. It does not contain any actual implementation for a particular database. I will follow up with a separate repo or submodule. Related #266 # Change Type SQL repository.
I removed the default date/time format from Unless you see a problem, I will go ahead and merge it.
CSV Example: csv, err := helper.NewCsv[Row](
helper.WithCsvDefaultDateTimeFormat[Row]("2006-01-02 15:04:05"),
) Repository Example: repository := asset.NewFileSystemRepository(
"assets",
helper.WithCsvDefaultDateTimeFormat[Row]("2006-01-02 15:04:05"),
) |
Currently, I am streaming 1min candles from a source. If I understood correctly, the asset.snapshot only accepts 1d candles. Is there a way for the asset.snapshot to support multiple resolutions? 1m, 15m, 1h
Describe the solution you'd like
Ideally, remove the format on date.Date (in the asset.snapshot).
Introduce a new field - resolution that specifies the duration of the candle. 1m, 15m etc.,
Describe alternatives you've considered
Other solution I've considered - grok this codebase, and modify the format to support minutes in the field
Additional context
Nothing more!
The text was updated successfully, but these errors were encountered: