Pairs trade opening priority #6030
Labels
Enhancement
Enhancements to the bot. Get lower priority than bugs by default.
Pairlist
Issues / PR's related to Pairlists / pairlist handling
Describe your environment
(if applicable)
python -V
)pip freeze | grep ccxt
)freqtrade -V
ordocker-compose run --rm freqtrade -V
for Freqtrade running in docker)Describe the enhancement
Sometimes it could be useful to order pairs after dataframe analysis for each pair is done (probably based on some indicator or whatever).
Let's imagine that target indicator is "probability of profit" for a pair during the following K candles, for instance predicted by some Machine Learning technique. Someone may want to open trades in max-to-min predicted probability order to maximize expected wins / by expected return based on predicted probability and position size to maximize expected capital growth / whatever else.
Currently there is no clear way to provide "priority" information out of the strategy so the bot will know which pair to enter first. One approach I can imagine right now is to override
analyze(self, pairs: List[str])
somehow like:or just simply
.sort()
pairs list inplace based on some column calculated inpopulate_indicators
. But is definitely not a straightforward and potentially dangerous approach as it is based on knowledge of bot cycle internals.What I imagine could be useful is change the
IStrategy
interface so there will be a point to explicitly provide priorities for the bot cycle and order pairs before enter_positions. This method could be optional to override with default return value of 0.0 so by default there will not be any specific ordering and everything will work exactly how it works right now.The text was updated successfully, but these errors were encountered: