Skip to content

Commit

Permalink
Add documentation for leverage_tiers update
Browse files Browse the repository at this point in the history
  • Loading branch information
xmatthias committed May 21, 2022
1 parent 963cc17 commit 97abcf4
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions docs/developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,32 @@ The output will show the last entry from the Exchange as well as the current UTC
If the day shows the same day, then the last candle can be assumed as incomplete and should be dropped (leave the setting `"ohlcv_partial_candle"` from the exchange-class untouched / True). Otherwise, set `"ohlcv_partial_candle"` to `False` to not drop Candles (shown in the example above).
Another way is to run this command multiple times in a row and observe if the volume is changing (while the date remains the same).

### Update binance cached leverage tiers

Updating leveraged tiers should be done regularly - and requires an authenticated account with futures enabled.

``` python
import ccxt
import json
from pathlib import Path

exchange = ccxt.binance({
'apiKey': '<apikey>',
'secret': '<secret>'
'options': {'defaultType': 'future'}
})
_ = exchange.load_markets()

lev_tiers = exchange.fetch_leverage_tiers()

# Assumes this is running in the root of the repository.
file = Path('freqtrade/exchange/binance_leverage_tiers.json')
json.dump(lev_tiers, file.open('w'), indent=2)

```

This file should then be contributed upstream, so others can benefit from this, too.

## Updating example notebooks

To keep the jupyter notebooks aligned with the documentation, the following should be ran after updating a example notebook.
Expand Down
2 changes: 1 addition & 1 deletion freqtrade/exchange/binance_leverage_tiers.json
Original file line number Diff line number Diff line change
Expand Up @@ -16907,4 +16907,4 @@
}
}
]
}
}

0 comments on commit 97abcf4

Please sign in to comment.