i'm trying to get the slope of a derivative of RSI, which is a line that traces the high pivots:
i looked here to find code to get the slope of a line:
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/ATan
so i wrote this:
the trouble is, it returns N/A , because there are non-number values in rsiHighPeakPlot
i guess enableApproximation() doesn't actually change the function in the code...it just changes how it plots on the chart...
i mean...it plots a bunch of specific nodes with specific values so they're totally there. i just dont know how to reference or access that function in the code.
any tips?
Code:
def rsiHighPeak = if rsi[1] < rsi and rsi[-1] < rsi then 1 else 0;
plot rsiHighPeakPlot = if rsiHighPeak == 1 then rsi else Double.NaN;
rsiHighPeakPlot.enableApproximation();
i looked here to find code to get the slope of a line:
https://tlc.thinkorswim.com/center/reference/thinkScript/Functions/Math---Trig/ATan
so i wrote this:
Code:
input length = 1;
def height = rsiHighPeakPlot - rsiHighPeakPlot[length];
plot "Angle, deg" = ATan(height/lengthh) * 180 / Double.Pi;
the trouble is, it returns N/A , because there are non-number values in rsiHighPeakPlot
i guess enableApproximation() doesn't actually change the function in the code...it just changes how it plots on the chart...
i mean...it plots a bunch of specific nodes with specific values so they're totally there. i just dont know how to reference or access that function in the code.
any tips?