I'm working on an indicator that combines values from different tickers, so I am trying to use GetSymbol() to get the current values of the referenced stocks. To start off, I pasted the following code from the ThinkScript Learning Center into a study called GetSymbolTest:
declare lower;
plot Diff = close(GetSymbol()) - close("IBM");
which is supposed to plot "the difference between Close prices of currently selected symbol and IBM.". But when I use the script the lower window is blank. Does anyone know what I am doing wrong, and how can I get GetSymbol() to work? Any information will be appreciated.
Or maybe I should have said, referencing symbols other than the current one is not working. If I change the code to
declare lower;
plot Diff = close(GetSymbol());
It works. It's the reference to IBM that is not working, and that is what I am looking for. So I gues the question is why doesn't the following code :
declare lower;
plot Diff = close("IBM");
work?
declare lower;
plot Diff = close(GetSymbol()) - close("IBM");
which is supposed to plot "the difference between Close prices of currently selected symbol and IBM.". But when I use the script the lower window is blank. Does anyone know what I am doing wrong, and how can I get GetSymbol() to work? Any information will be appreciated.
Or maybe I should have said, referencing symbols other than the current one is not working. If I change the code to
declare lower;
plot Diff = close(GetSymbol());
It works. It's the reference to IBM that is not working, and that is what I am looking for. So I gues the question is why doesn't the following code :
declare lower;
plot Diff = close("IBM");
work?
Last edited: