Skip to content
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

Telegram message is incorrect (maybe a bug) #9759

Closed
winposs opened this issue Feb 3, 2024 · 5 comments
Closed

Telegram message is incorrect (maybe a bug) #9759

winposs opened this issue Feb 3, 2024 · 5 comments
Labels
Question Questions - will be closed after some period of inactivity. RPC Telegram, ReST API, external control, ...

Comments

@winposs
Copy link

winposs commented Feb 3, 2024

Describe your environment

  • Operating system: ubuntu 20.04.6
  • Python Version: 3.8.10
  • CCXT version: 4.2.25
  • Freqtrade Version: 2024.1

Note: All issues other than enhancement requests will be closed without further comment if the above template is deleted or not filled out.

Describe the problem:

Explain the problem you have encountered

Steps to reproduce:

  1. The robot is buying assets normally.
  2. Telegram is sending me purchase information.
  3. The information in the "Direction" section of the Telegram message is incorrect.

Observed Results:

  • What happened?
    TG did not correctly indicate the leverage amount.

  • What did you expect to happen?
    TG provided the correct leverage value.

Relevant code exceptions or logs

Note: Please copy/paste text of the messages, no screenshots of logs please.

My strategy code:

def leverage(self, pair: str, current_time: datetime, current_rate: float,
             proposed_leverage: float, max_leverage: float, entry_tag: Optional[str], side: str,
             **kwargs) -> float:

    if pair == "BTC/USDT:USDT" or pair == "ETH/USDT:USDT":
        return 10

    if pair == "BNB/USDT:USDT":
        return 5

    return 3

The leverage information is incorrect when shorting BTC.

/forceshort BTC/USDT:USDT

🔵 Binance (dry): New Trade (#2)
Pair: BTC/USDT:USDT
Enter Tag: force_entry
Amount: 0.009
Direction: Short (1e+01x)
Open Rate: 43058 USDT
Current Rate: 43058 USDT
Total: 38.752 USDT / 38.736 USD

There is no indication of the leverage amount when shorting XAI.

/forceshort XAI/USDT:USDT

🔵 Binance (dry): New Trade (#3)
Pair: XAI/USDT:USDT
Enter Tag: force_entry
Amount: 52
Direction: Short
Open Rate: 0.761 USDT
Current Rate: 0.761 USDT
Total: 39.556 USDT / 39.540 USD
@winposs winposs added the Triage Needed Issues yet to verify label Feb 3, 2024
@xmatthias xmatthias added Question Questions - will be closed after some period of inactivity. and removed Triage Needed Issues yet to verify labels Feb 3, 2024
@xmatthias
Copy link
Member

xmatthias commented Feb 3, 2024

well that simply means - there's no leverage (a leverage of 1x will NOT be shown).
Based on your strategy code the most likely reason is that this is not the strategy code that's actually running.
Alternatively (your code is not checking this) - it might be that this pair can't be traded with leverage - in which case freqtrade will fall back to 1.

In dry-run, this can also happen on very new pairs, which are not yet in the "cached" leverage tiers file (it's an authenticated call for binance) ... which this pair doesn't seem to be.

i don't really see this as a problem - but intended behavior - though the formatting in the first message is kinda odd (it should be 10x, not 1e01x)- something that might need slight improving - but what's shown is not wrong.

@xmatthias xmatthias added the RPC Telegram, ReST API, external control, ... label Feb 3, 2024
@batcandoi27
Copy link

I issue same when dry with 20x
🔵 Binance (dry): Increasing position (#62)
Pair: BTC/USDT:USDT
Enter Tag: btc_long_1
Amount: 0.005
Direction: Long (2e+01x)
Open Rate: 42700.9 USDT
Current Rate: 42786.5 USDT
New Total: 10.736 USDT / 10.728 USD

@xmatthias
Copy link
Member

@batcandoi27 fixed in develop :)

TheJoeSchr pushed a commit to TheJoeSchr/freqtrade that referenced this issue Feb 26, 2024
@batcandoi27
Copy link

batcandoi27 commented Mar 18, 2024

@batcandoi27 fixed in develop :)
image
sorry post in here, Can you adjust the display of the decimal part of the price of a coin? For example, this price of 1000pepe coin has up to 7 decimal places but only shows 3, which is not convenient to monitor. Thank you for this great project!

@xmatthias
Copy link
Member

To reiterate what i said above:
@batcandoi27 fixed in develop :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Questions - will be closed after some period of inactivity. RPC Telegram, ReST API, external control, ...
Projects
None yet
Development

No branches or pull requests

3 participants