The BTCNSeq strategy is a trading strategy that involves backtesting various indicators on Bitcoin (BTC) price data. Here's a breakdown of what the strategy does:
populate_indicators function:
Adds several technical analysis (TA) indicators to the given DataFrame. The indicators used include MFI (Money Flow Index), SMA (Simple Moving Average), MACD (Moving Average Convergence Divergence), Stochastic Fast, RSI (Relative Strength Index), Fisher RSI, Bollinger Bands, EMA (Exponential Moving Average), and SAR (Stop and Reverse).
The function merges informative BTC price data with the original DataFrame.
The calculated indicator values are stored in new columns of the DataFrame.
populate_buy_trend function:
Populates the buy signal based on the defined conditions. The conditions include the Fisher RSI value being below a certain threshold and the Bollinger Bands gain being above a certain threshold. It also checks candlestick patterns and the price drop percentage. If all the conditions are met, the 'buy' column of the DataFrame is set to 1. populate_sell_trend function:
Populates the sell signal based on the defined conditions. Currently, it sets the 'sell' column to 0 for all rows where the close price is greater than or equal to 0. Overall, the strategy calculates various TA indicators, identifies buy signals based on specific conditions, and sets the 'buy' column to 1 for those signals. The 'sell' column is set to 0 for all rows.