The NDrop strategy is a trading strategy that uses several technical analysis indicators to generate buy and sell signals for backtesting. Here's a breakdown of what the strategy does:
populate_indicators function:
Calculates various technical indicators such as 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). Adds the calculated indicators to the given DataFrame.
populate_buy_trend function:
Defines conditions for generating buy signals based on indicator values.
The strategy considers conditions such as MFI being below a specified value (buy_mfi), Fisher RSI being below a specified value (buy_fisher), and the closing price being below the lower Bollinger Band (bb_lowerband).
It also checks for a specified number of candles where the closing price is less than or equal to the opening price. Finally, it checks for a drop in the price relative to the previous open price (buy_drop), considering a specified number of candles (buy_num_candles). If any of the conditions are met, the strategy sets the 'buy' column in the DataFrame to 1. populate_sell_trend function:
Populates the 'sell' column in the DataFrame based on a simple condition where the closing price is greater than or equal to 0. Overall, the NDrop strategy combines various technical indicators to identify potential buying opportunities based on specific conditions and sets the 'buy' column accordingly. The 'sell' column is populated with a default value of 0.