Type/to search

Customizable Non-Repainting HTF MACD MFI Scalable Bot Strategy

Common strategy
Created: 2023-12-22 12:47:21
Last modified: 3 years ago
1
Follow
1802
Followers

img

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.

Source
Pine
/*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)
// 
Strategy parameters
Strategy parameters
Period
Fast Length
Slow Length
Source
Signal Smoothing
Simple MA(Oscillator)
Simple MA(Signal Line)
length
lower
upper
Highlight Oversold/Overbought?
Long Take Profit 1 %
Long Take Profit 1 Qty
Trailing Stop Long
SL Mutiplier
ATR period
Backtest Start Year
Backtest Start Month
Backtest Start Day
Backtest Stop Year
Backtest Stop Month
Backtest Stop Day
Strategy
Resolution
Open Long Comment (Optional)
Filters
Use Trend
Trend MA
Use RSI
RSI Length
Buy Below RSI Filter
Comment
All comments (0)
No data
No data
  • 1
Forums
PINE Language
Get the app
iPhone Download
© 2015 - ∞ INVENTOR PTE LTD (SG)