My version of the TTM Trend for ThinkorSwim

H

henry1224

Member
VIP
Here is my version of the TTM Trend "5 Bar" It does not match up bar for bar, but as an indicator it works out

Code:
####################################################
declare Lower;
def o = Open;
def C = Close;
def H = High;
def L = Low;
def data = Sum((O+H+L+C)/4,6)/6;
def TRend1 = if C >= data then 1 else 0;
def TRend2 = if C >= data[1] then 1 else 0;
def TRend3 = if C >= data[2] then 1 else 0;
def TRend4 = if C >= data[3] then 1 else 0;
def TRend5 = if C >= data[4] then 1 else 0;
def half = 2.5;
Plot TotalT = (TRend1 + TRend2 + TRend3 + TRend4 + Trend5);
TotalT.AssignValueColor(if TotalT < half then Color.RED else Color.GREEN);
TotalT.setLineWeight(3);
AddCloud(TotalT, Half, Color.Light_Green, Color.Light_Red, no);
#################################################

Here is the Labels for the above indicator they will show support from the higher time frames. Plot several of them in the same section of the chart.

Code:
##################################################

declare lower;
input period = AggregationPeriod.DAY;
DefineGlobalColor("Long", Color.Green);
DefineGlobalColor("Short", Color.RED);
DefineGlobalColor("Neutral", Color.Yellow);
DefineGlobalColor("arrow Buy", Color.Cyan);
DefineGlobalColor("arrow Sell", Color.Orange);
Script SymbolTTrend{
input period = AggregationPeriod.DAY;
def OP = Open(period= period);
def CP = Close(Period= period);
def HP = High(period= period);
def LP = Low(Period= period);
def data = Sum((OP+HP+LP+CP)/4,6)/6;
def TRend1 = if CP >= data then 1 else 0;
def TRend2 = if CP >= data[1] then 1 else 0;
def TRend3 = if CP >= data[2] then 1 else 0;
def TRend4 = if CP >= data[3] then 1 else 0;
def TRend5 = if CP >= data[4] then 1 else 0;
Def TotalT = (TRend1 + TRend2 + TRend3 + TRend4 + Trend5);
Plot Result =  If TotalT > 2.5 then 1 else 0;}
Script SymbolSignal{
input period = AggregationPeriod.DAY;
def OP = Open(period= period);
def CP = Close(Period= period);
def HP = High(period= period);
def LP = Low(Period= period);
def data = Sum((OP+HP+LP+CP)/4,6)/6;
def TRend1 = if CP >= data then 1 else 0;
def TRend2 = if CP >= data[1] then 1 else 0;
def TRend3 = if CP >= data[2] then 1 else 0;
def TRend4 = if CP >= data[3] then 1 else 0;
def TRend5 = if CP >= data[4] then 1 else 0;
Def TotalT = (TRend1 + TRend2 + TRend3 + TRend4 + Trend5);
Plot Result =  If TotalT crosses Above 2.5 then 1 else If TotalT Crosses Below 2.5 then -1 else 0;}
def currentPeriod = GetAggregationPeriod();
def s1;
def h1;

if period >= currentPeriod {
    s1 = SymbolTTrend(period = period );
    h1 = SymbolSignal(period = period);
} else {
    s1 = Double.NaN;
    h1 = DOuble.Nan;
}
AddLabel(!IsNaN(s1), "TTMT:" + (if period == AggregationPeriod.MONTH then "M"
else
if period == AggregationPeriod.WEEK then "W"
else
if period == AggregationPeriod.FOUR_DAYS then "4D"
else
if period == AggregationPeriod.THREE_DAYS then "3D"
else
if period == AggregationPeriod.TWO_DAYS then "2D"
else
if period  == AggregationPeriod.DAY then "D"
else
if period == AggregationPeriod.FOUR_HOURS then "4H"
else
if period == AggregationPeriod.TWO_HOURS then "2H"
else
if period == AggregationPeriod.HOUR then "60m"
else
if period == AggregationPeriod.THIRTY_MIN then "30m"
else
if period == AggregationPeriod.TWENTY_MIN then "20m"
else
if period  == AggregationPeriod.FIFTEEN_MIN then "15m"
else
if period == AggregationPeriod.TEN_MIN then "10m"
else
if period == AggregationPeriod.FIVE_MIN then "5m"
else
if period == AggregationPeriod.FOUR_MIN then "4m"
else
if period  == AggregationPeriod.THREE_MIN then "3m"
else
if period == AggregationPeriod.TWO_MIN then "2m"
else
if period  == AggregationPeriod.MIN then "1m"
else ""), if s1 == 1 then GlobalColor("Long") else if s1 == 0 then GlobalColor("Short") else GlobalColor("Neutral"));
AddLabel(!IsNaN(h1) and h1 != 0, If h1 == 1 then "B" else if h1 == -1 then "S" else "-", if h1 == 1 then GlobalColor("arrow Buy") else if h1 == -1 then GlobalColor("arrow Sell") else color.gray);
 
