OPEN-SOURCE SCRIPT

Fractal Levels with AVWAP and MACD

//version=5
indicator("Fractal Levels with AVWAP and MACD", overlay=true)

// Fractal Levels
length = input(2, title="Fractal Length")
fractalHigh = high[length] == ta.highest(high, length * 2 + 1) ? high[length] : na
fractalLow = low[length] == ta.lowest(low, length * 2 + 1) ? low[length] : na

plot(fractalHigh, title="Fractal High", color=color.red, style=plot.style_circles, linewidth=3)
plot(fractalLow, title="Fractal Low", color=color.green, style=plot.style_circles, linewidth=3)

// AVWAP Calculation
var float avwap = na
if bar_index == 0
avwap := na
else
avwap := na(avwap) ? ta.vwap(close, volume) : avwap + (close * volume - avwap * volume) / (volume + volume)

// Plotting AVWAP
plot(avwap, color=color.blue, title="AVWAP")

// MACD Calculation
[macdLine, signalLine, macdHist] = ta.macd(close, 12, 26, 9)

hline(0, "Zero Line", color=color.gray)
plot(macdHist, color=color.blue, title="MACD Histogram", style=plot.style_histogram)
plot(macdLine, color=color.red, title="MACD Line")
plot(signalLine, color=color.green, title="Signal Line")
Candlestick analysisFractalTrend Analysis

Skript med en öppen källkod

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publication is governed by House rules. Du kan ange den som favorit för att använda den i ett diagram.

Vill du använda det här skriptet i ett diagram?

Frånsägelse av ansvar