I am trying to create a plot of ratio of Symbol1 price to Symbol2 price so I can compare performance of one equity Vs another.
That part would be simple using input Symbol1 and Symbol 2.
However, I want to be able to have Symbol1 default to current equity being plotted in chart with a selector to change it to another equity (from a preset list of equities) independent of what is being plotted.
I started with the following code:
input Symbol1 = {"QQQ", "IWM", default Getsymbol};
input Symbol2 = "SPY";
def Symbol1Price = close(Symbol1);
def Symbol2Price = close(Symbol2);
plot ratio = Symbol1Price/Symbol2Price;
Default plot is blank. Only when i change Symbol1 selector to QQQ or IWM does it create a plot.
I'd appreciate any help.
That part would be simple using input Symbol1 and Symbol 2.
However, I want to be able to have Symbol1 default to current equity being plotted in chart with a selector to change it to another equity (from a preset list of equities) independent of what is being plotted.
I started with the following code:
input Symbol1 = {"QQQ", "IWM", default Getsymbol};
input Symbol2 = "SPY";
def Symbol1Price = close(Symbol1);
def Symbol2Price = close(Symbol2);
plot ratio = Symbol1Price/Symbol2Price;
Default plot is blank. Only when i change Symbol1 selector to QQQ or IWM does it create a plot.
I'd appreciate any help.