/@version=5 strategy("EU,GU,AU STRATEGY", overlay=true) // Input settings wma4Length = input.int(546, title="wma4", minval=1) hmaLength = input.int(200, title="HMA Length", minval=1) emaLength = input.int(2024, title="ema", minval=1, maxval= 10000) //calculate ema ema = ta.ema(close,emaLength) // Calculate Hull Moving Average wma5 = ta.wma(close, math.round(hmaLength / 2)) wma6 = ta.wma(close, hmaLength) rawHMA = 2 * wma5 - wma6 // wma calculation wma4 = ta.wma(close, wma4Length) hma = ta.wma(rawHMA, math.round(math.sqrt(hmaLength))) // Determine WMA colors wma4Color = wma4 > wma4[1] ? color.green : color.red hmaColor = hma > hma[1] ? color.green : color.red emacolor = ema > ema[1] ? color.green : color.red // Detect rising/falling wma4Rising = wma4 > wma4[1] hmaRising = hma > hma[1] emaRising = ema > ema[1] wma4Falling = wma4 < wma4[1] hmaFalling = hma < hma[1] emaFalling = ema < ema[1] // Plot WMAs with dynamic colors plot(wma4, color=wma4Color, linewidth=2, title="WMA4") plot(hma, color=hmaColor, linewidth=1, title="Colored HMA") plot(ema, color= emacolor, linewidth=4, title="colored ema") // Entry conditions longCondition = emaRising and ta.crossunder(hma,wma4) shortCondition = emaFalling and ta.crossover(hma,wma4) // Exit conditions closeLongCondition = hma > wma4 and close[1] < hma closeShortCondition = hma < wma4 and close[1] > hma // Execute trades if (longCondition) strategy.entry("Buy", strategy.long) alert('7403058331861,buy,EURUSD,risk=0.1') if (shortCondition) strategy.entry("Sell", strategy.short) alert('7403058331861,sell,EURUSD,risk=0.1') if (closeLongCondition) strategy.close("Buy") alert('7403058331861,ABC123,closelong,EURUSD') if (closeShortCondition) strategy.close("Sell") alert('7403058331861,ABC123,closeshort,EURUSD')