Last edited:
H

henry1224

Member
VIP
Here is the multi Time Frame version
TTM 5 BAR MTF

Code:
##############################
Declare Lower;
# GLOBAL DEFINITIONS

DefineGlobalColor("TrendUp", CreateColor(0, 254, 30));
DefineGlobalColor("TrendDown", CreateColor(255, 3, 2));

input agg = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
input agg4 = AggregationPeriod.TWO_Hours;;
input agg5 = AggregationPeriod.FOUR_HOURs;
input agg6 = AggregationPeriod.DAY;
input DotSize = 3;
input n = 6;
def n1  = n + 1;

#Aggregation 1

def o = Open(Period = AGG);
def C = Close(Period =AGG);
def H = High(Period = AGG);
def L = Low(Period = AGG);
def Adata = Sum((O+H+L+C)/4,6)/6;
def ATRend1 = if C >= Adata then 1 else 0;
def ATRend2 = if C >= Adata[1] then 1 else 0;
def ATRend3 = if C >= Adata[2] then 1 else 0;
def ATRend4 = if C >= Adata[3] then 1 else 0;
def ATRend5 = if C >= Adata[4] then 1 else 0;
Def TotalT = (ATRend1 + ATRend2 + ATRend3 + ATRend4 + ATrend5);
plot TT1_Dot = if IsNaN(c) then Double.NaN else 1;
TT1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
TT1_Dot.SetLineWeight(DotSize);
TT1_Dot.AssignValueColor(if 2.5 > TotalT then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(c [n1]) and IsNaN(c [n]), 1, (agg/1000/60) + " min", Color.Yellow, yes);

#Aggregation 2

def o2 = Open(Period = AGG2);
def C2 = Close(Period =AGG2);
def H2 = High(Period = AGG2);
def L2 = Low(Period = AGG2);
def Bdata = Sum((O2+H2+L2+C2)/4,6)/6;
def BTRend1 = if C2 >= Bdata then 1 else 0;
def BTRend2 = if C2 >= Bdata[1] then 1 else 0;
def BTRend3 = if C2 >= Bdata[2] then 1 else 0;
def BTRend4 = if C2 >= Bdata[3] then 1 else 0;
def BTRend5 = if C2 >= Bdata[4] then 1 else 0;
Def TotalT2 = (BTRend1 + BTRend2 + BTRend3 + BTRend4 + BTrend5);
plot TT2_Dot = if IsNaN(c2) then Double.NaN else 2;
TT2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
TT2_Dot.SetLineWeight(DotSize);
TT2_Dot.AssignValueColor(if 2.5 > TotalT2 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(c2[n1]) and IsNaN(c2[n]), 2, (agg2/1000/60) + " min", Color.Yellow, yes);

#Aggregation 3

def O3 = Open(Period = AGG3);
def C3 = Close(Period =AGG3);
def H3 = High(Period = AGG3);
def L3 = Low(Period = AGG3);
def Cdata = Sum((O3+H3+L3+C3)/4,6)/6;
def CTRend1 = if C3 >= Cdata then 1 else 0;
def CTRend2 = if C3 >= Cdata[1] then 1 else 0;
def CTRend3 = if C3 >= Cdata[2] then 1 else 0;
def CTRend4 = if C3 >= Cdata[3] then 1 else 0;
def CTRend5 = if C3 >= Cdata[4] then 1 else 0;
Def TotalT3 = (CTRend1 + CTRend2 + CTRend3 + CTRend4 + CTrend5);
plot TT3_Dot = if IsNaN(c3) then Double.NaN else 3;
TT3_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
TT3_Dot.SetLineWeight(DotSize);
TT3_Dot.AssignValueColor(if 2.5 > TotalT3 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(c3[n1]) and IsNaN(c3[n]), 3, (agg3/1000/60) + " min", Color.Yellow, yes);

#Aggregation 4

def O4 = Open(Period = AGG4);
def C4 = Close(Period =AGG4);
def H4 = High(Period = AGG4);
def L4= Low(Period = AGG4);
def Ddata = Sum((O4+H4+L4+C4)/4,6)/6;
def DTRend1 = if C4 >= Ddata then 1 else 0;
def DTRend2 = if C4 >= Ddata[1] then 1 else 0;
def DTRend3 = if C4 >= Ddata[2] then 1 else 0;
def DTRend4 = if C4 >= Ddata[3] then 1 else 0;
def DTRend5 = if C4 >= Ddata[4] then 1 else 0;
Def TotalT4 = (DTRend1 + DTRend2 + DTRend3 + DTRend4 + DTrend5);
plot TT4_Dot = if IsNaN(c4) then Double.NaN else 4;
TT4_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
TT4_Dot.SetLineWeight(DotSize);
TT4_Dot.AssignValueColor(if 2.5 > TotalT4 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(c4[n1]) and IsNaN(c4[n]), 4, (agg4/1000/60) + " min", Color.Yellow, yes);

#Aggregation 5

def O5 = Open(Period = AGG5);
def C5 = Close(Period =AGG5);
def H5 = High(Period = AGG5);
def L5 = Low(Period = AGG5);
def Edata = Sum((O5+H5+L5+C5)/4,6)/6;
def ETRend1 = if C5 >= Edata then 1 else 0;
def ETRend2 = if C5 >= Edata[1] then 1 else 0;
def ETRend3 = if C5 >= Edata[2] then 1 else 0;
def ETRend4 = if C5 >= Edata[3] then 1 else 0;
def ETRend5 = if C5 >= Edata[4] then 1 else 0;
Def TotalT5 = (ETRend1 + ETRend2 + ETRend3 + ETRend4 + ETrend5);
plot TT5_Dot = if IsNaN(c5) then Double.NaN else 5;
TT5_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
TT5_Dot.SetLineWeight(DotSize);
TT5_Dot.AssignValueColor(if 2.5 >  TotalT5 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(c5[n1]) and IsNaN(c5[n]), 5, (agg5/1000/60) + " min", Color.Yellow, yes);

#Aggregation 6

def O6 = Open(Period = AGG6);
def C6 = Close(Period =AGG6);
def H6 = High(Period = AGG6);
def L6 = Low(Period = AGG6);
def Fdata = Sum((O6+H6+L6+C6)/4,6)/6;
def FTRend1 = if C6 >= Fdata then 1 else 0;
def FTRend2 = if C6 >= Fdata[1] then 1 else 0;
def FTRend3 = if C6 >= Fdata[2] then 1 else 0;
def FTRend4 = if C6 >= Fdata[3] then 1 else 0;
def FTRend5 = if C6 >= Fdata[4] then 1 else 0;
Def TotalT6 = (FTRend1 + FTRend2 + FTRend3 + FTRend4 + FTrend5);
plot TT6_Dot = if IsNaN(C6) then Double.NaN else 6;
TT6_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
TT6_Dot.SetLineWeight(DotSize);
TT6_Dot.AssignValueColor(if 2.5 >  TotalT6 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(C6[n1]) and IsNaN(C6[n]), 6, (agg6/1000/60) + " min", Color.Yellow, yes);
Def Bull = ((TotalT6[1] > TotalT6) + (TotalT5[1] > TotalT5) + (TotalT4[1] > TotalT4) + (TotalT3[1] > TotalT3) + (TotalT2[1] > TotalT2) + (TotalT[1] > TotalT));
Def Bear = ((TotalT6[1] < TotalT6) + (TotalT5[1] < TotalT5) + (TotalT4[1] < TotalT4) + (TotalT3[1] < TotalT3) + (TotalT2[1] < TotalT2) + (TotalT[1] < TotalT));
Alert(Bull >3,"", Alert.BAR, Sound.Chimes);
Alert (Bear >3,"", Alert.BAR, Sound.Chimes);
 
Pelonsax

Pelonsax

Active member
VIP
You're a firkin GENIUS!

My only comment: if you've already made all the other ones MTF, Might as well make the candle color study MTF as well!

Code:
###################################################
declare UPPER;
input period = AggregationPeriod.FIVE_MIN;
def o = Open(period = Period);
def C = Close(period = Period);
def H = High(period = Period);
def L = Low(period = Period);
def data = Sum((O+H+L+C)/4,6)/6;
def TRend1 = if C >= data then 1 else 0;
def TRend2 = if C >= data[1] then 1 else 0;
def TRend3 = if C >= data[2] then 1 else 0;
def TRend4 = if C >= data[3] then 1 else 0;
def TRend5 = if C >= data[4] then 1 else 0;
def half = 2.5;
def TotalT = (TRend1 + TRend2 + TRend3 + TRend4 + Trend5);
#TotalT.AssignValueColor(if TotalT < half then Color.RED else Color.GREEN);
#TotalT.setLineWeight(3);
AssignPriceColor(if TotalT then Color.Light_Green else if half then Color.Light_Red else color.CURRENT);
#################################################
 
