Trend_R_Signal Indicator for ThinkorSwim


New member
2019 Donor
The indicator was made my Mobius. This indicator can predict bullish and bearish trend by plotting lines between 0.2 to -0.2 graph. If the line is at 0.2(Positive) than its trending if it's at -0.2(negative) then its bearish.

Originally it was made as a lower study. I modified it and made it upper study with arrows when bullish and bearish patterns appear. This will save some space on the workspace for other indicators.

I have done some backtesting and it generated some decent amount on profits on Timeframes above 3 Minutes.

Cons: Does not work well in Choppy Markets.


thinkScript Code

# R Signal Trend Sign


#If R signal is above 0 trend is up and below 0 trend is down.


#Modified: Jerry 6/27/2019

input n = 10;
def size = 100;

def c = close;

def r = Sqrt(Sqr(Log(c / c[n])) + Sqr(Log(n))) /

        Sum(Sqrt(1 + Sqr(Log(c / c[1]))), n - 1);

def signal = if Log(c / c[n]) > 0 then ExpAverage(r, n) else ExpAverage(-r, n);

AddLabel(yes, signal, Color.WHITE);
def buy = 0;
def sell = 0;
def strategy = if signal > 0 then buy else if signal < 0 then sell else 0;

plot buyOpen = signal[1] crosses above 0;
def buyClose = signal crosses below 0;

plot shortOpen = signal[1] crosses below 0;
def shortClose = signal crosses above 0;

Shareable Link

Upper Study: Study:
Last edited by a moderator:


Well-known member
Thank you, Jerry. One request; Where you put #Modified in your script (thanks) please put a breif explanation of your mods so that if the script gets "into the wild" it can be dialed back to Mobius' original form. This is a newer request from the folks in TSL.