Customizable Non-Repainting HTF MACD MFI Scalable Bot Strategy
Overview
This strategy is a highly customizable non-repainting combination strategy using MACD and MFI indicators, suitable for algorithmic trading bots. It incorporates both trend and momentum indicators to generate trading signals, with additional filters to avoid false signals.
Strategy Logic
The strategy uses the MACD indicator to determine market trend direction. MACD is a trend-following momentum indicator, calculated by subtracting the slow moving average from the fast moving average to get the MACD histogram, and using an EMA of the MACD as the signal line. A crossover above the signal line gives a buy signal, while crossing below gives a sell signal.
In addition, the MFI indicator is used to gauge overbought/oversold levels in the market by incorporating both price and volume information. MFI oscillates between 0 and 100, with values below 20 indicating an oversold region and values above 80 indicating an overbought region.
To filter out false signals, the strategy also implements a trend filter and RSI filter. A buy signal is only generated when price is in an upward trend and RSI is below a threshold.
Advantages of the Strategy
- Combines multiple indicators for a more robust market state evaluation, improving win rate
- Filtering mechanisms avoid false signals and reduce unnecessary trades
- Highly customizable parameters and filters adaptable to different instruments and trading preferences
- Can be used for manual trading or connected to algorithmic bots for automated trading
Risks & Mitigations
-
Poor parameter tuning can lead to false signals
-
Test different parameter combinations to find optimal settings
-
Parameters not one-size-fits-all, need separate testing/optimization per instrument
-
High trading frequency increases costs and slippage risks
-
Adjust filters to reduce trade frequency
-
Monitor costs closely during live trading
Directions for Strategy Optimization
- Test on longer data periods to evaluate parameter stability
- Try different combinations of indicator parameters
- Optimize indicator weighting for better stability
- Add more filters to avoid unnecessary trades
Conclusion
This is a highly customizable trend-following strategy combining both trend and momentum indicators to gauge market state, and effectively uses filtering mechanisms to control risks. It can be used for manual trading or connected to algorithmic bots for a high degree of automation, and is a strategy worth tracking and optimizing over the long run.
/*backtest
start: 2022-12-15 00:00:00
end: 2023-12-21 00:00:00
period: 1d
basePeriod: 1h
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//(c) Wunderbit Trading
//Modified by Mauricio Zuniga - Trade at your own risk
//This script was originally shared on Wunderbit website as a free open source script for the community. (https://help.wundertrading.com/en/articles/5246468-macd-mfi-trading-bot-for-ftx)
// - 1