H

henry1224

Member
VIP
If you add the Labels indicator like 4 or 5 times to the same chart area , it will give you MTF of the first indicator
 
hectorgasm

hectorgasm

New member
@henry1224 thank you for the indicator, it's looking good, but you forgot to mention that it repaints, as well as @Pelonsax code!
 
Pelonsax

Pelonsax

Active member
VIP
It does at that. I'm about to bring in some code that I think does not repaint. But it's based on something slightly different. I'll start a new thread
 
K

KevinSammy

New member
VIP
Hello @Pelonsax,

Can you please provide a link or comment on this thread if/when you update for script that does NOT repaint?
I just subscribed to this thread so that I'm notified...otherwise, if you open a new thread folks like me won't know :)


Thank YOU!!
 
T

TraderGary

New member
It does at that. I'm about to bring in some code that I think does not repaint. But it's based on something slightly different. I'll start a new thread

@Pelonsax Is it repainting on the current bar or on previous bars? Because if it's repainting on the current bar, I would think that's just because the bar has not closed yet, and the trend has changed within that bar?

I love this indicator and plan to use it for trend definition in a MTF strategy I am currently building in TOS. But if it's repainting past bars, it may not be useful for my intentions.
 
H

henry1224

Member
VIP
Where the first version took the sum of 5 trends and only showed signals if more than half were above or below "which I feel that was contributing to the problems

This version plots them separately over 3 time frames

Code:
##TTM_Trend_6_Bar_w_3_MTF
here is the code

Declare Lower;
# GLOBAL DEFINITIONS
DefineGlobalColor("TrendUp", CreateColor(0, 254, 30));
DefineGlobalColor("TrendDown", CreateColor(255, 3, 2));
input agg = AggregationPeriod.FIVE_MIN;
input agg2 = AggregationPeriod.THIRTY_MIN;
input agg3 = AggregationPeriod.HOUR;
input DotSize = 5;
input n = 17;
def n1  = n + 1;

#Aggregation 1 AT1
def o = Open(Period = AGG);
def C = Close(Period =AGG);
def H = High(Period = AGG);
def L = Low(Period = AGG);
def Adata = Sum((O+H+L+C)/4,6)/6;
def AT1 = if C >= Adata then 1 else 0;
def AT2 = if C >= Adata[1] then 1 else 0;
def AT3 = if C >= Adata[2] then 1 else 0;
def AT4 = if C >= Adata[3] then 1 else 0;
def AT5 = if C >= Adata[4] then 1 else 0;
plot AT1_Dot = if IsNaN(close) then Double.NaN else 1;
AT1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
AT1_Dot.SetLineWeight(DotSize);
AT1_Dot.AssignValueColor(if AT1 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(close [n1]) and IsNaN(Close [n]), 1, (agg/1000/60) + " min", Color.Yellow, yes);
plot AT2_Dot = if IsNaN(close) then Double.NaN else 2;
AT2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
AT2_Dot.SetLineWeight(DotSize);
AT2_Dot.AssignValueColor(if AT2 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(close [n1]) and IsNaN(Close [n]), 2, (agg/1000/60) + " min", Color.Yellow, yes);
plot AT3_Dot = if IsNaN(close) then Double.NaN else 3;
AT3_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
AT3_Dot.SetLineWeight(DotSize);
AT3_Dot.AssignValueColor(if AT3==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(close [n1]) and IsNaN(Close [n]),3, (agg/1000/60) + " min", Color.Yellow, yes);
plot AT4_Dot = if IsNaN(close) then Double.NaN else 4;
AT4_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
AT4_Dot.SetLineWeight(DotSize);
AT4_Dot.AssignValueColor(if AT4 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(close [n1]) and IsNaN(Close [n]), 4, (agg/1000/60) + " min", Color.Yellow, yes);
plot AT5_Dot = if IsNaN(close) then Double.NaN else 5;
AT5_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
AT5_Dot.SetLineWeight(DotSize);
AT5_Dot.AssignValueColor(if AT5 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(close [n1]) and IsNaN(Close [n]), 5, (agg/1000/60) + " min", Color.Yellow, yes);

