@Nari2007
Was just getting ready to post that the value of 'Diff' is the histogram value.
Just copy the label you have and change 'Value' to 'Diff'.
that is 100% exactly what i did,,,, thank you soo much,,,,,,
would you be able to help out with coding a label that shows bullish when ema stack are stacked up and bearish when stacked down on all time frames,? i use 8/21/34/55/89/ on D/4H/1H/ id like to get a label on a single chart rather than having 4 charts with emas on it,
this is what i have for code so far, figure that 55/89 crossing is the same as the whole stack crossing?
input MAtype = AverageType.EXPONENTIAL;
input ShortAverage = 55;
input LongAverage = 89;
def MA_1day_close;
def MA_1day_shortAvg;
def MA_1day_longAvg;
def MA_1day_higher;
def MA_1day_lower;
def MA_1day_same;
def MA_1day_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.DAY {
MA_1day_close = close(period="Day");
MA_1day_shortAvg = MovingAverage(MAtype, MA_1day_close, ShortAverage);
MA_1day_longAvg = MovingAverage(MAtype,MA_1day_close, LongAverage);
MA_1day_nowcrossing = if Crosses(MA_1day_shortAvg, MA_1day_longAvg, CrossingDirection.ANY) then 1 else 0;
MA_1day_same = if MA_1day_nowcrossing == 1 then 1 else Double.NaN;
if MA_1day_same == 1 {
MA_1day_higher = Double.NaN;
MA_1day_lower = Double.NaN;
} else {
MA_1day_higher = if MA_1day_shortAvg >= MA_1day_longAvg[1] then 1 else Double.NaN;
MA_1day_lower = if MA_1day_shortAvg < MA_1day_longAvg[1] then 1 else Double.NaN;
}
} else {
MA_1day_close = 0;
MA_1day_shortAvg = 0;
MA_1day_longAvg = 0;
MA_1day_higher = Double.NaN;
MA_1day_lower = Double.NaN;
MA_1day_same = Double.NaN;
MA_1day_nowcrossing = 0;
}
AddLabel(MA_1day_higher, "1D", Color.DARK_GREEN);
AddLabel(MA_1day_lower, "1D", Color.DARK_RED);
AddLabel(MA_1day_same, "1D", Color.WHITE);
def MA_4hour_close;
def MA_4hour_shortAvg;
def MA_4hour_longAvg;
def MA_4hour_higher;
def MA_4hour_lower;
def MA_4hour_same;
def MA_4hour_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.FOUR_HOURS {
MA_4hour_close = close(period="4 hours");
MA_4hour_shortAvg = MovingAverage(MAtype, MA_4hour_close, ShortAverage);
MA_4hour_longAvg = MovingAverage(MAtype,MA_4hour_close, LongAverage);
MA_4hour_nowcrossing = if Crosses(MA_4hour_shortAvg, MA_4hour_longAvg, CrossingDirection.ANY) then 1 else 0;
MA_4hour_same = if MA_4hour_nowcrossing == 1 then 1 else Double.NaN;
if MA_4hour_same == 1 {
MA_4hour_higher = Double.NaN;
MA_4hour_lower = Double.NaN;
} else {
MA_4hour_higher = if MA_4hour_shortAvg >= MA_4hour_longAvg[1] then 1 else Double.NaN;
MA_4hour_lower = if MA_4hour_shortAvg < MA_4hour_longAvg[1] then 1 else Double.NaN;
}
} else {
MA_4hour_close = 0;
MA_4hour_shortAvg = 0;
MA_4hour_longAvg = 0;
MA_4hour_higher = Double.NaN;
MA_4hour_lower = Double.NaN;
MA_4hour_same = Double.NaN;
MA_4hour_nowcrossing = 0;
}
AddLabel(MA_4hour_higher, "4h", Color.DARK_GREEN);
AddLabel(MA_4hour_lower, "4h", Color.DARK_RED);
AddLabel(MA_4hour_same, "4h", Color.WHITE);
def MA_1hour_close;
def MA_1hour_shortAvg;
def MA_1hour_longAvg;
def MA_1hour_higher;
def MA_1hour_lower;
def MA_1hour_same;
def MA_1hour_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.HOUR {
MA_1hour_close = close(period="1 hour");
MA_1hour_shortAvg = MovingAverage(MAtype, MA_1hour_close, ShortAverage);
MA_1hour_longAvg = MovingAverage(MAtype,MA_1hour_close, LongAverage);
MA_1hour_nowcrossing = if Crosses(MA_1hour_shortAvg, MA_1hour_longAvg, CrossingDirection.ANY) then 1 else 0;
MA_1hour_same = if MA_1hour_nowcrossing == 1 then 1 else Double.NaN;
if MA_1hour_same == 1 {
MA_1hour_higher = Double.NaN;
MA_1hour_lower = Double.NaN;
} else {
MA_1hour_higher = if MA_1hour_shortAvg >= MA_1hour_longAvg[1] then 1 else Double.NaN;
MA_1hour_lower = if MA_1hour_shortAvg < MA_1hour_longAvg[1] then 1 else Double.NaN;
}
} else {
MA_1hour_close = 0;
MA_1hour_shortAvg = 0;
MA_1hour_longAvg = 0;
MA_1hour_higher = Double.NaN;
MA_1hour_lower = Double.NaN;
MA_1hour_same = Double.NaN;
MA_1hour_nowcrossing = 0;
}
AddLabel(MA_1hour_higher, "1h", Color.DARK_GREEN);
AddLabel(MA_1hour_lower, "1h", Color.DARK_RED);
AddLabel(MA_1hour_same, "1h", Color.WHITE);
def MA_15min_close;
def MA_15min_shortAvg;
def MA_15min_longAvg;
def MA_15min_higher;
def MA_15min_lower;
def MA_15min_same;
def MA_15min_nowcrossing;
if GetAggregationPeriod() <= AggregationPeriod.FIFTEEN_MIN {
MA_15min_close = close(period="15 min");
MA_15min_shortAvg = MovingAverage(MAtype, MA_15min_close, ShortAverage);
MA_15min_longAvg = MovingAverage(MAtype,MA_15min_close, LongAverage);
MA_15min_nowcrossing = if Crosses(MA_15min_shortAvg, MA_15min_longAvg, CrossingDirection.ANY) then 1 else 0;
MA_15min_same = if MA_15min_nowcrossing == 1 then 1 else Double.NaN;
if MA_15min_same == 1 {
MA_15min_higher = Double.NaN;
MA_15min_lower = Double.NaN;
} else {
MA_15min_higher = if MA_15min_shortAvg >= MA_15min_longAvg[1] then 1 else Double.NaN;
MA_15min_lower = if MA_15min_shortAvg < MA_15min_longAvg[1] then 1 else Double.NaN;
}
} else {
MA_15min_close = 0;
MA_15min_shortAvg = 0;
MA_15min_longAvg = 0;
MA_15min_higher = Double.NaN;
MA_15min_lower = Double.NaN;
MA_15min_same = Double.NaN;
MA_15min_nowcrossing = 0;
}
AddLabel(MA_15min_higher, "15m", Color.DARK_GREEN);
AddLabel(MA_15min_lower, "15m", Color.DARK_RED);
AddLabel(MA_15min_same, "15m", Color.WHITE);