freqtrade / freqtrade

Free, open source crypto trading bot
https://www.freqtrade.io
GNU General Public License v3.0
28.3k stars 6.06k forks source link

Using funding rates as indicator in a spot strategy? #6684

Closed Guillaume6606 closed 2 years ago

Guillaume6606 commented 2 years ago

Describe your environment

Your question

I see multiple mentions of funding fees in the code and I guess it is in development. I would like to use it as an indicator to generate signals in backtesting/dry run/live run. Is it possible at the moment? Any help/information would be much appreciated.

xmatthias commented 2 years ago

the use of other so-called "candle-types" is only possible within the defined trading-type (spot for spot, and futures/funding-rate / mark/index when trading futures). As such - you can define and use funding-rates as informative indicator when using "futures" as trading mode - but not for spot trading (look for the candle_type argument in the informative decorator, or the 3rd tuple element in informative_pairs).

you may be able to get away with it for backtesting (as we don't explicitly check for this) - but it will not work in dry/live modes - and this is unlikely to change anytime soon due to the way ccxt implements futures data (will depend on the exchange, but assume it's not working in 90% of the cases).

Guillaume6606 commented 2 years ago

Thank you for your quick and thorough answer. I believe there is no documentation on futures mode as it is only in development, but based on the name I trust this mode will not allow me to make spot trades? (the idea being to reverse the problem and realise my strategy in futures mode, but in that case I would not have access to my spot-based indicators right?)

xmatthias commented 2 years ago

documentation for futures mode is available if you switch the documentation to "latest" (bottom right corner) - and will propagate to the default (stable) version once we release next time.

That's correct - see them as separate modes for now - unfortunately without access to the "other" mode for the moment. While that's something we may look into - that'll definitely not be for the initial release.