8000 Use market data to get base and quote currencies in @informative() decorator by rokups · Pull Request #5936 · freqtrade/freqtrade · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Use market data to get base and quote currencies in @informative() decorator #5936

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

Merged
merged 1 commit into from
Nov 22, 2021

Conversation

rokups
Copy link
Contributor
@rokups rokups commented Nov 21, 2021

This does make exchange non-optional when using decorators though.. Should we do anything else about it?

@coveralls
Copy link

Coverage Status

Coverage increased (+0.0004%) to 97.983% when pulling eab528f on rokups:rk/decorator-fix into c0cc3f5 on freqtrade:develop.

Comment on lines 86 to 87
base = market['baseId']
quote = market['quoteId']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any particular reason to go with "baseId" instead of "base" (Which we are using already in the exchange class ...) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I asked about these in the chat. I got a vague answer from you and/or @samgermain that some exchanges may set 'base' as 'Etherium' while having 'baseId' as 'ETH'. Though in that case it would make other freqtrade code using 'base'/'quote' invalid. So i went ahead and dug in ccxt source code.

            const baseId = this.safeString (market, 'baseAssetName');
            const quoteId = this.safeString (market, 'quoteAssetName');
            const id = this.safeString (market, 'marketId');
            const base = this.safeCurrencyCode (baseId);
            const quote = this.safeCurrencyCode (quoteId);

Seems like baseId is often source of base string. I think i can change it to using base/quote then.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use base and quote

Copy link
Member
xmatthias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@xmatthias xmatthias merged commit 259b950 into freqtrade:develop Nov 22, 2021
@samgermain
Copy link
Member

Does this mean that this task is done?

Ensure informative_pairs still works (specifically, the @informative pairdetection automatic)

@xmatthias
Copy link
Member

Does this mean that this task is done?

leave it open for now please - i'll need to think about it a bit more what it'll mean for that decorator if we have ETC/USDT:USDT formatted pairs

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

Successfully merging this pull request may close these issues.

4 participants
0