Comments (8)
You don't have to calculate RSI in it if you don't need it. I was taking your example and fixing it.
funding_rate will be in the merged open column - so in this case - open_8h
.
the documentation (mainly the box "Fast and easy way to define informative pairs") will include several samples on how you can adjust the name of the merged columns.
from freqtrade-strategies.
@informative('8h', candle_type= "funding_rate")
should work just fine - but not on populate_indicators
- but on a separate function (that's not called populate_indicators - so it's then available in populate_indicators). (documented here.
It'll also only work if you're in futures markets (not in spot markets) - at least in dry-run.
default funding rates (default 8h, can vary between exchanges) are also downloaded automatically when you download regular futures data, so the explicit step will be unnecessary.
from freqtrade-strategies.
The separate function i added the informative pairs in is as such:
@informative(candle_type='funding_rate')
def populate_indicators_(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['rsi'] = ta.RSI(dataframe)
return dataframe
Including the timeframe is necessary as it hinders the arising of this error code:
ftuser@dfb252944e06:/freqtrade$ freqtrade backtesting --strategy PLTStrategy
2022-12-23 13:48:12,553 - freqtrade - INFO - freqtrade docker-2022.12.dev-cb81613a
2022-12-23 13:48:12,592 - freqtrade.configuration.load_config - INFO - Using config: user_data/config.json ...
2022-12-23 13:48:12,606 - freqtrade.loggers - INFO - Verbosity set to 0
2022-12-23 13:48:12,609 - freqtrade.configuration.configuration - INFO - Using max_open_trades: 10 ...
2022-12-23 13:48:13,279 - freqtrade.configuration.configuration - INFO - Using user-data directory: /freqtrade/user_data ...
2022-12-23 13:48:13,280 - freqtrade.configuration.configuration - INFO - Using data directory: /freqtrade/user_data/data/binance ...
2022-12-23 13:48:13,280 - freqtrade.configuration.configuration - INFO - Parameter --cache=day detected ...
2022-12-23 13:48:13,282 - freqtrade.exchange.check_exchange - INFO - Checking exchange...
2022-12-23 13:48:13,315 - freqtrade.exchange.check_exchange - INFO - Exchange "binance" is officially supported by the Freqtrade development team.
2022-12-23 13:48:13,315 - freqtrade.configuration.configuration - INFO - Using pairlist from configuration.
2022-12-23 13:48:13,315 - freqtrade.configuration.config_validation - INFO - Validating configuration ...
2022-12-23 13:48:13,325 - freqtrade.commands.optimize_commands - INFO - Starting freqtrade in Backtesting mode
2022-12-23 13:48:13,328 - freqtrade.exchange.exchange - INFO - Instance is running with dry_run enabled
2022-12-23 13:48:13,328 - freqtrade.exchange.exchange - INFO - Using CCXT 2.2.92
2022-12-23 13:48:13,330 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'future'}}
2022-12-23 13:48:13,429 - freqtrade.exchange.exchange - INFO - Applying additional ccxt config: {'options': {'defaultType': 'future'}}
2022-12-23 13:48:13,453 - freqtrade.exchange.exchange - INFO - Using Exchange "Binance"
2022-12-23 13:48:14,600 - freqtrade.resolvers.exchange_resolver - INFO - Using resolved exchange 'Binance'...
2022-12-23 13:48:14,742 - freqtrade - ERROR - Fatal exception!
Traceback (most recent call last):
File "/freqtrade/freqtrade/main.py", line 42, in main
return_code = args['func'](args)
File "/freqtrade/freqtrade/commands/optimize_commands.py", line 57, in start_backtesting
backtesting = Backtesting(config)
File "/freqtrade/freqtrade/optimize/backtesting.py", line 104, in __init__
self.strategylist.append(StrategyResolver.load_strategy(self.config))
File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 48, in load_strategy
strategy: IStrategy = StrategyResolver._load_strategy(
File "/freqtrade/freqtrade/resolvers/strategy_resolver.py", line 256, in _load_strategy
strategy = StrategyResolver._load_object(
File "/freqtrade/freqtrade/resolvers/iresolver.py", line 148, in _load_object
(module, module_path) = cls._search_object(directory=_path,
File "/freqtrade/freqtrade/resolvers/iresolver.py", line 130, in _search_object
obj = next(cls._get_valid_object(module_path, object_name), None)
File "/freqtrade/freqtrade/resolvers/iresolver.py", line 91, in _get_valid_object
spec.loader.exec_module(module) # type: ignore # importlib does not use typehints
File "<frozen importlib._bootstrap_external>", line 883, in exec_module
File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
File "/freqtrade/user_data/strategies/PLTStrategy.py", line 21, in <module>
class PLTStrategy(IStrategy):
File "/freqtrade/user_data/strategies/PLTStrategy.py", line 145, in PLTStrategy
@informative(candle_type='funding_rate')
TypeError: informative() missing 1 required positional argument: 'timeframe'
from freqtrade-strategies.
well nobody said otherwise :)
from freqtrade-strategies.
Your suggestion doesn't work.
from freqtrade-strategies.
well what you tried after my comment is NOT what i suggested - but something else (close, but different).
something around this should work - assuming you are on futures markets - and the exchange really uses 8h as funding rate.
@informative('8h', candle_type='funding_rate')
def populate_indicators_funding(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['rsi'] = ta.RSI(dataframe)
return dataframe
from freqtrade-strategies.
Alright, I'll update you
from freqtrade-strategies.
The timeframe is 8h, but my intention is to include funding rate as a olumn in the dataframe, in order to use it as an indicator. The dataframe that is returned includes, when i add populate_indicators_funding
function:
date True
open True
high True
low True
close True
volume True
date_8h True
open_8h True
high_8h False
low_8h False
close_8h False
volume_8h False
rsi_8h False
adx True
rsi True
fastd True
fastk True
macd True
macdsignal True
macdhist True
mfi True
bb_lowerband True
bb_middleband True
bb_upperband True
bb_percent True
bb_width True
sar True
tema True
htsine True
htleadsine True
enter_long True
enter_short True
But it doesn't include funding rate as a column, which is a negative or positive float value that indicates whether the market is bearish and the short traders pay a funding fee to the long traders, or the opposite. I'm not sure if you misunderstood my question as something else, but are we on the same page?
from freqtrade-strategies.
Related Issues (20)
- GodStra strat can't find ta module HOT 3
- Volatility Strategy HOT 2
- Lookahead for Strategy002 and 004 HOT 5
- cannot use the timeframe i want HOT 4
- GodStra not results available HOT 1
- GodStraHo: Impossible to load Strategy 'GodStraHo'. This class does not exist or contains Python code errors.
- GodStraHo: Impossible to load Strategy 'GodStraHo'. This class does not exist or contains Python code errors. #294 HOT 3
- Unable to retrieve candlestick information from dataframe HOT 1
- BB_RSI_ATR HOT 5
- Momentum Strategy HOT 4
- ta not installing on Google cloud instance and all futures strategies are not working HOT 3
- No module named 'ta' HOT 1
- incorrect times displayed in FreqUI HOT 4
- AlphaTrend Strategy HOT 3
- Error using MACD indicator from qtpylib indicators.py
- WARNING - Unable to analyze candle (OHLCV) data for pair {pair}: Dataframe returned from strategy has mismatching last close price. HOT 2
- finta problem HOT 2
- supertrend different timeframe
- strategy won't work with live trading in binance futures HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freqtrade-strategies.