I would like to be able to compare the trend of two stocks by putting them into the same chart. Say YM and ES futures to see the divergence of price between the two. Please advise.
Code:
# Compare Symbols
# Mobius
input symb_1 = "/NQ";
input symb_2 = "/YM";
script Scale {
input c = close;
def Min = LowestAll(close);
def Max = HighestAll(close);
def hh = HighestAll(c);
def ll = LowestAll(c);
plot Range = (((Max - Min) * (c - ll)) / (hh - ll)) + Min;
}
plot symb1 = Scale(close(symb_1));
plot symb2 = Scale(close(symb_2));
addLabel(1, symb_1, symb1.TakeValueColor());
addLabel(1, symb_2, symb2.TakeValueColor());