MACD crossover and EMA strategy
This simple strategy uses the MACD indicator along with the EMA trend line. For the buy signal, the strategy looks for a cross-over of the MACD line over the signal line and the price is above the 50-period EMA line. The MACD line uses 12 and 26 periods for the MACD and 9 periods for the signal line by default. But the user can change these values. The EMA line uses a 50-period EMA. The test of the strategy was done on SQQQ only. The script is written in Pine script and tested on Trading View. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © facelessfinance //@version=5 strategy("MACD strategy", overlay=true, initial_capital = 50000, default_qty_type = strategy.percent_of_equity, default_qty_value = 100) // MACD Inputs input_macd_fast_line = input.int(defval = 12, title = 'MACD Fast Line', step = 1, tooltip = 'MACD Fast Line') input_macd_slow_line = input.int(defval = 26, title = '...