The given strategy, called ViN (Value in Numbers), is designed to populate indicators, determine buy signals, and calculate sell signals for backtesting trading strategies. Here's a short description of what the strategy does:
The strategy first populates various indicators based on the provided DataFrame and metadata. These indicators include adjusted high and low prices, adjusted close-to-open change, streaks of consecutive up or down movements, minimum and maximum streak values, Bollinger Bands, and volume averages.
Next, the strategy identifies buy signals based on specific conditions.
For buy signals related to percentage change (pct), it checks conditions such as the number of days a stock has been listed, volume being greater than the average, streaks of minimum and maximum values, and certain percentage change thresholds.
For buy signals related to the lc2 indicator, it considers conditions like the number of days listed, volume being greater than the average, streaks of maximum values, and specific ratios involving lc2 and close prices. After identifying buy signals, the strategy populates tags indicating the type of buy signal. It uses the "buy_tag_pct" and "buy_tag_lc2" columns to represent the respective signals. If the strategy is "vin," it combines both types of signals. When determining sell signals, the strategy analyzes the current profit and trade information. It retrieves the relevant DataFrame for the trade, calculates the trade's length, checks recent buy signals, and considers streak values. If certain conditions are met, the strategy returns a sell signal. Overall, the ViN strategy focuses on identifying potential buying opportunities based on various indicators and conditions, while also considering sell signals based on trade information and profit levels.
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 58, in start_backtesting
backtesting.start()
File "/freqtrade/freqtrade/optimize/backtesting.py", line 1401, in start
min_date, max_date = self.backtest_one_strategy(strat, data, timerange)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/optimize/backtesting.py", line 1335, in backtest_one_strategy
results = self.backtest(
^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/optimize/backtesting.py", line 1213, in backtest
data: Dict = self._get_ohlcv_as_lists(processed)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/optimize/backtesting.py", line 381, in _get_ohlcv_as_lists
df_analyzed = self.strategy.ft_advise_signals(pair_data, {'pair': pair})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/strategy/interface.py", line 1391, in ft_advise_signals
dataframe = self.advise_entry(dataframe, metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/strategy/interface.py", line 1425, in advise_entry
df = self.populate_entry_trend(dataframe, metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/freqtrade/strategy/interface.py", line 225, in populate_entry_trend
return self.populate_buy_trend(dataframe, metadata)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/freqtrade/user_data/strategies/vin.py", line 136, in populate_buy_trend
self.fill_custom_buy_info(df, metadata)
File "/freqtrade/user_data/strategies/vin.py", line 89, in fill_custom_buy_info
for index, buy_date in df_buy.iteritems():
^^^^^^^^^^^^^^^^
File "/home/ftuser/.local/lib/python3.11/site-packages/pandas/core/generic.py", line 6204, in __getattr__
return object.__getattribute__(self, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Series' object has no attribute 'iteritems'