TTM Trend Source Code For ThinkOrSwim

dolomick

Member
The TTM Trend indicator from ThinkorSwim doesn't have a source code to edit. Here is the TTM Trend replica that you guys can add and modify to your liking.

Code:
###   TTM_Trend Replica   ###
###   Chatroom request   ###
###   DMonkey 7/5/2016   ###

input price = close;
input n = 16;   #length

def h = high;
def l = low;
def c = close;
def na = double.nan;

def rangehigh = average(highest(h,n));
def rangelow = average(lowest(l,n));
def median = ((rangehigh + rangelow) / 2);
def uparrow = if c > median then l else na;
def downarrow = if c < median then h else na;

plot up_arrow = uparrow;
        up_arrow.setpaintingStrategy(PaintingStrategy.ARROW_UP);

plot down_arrow = downarrow;
        down_arrow.setpaintingStrategy(PaintingStrategy.ARROW_DOWN);

### End Code   ###
 

OGK

New member
The TTM Trend indicator from ThinkorSwim doesn't have a source code to edit. Here is the TTM Trend replica that you guys can add and modify to your liking.

Code:
###   TTM_Trend Replica   ###
###   Chatroom request   ###
###   DMonkey 7/5/2016   ###

input price = close;
input n = 16;   #length

def h = high;
def l = low;
def c = close;
def na = double.nan;

def rangehigh = average(highest(h,n));
def rangelow = average(lowest(l,n));
def median = ((rangehigh + rangelow) / 2);
def uparrow = if c > median then l else na;
def downarrow = if c < median then h else na;

plot up_arrow = uparrow;
        up_arrow.setpaintingStrategy(PaintingStrategy.ARROW_UP);

plot down_arrow = downarrow;
        down_arrow.setpaintingStrategy(PaintingStrategy.ARROW_DOWN);

### End Code   ###
how can this be set where it shows only the candle bars with the proper color instead of the arrows on top and bottom to replicate it similar to the native TTM_Trend study in TOS
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
how can this be set where it shows only the candle bars with the proper color instead of the arrows on top and bottom to replicate it similar to the native TTM_Trend study in TOS
So using the ToS TTM Trend study will fit your needs.
 
Last edited:
  • Like
Reactions: OGK

Similar threads

Top