Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Optimize getting Price data #16
base: main
Are you sure you want to change the base?
Optimize getting Price data #16
Changes from 43 commits
cd385df
34f0c66
777c441
a1b9f8e
5089a9e
1ac3e77
ed50892
657666b
74935e1
48c24c8
50378a6
e1f4581
95deecc
7976ee6
a0c8df5
08f3402
23f38b6
3939e15
65cbfbf
888dba8
5d4f394
be5ab79
8928d6d
b2f2074
700930a
3c036bb
644c2a9
d28babd
2d31fc1
6acd035
6dcb6ce
591c749
5226447
35536ae
2e9b866
842f731
cac907c
dd8fb3e
98c049f
0808511
6bda214
c41b18e
908043e
25dd649
f0a52ca
c56ba99
08b7f41
ada4859
ee6fdcf
1e48809
f5ef07c
bbd8bb8
8f24604
84f7e86
6fc0948
11d5849
080f475
1f8f77e
1cb8a45
4f2dfe7
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment for the
EXCHANGES
variable. Whats the benefit of the variable? Why do we need it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OHLCV feature is not supported for all exchanges (e.g. Kraken, it works without error, but the returned data is inaccurate and not useable). So I see two options: Define all supported (and tested) exchanges in a list, or define exchanges that should not be used for this feature. I would go with the first option (which is how it is implemented now).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
c[1][1]["avg_vol"]
or thatpath[i][1]["stoptime"]
which I find incredibly hard to read and get throughThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah for readability this would be a major improvement, but i don't know how named tuples and such impact performance, because the graph algo is what currently needs the majority of computing time.
What we should try is to save the timerange and volume data directly in the graph itself and not how i do it currently (using self.cache), using this the algorithm could be far more efficient, due to the ability of being able to filter the pairs while walking the paths, reducing the iterations significantly when timerangedata is present.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be fine for us when we switch to dataclasses. My intuitive opinion on this is that we should prefer readability over performance.
https://stackoverflow.com/a/55256047
We might want to consider the usage of
__slots__
. This could be interesting for that https://stackoverflow.com/questions/50180735/how-can-dataclasses-be-made-to-work-better-with-slots.