#Aggregation 2 BT1
def o2 = Open(Period = AGG2);
def C2 = Close(Period =AGG2);
def H2 = High(Period = AGG2);
def L2 = Low(Period = AGG2);
def Bdata = Sum((O2+H2+L2+C2)/4,6)/6;
def BT1 = if C2 >= Bdata then 1 else 0;
def BT2 = if C2 >= Bdata[1] then 1 else 0;
def BT3 = if C2 >= Bdata[2] then 1 else 0;
def BT4 = if C2 >= Bdata[3] then 1 else 0;
def BT5 = if C2 >= Bdata[4] then 1 else 0;
plot BT1_Dot = if IsNaN(Close) then Double.NaN else 7;
BT1_Dot.SetPaintingStrategy(PaintingStrategy.Points);
BT1_Dot.SetLineWeight(DotSize);
BT1_Dot.AssignValueColor(if BT1 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 7, (agg2/1000/60) + " min", Color.Yellow, yes);
plot BT2_Dot = if IsNaN(Close) then Double.NaN else 8;
BT2_Dot.SetPaintingStrategy(PaintingStrategy.Points);
BT2_Dot.SetLineWeight(DotSize);
BT2_Dot.AssignValueColor(if BT2 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 8, (agg2/1000/60) + " min", Color.Yellow, yes);
plot BT3_Dot = if IsNaN(Close) then Double.NaN else 9;
BT3_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
BT3_Dot.SetLineWeight(DotSize);
BT3_Dot.AssignValueColor(if BT3 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 9, (agg2/1000/60) + " min", Color.Yellow, yes);
plot BT4_Dot = if IsNaN(Close) then Double.NaN else 10;
BT4_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
BT4_Dot.SetLineWeight(DotSize);
BT4_Dot.AssignValueColor(if BT4 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 10, (agg2/1000/60) + " min", Color.Yellow, yes);
plot BT5_Dot = if IsNaN(Close) then Double.NaN else 11;
BT5_Dot.SetPaintingStrategy(PaintingStrategy.POINTS);
BT5_Dot.SetLineWeight(DotSize);
BT5_Dot.AssignValueColor(if BT5 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 11, (agg2/1000/60) + " min", Color.Yellow, yes);
#Aggregation 3 CT1
def O3 = Open(Period = AGG3);
def C3 = Close(Period =AGG3);
def H3 = High(Period = AGG3);
def L3 = Low(Period = AGG3);
def Cdata = Sum((O3+H3+L3+C3)/4,6)/6;
def CT1 = if C3 >= Cdata then 1 else 0;
def CT2 = if C3 >= Cdata[1] then 1 else 0;
def CT3 = if C3 >= Cdata[2] then 1 else 0;
def CT4 = if C3 >= Cdata[3] then 1 else 0;
def CT5 = if C3 >= Cdata[4] then 1 else 0;
plot CT1_Dot = if IsNaN(Close) then Double.NaN else 13;
CT1_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
CT1_Dot.SetLineWeight(DotSize);
CT1_Dot.AssignValueColor(if CT1 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 13, (agg3/1000/60) + " min", Color.Yellow, yes);
plot CT2_Dot = if IsNaN(Close) then Double.NaN else 14;
CT2_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
CT2_Dot.SetLineWeight(DotSize);
CT2_Dot.AssignValueColor(if CT2 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 14, (agg3/1000/60) + " min", Color.Yellow, yes);
plot CT3_Dot = if IsNaN(Close) then Double.NaN else 15;
CT3_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
CT3_Dot.SetLineWeight(DotSize);
CT3_Dot.AssignValueColor(if CT3 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 15, (agg3/1000/60) + " min", Color.Yellow, yes);
plot CT4_Dot = if IsNaN(Close) then Double.NaN else 16;
CT4_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
CT4_Dot.SetLineWeight(DotSize);
CT4_Dot.AssignValueColor(if CT4 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 16, (agg3/1000/60) + " min", Color.Yellow, yes);
plot CT5_Dot = if IsNaN(Close) then Double.NaN else 17;
CT5_Dot.SetPaintingStrategy(PaintingStrategy.TRIANGLES);
CT5_Dot.SetLineWeight(DotSize);
CT5_Dot.AssignValueColor(if CT5 ==0 then GlobalColor("TrendDown") else GlobalColor("TrendUp"));
AddChartBubble(!IsNaN(Close[n1]) and IsNaN(Close[n]), 17, (agg3/1000/60) + " min", Color.Yellow, yes);
 
T

TraderGary

New member
@henry1224 Thank you so much! I look forward to testing this over the weekend.
 
D

David45

Member
2019 Donor
Does anyone know how to change or add to the code for this indicator so that when bullish, the candlesticks paint Dark_Green instead of the default Blue?

Thanks in advance!
 
BenTen

BenTen

Administrative
Staff
VIP
@David45 You can change it directly in the original indicator's settings page.

 
D

David45

Member
2019 Donor
@BenTen Wow I feel stupid! I had no idea you could change these colors under Globals. Thanks so much for pointing this out to me BenTen!
 

Similar threads

Top