Can anyone help me to write a MTF Awesome Oscillator? Truly appreciated.
I manage to get to this, but I cant make it look like on the left. Any help is appreciated.
# Multi Timeframe Awesome Oscillator with Correct Color Assignment
declare lower;
input aggregationPeriod = AggregationPeriod.DAY; # Choose the timeframe: DAY, WEEK, MONTH
def data = close(period = aggregationPeriod);
# Median Price Calculation
def medianPrice = (high(period = aggregationPeriod) + low(period = aggregationPeriod)) / 2;
# Simple Moving Average of Median Price for 5 periods
def smaMedian5 = Average(medianPrice, 5);
# Simple Moving Average of Median Price for 34 periods
def smaMedian34 = Average(medianPrice, 34);
# Awesome Oscillator Calculation
def awesomeOscillator = smaMedian5 - smaMedian34;
# Plotting the Awesome Oscillator with correct color assignment
plot AO = awesomeOscillator;
AO.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
AO.SetLineWeight(3);
AO.AssignValueColor(if AO > 0 then Color.GREEN else Color.RED);
# Add labels for clarity
AddLabel(yes, "Multi Timeframe Awesome Oscillator", Color.WHITE);
I manage to get to this, but I cant make it look like on the left. Any help is appreciated.
# Multi Timeframe Awesome Oscillator with Correct Color Assignment
declare lower;
input aggregationPeriod = AggregationPeriod.DAY; # Choose the timeframe: DAY, WEEK, MONTH
def data = close(period = aggregationPeriod);
# Median Price Calculation
def medianPrice = (high(period = aggregationPeriod) + low(period = aggregationPeriod)) / 2;
# Simple Moving Average of Median Price for 5 periods
def smaMedian5 = Average(medianPrice, 5);
# Simple Moving Average of Median Price for 34 periods
def smaMedian34 = Average(medianPrice, 34);
# Awesome Oscillator Calculation
def awesomeOscillator = smaMedian5 - smaMedian34;
# Plotting the Awesome Oscillator with correct color assignment
plot AO = awesomeOscillator;
AO.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
AO.SetLineWeight(3);
AO.AssignValueColor(if AO > 0 then Color.GREEN else Color.RED);
# Add labels for clarity
AddLabel(yes, "Multi Timeframe Awesome Oscillator", Color.WHITE);