//@version=5
strategy(“MACD Strategy”, overlay=true)
// Define MACD parameters
fastLength = input.int(12, title=”Fast Length”)
slowLength = input.int(26, title=”Slow Length”)
signalSmoothing = input.int(9, title=”Signal Smoothing”)
// Calculate MACD and Signal Line
[macdLine, signalLine, _] = ta.macd(close, fastLength, slowLength, signalSmoothing)
// Plot MACD and Signal Line
plot(macdLine, color=color.blue, title=”MACD Line”)
plot(signalLine, color=color.orange, title=”Signal Line”)
// Define Buy and Sell conditions
buyCondition = ta.crossover(macdLine, signalLine)
sellCondition = ta.crossunder(macdLine, signalLine)
// Plot Buy and Sell signals on the chart
plotshape(series=buyCondition, location=location.belowbar, color=color.green, style=shape.labelup, title=”Buy Signal”)
plotshape(series=sellCondition, location=location.abovebar, color=color.red, style=shape.labeldown, title=”Sell Signal”)
// Execute Buy and Sell orders
if (buyCondition)
strategy.entry(“Buy”, strategy.long)
if (sellCondition)
strategy.entry(“Sell”, strategy.short)
Elevate your trading game and embrace the future of finance. Join us today, and experience trading like never before.
info@tradesupreme.ai
sales@tradesupreme.ai
+27 68 185 3669
© 2024, Trade Supreme. All rights reserved. Created by Infinity End Concepts