thinkscript PairRatio not working

Tony Stark

New member
Hey everyone could I be pointed in the right direction of what to do if an indicator already provided by TD Ameritrade is not working and the code seems fine by the functions still being provided and supposedly working on their site but even when I use the functions in my own edit version nothing happens.

Their Raw code :

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2009-2020
#
declare lower;

input reverse = No;

def value = close(getSymbolPart(1)) / close(getSymbolPart(2));
plot Ratio = if reverse then 1 / value else value;

Ratio.SetDefaultColor(GetColor(1));
 
Last edited:

Tony Stark

New member
I found the problem but it makes me change my symbol as a combo on the top left of the application Ex: SPY-BZ which by doing that it blocks the "depth of Market" on the right side of the application for some reason.
 

Welkin

Active member
VIP
@Tony Stark here, this way you won't need to use a combination of symbols in the chart's ticker input , only need to go into the study settings and assign your tickers there.

Code:
declare lower;
input symbol1 = "/ES";
input symbol2 = "/NQ";
input reverse = No;
def value = close(symbol = symbol1) / close(symbol = symbol2);
plot Ratio = if reverse then 1 / value else value;
Ratio.SetDefaultColor(GetColor(1));
 

Similar threads

Top