bri8htf1y
New member
Hi all, this one seems simple but its eluding me. My system requires frequent comparisons between the same pairs of symbols.
For the sake of this question, a simple example:
input Other = "/NQ";
plot data = close;
plot dataOther = close(Other);
This works to plot both symbols, the current and the input.
But it would be much faster if it were automatic. Since the "Other" symbol is always the same based on the current symbol in my system, it seems that a variable could be defined so that, ie:
def Other = if getSymbol() == "AAPL" then "/NQ" else double.nan;
plot data = close;
plot dataOther = close(Other);
This way whenever I select one symbol, another symbol is automatically the referenced.
Is this a syntax issue or is this just not possible? Thanks in advance!
For the sake of this question, a simple example:
input Other = "/NQ";
plot data = close;
plot dataOther = close(Other);
This works to plot both symbols, the current and the input.
But it would be much faster if it were automatic. Since the "Other" symbol is always the same based on the current symbol in my system, it seems that a variable could be defined so that, ie:
def Other = if getSymbol() == "AAPL" then "/NQ" else double.nan;
plot data = close;
plot dataOther = close(Other);
This way whenever I select one symbol, another symbol is automatically the referenced.
Is this a syntax issue or is this just not possible? Thanks in advance!