PPonBIN

I love MACD but there's something fishy about 1268% Net Profit!

Long
BINANCE:SOLUSDT   SOL / TetherUS
Hey folks, posting this here for you to tinker with.

It's a simple trading strategy idea I have using the Moving Average Convergence Divergence (MACD) indicator for signals on when to enter and exit trades. Let's break down the key components of your strategy:

Inputs for MACD Calculation:

fastLength: The number of periods to use for the fast moving average in the MACD calculation. This is set to 2 periods by default.
slowLength: The number of periods for the slow moving average in the MACD calculation. This is set to 4 periods by default.
signalSmoothing: The number of periods for the signal line's smoothing. This is set to 2 periods by default.

MACD Calculation:

The ta.macd() function calculates the MACD line, signal line, and the MACD histogram (which you are not using, hence the underscore placeholder _).
The MACD line is the difference between the fast and slow moving averages.
The signal line is a smoothed version of the MACD line.
Trading Signals:

A buy signal (strategy.entry) is generated when the MACD line crosses above the signal line and the MACD line is above 0. This is interpreted as bullish momentum increasing.
A sell signal or exit signal (strategy.close) is generated when the MACD line crosses below the signal line. This is to close any open long position based on the assumption that the bullish momentum is weakening.
Plotting:

The strategy also includes commands to plot the MACD and signal lines on the chart for visual reference. The MACD line is in blue, and the signal line is in orange.
This strategy is overlayed on the price chart (overlay=true), which means you can see the buy and sell signals in conjunction with the price action.

The strategy is simple and only based on the MACD crossing signals without any other filters or risk management rules. It assumes that when the MACD line crosses above the signal line with positive momentum, it is a good time to enter a long position, and when it crosses below, it is time to exit.
Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.