Display MTF Ichimoku Clouds on the Upper Chart For ThinkOrSwim

Investingtogive

Member
VIP
Display MTF Ichimoku Clouds on the Upper Chart For ThinkOrSwim

I found it very useful to display MTF (Multi Time Frame) Ichimoku clouds in the Upper Chart. It shows reliable Support and Resistance levels. It can get a little busy when Price is in the middle of all of the clouds, but powerful when price breaks above or below all of the clouds. You can select the 4 different time frames from settings.
Here is the code:
Ruby:
# MTF Ichimoku Clouds - Upper Chart
# Investing to Give.

input Start = AggregationPeriod.TEN_MIN;
input Short = AggregationPeriod.FIFTEEN_MIN;
input Medium = AggregationPeriod.THIRTY_MIN;
input Long = AggregationPeriod.HOUR;

input tenkanPeriod = 9;
input kijunPeriod = 26;
input ShowStart = yes;
input Show10Minutes = yes;
input ShowHour = yes;
input ShowDay = yes;


#Start
def high_Start = high(period = Start);
def low_Start = low(period = Start);
def close_Start = close(period = Start);

def highest_Start_tenkan = Highest(high_Start, tenkanPeriod );

def lowest_Start_tenkan = Lowest(low_Start, tenkanPeriod );

def highest_Start_kijun = Highest(high_Start, kijunPeriod );

def lowest_Start_kijun = Lowest(low_Start, kijunPeriod );

def Tenkan_Sen_Start = (highest_Start_tenkan + lowest_Start_tenkan) / 2;
def Kijun_Sen_Start = (highest_Start_kijun + lowest_Start_kijun) / 2;

def tk_Start = Tenkan_Sen_Start[kijunPeriod];
def kj_Start = Kijun_Sen_Start[kijunPeriod];

def h2_Start = Highest(high_Start[kijunPeriod], 2 * kijunPeriod);
def l2_Start = Lowest(low_Start[kijunPeriod], 2 * kijunPeriod);

def Senkou_Span_A_Start = (tk_Start + kj_Start) / 2;
def Senkou_Span_B_Start = (h2_Start + l2_Start) / 2;

DefineGlobalColor("Bullish", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);
AddCloud(Senkou_Span_A_Start, Senkou_Span_B_Start, GlobalColor("Bullish"), GlobalColor("Bearish"));
# Senkou_Span_A_Start.SetHiding(ShowDay==no);



#10M
def high_10M = high(period = Short);
def low_10M = low(period = Short);
def close_10M = close(period = Short);

def highest_10M_tenkan = Highest(high_10M, tenkanPeriod );

def lowest_10M_tenkan = Lowest(low_10M, tenkanPeriod );

def highest_10M_kijun = Highest(high_10M, kijunPeriod );

def lowest_10M_kijun = Lowest(low_10M, kijunPeriod );

def Tenkan_Sen_10M = (highest_10M_tenkan + lowest_10M_tenkan) / 2;
def Kijun_Sen_10M = (highest_10M_kijun + lowest_10M_kijun) / 2;

def tk_10M = Tenkan_Sen_10M[kijunPeriod];
def kj_10M = Kijun_Sen_10M[kijunPeriod];

def h2_10M = Highest(high_10M[kijunPeriod], 2 * kijunPeriod);
def l2_10M = Lowest(low_10M[kijunPeriod], 2 * kijunPeriod);

def Senkou_Span_A_10M = (tk_10M + kj_10M) / 2;
def Senkou_Span_B_10M = (h2_10M + l2_10M) / 2;

DefineGlobalColor("Bullish", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);
AddCloud(Senkou_Span_A_10M, Senkou_Span_B_10M, GlobalColor("Bullish"), GlobalColor("Bearish"));


#1H
def high_1H = high(period = Medium);
def low_1H = low(period = Medium);
def close_1H = close(period = Medium);

def highest_1H_tenkan = Highest(high_1H, tenkanPeriod );

def lowest_1H_tenkan = Lowest(low_1H, tenkanPeriod );

def highest_1H_kijun = Highest(high_1H, kijunPeriod );

def lowest_1H_kijun = Lowest(low_1H, kijunPeriod );

def Tenkan_Sen_1H = (highest_1H_tenkan + lowest_1H_tenkan) / 2;
def Kijun_Sen_1H = (highest_1H_kijun + lowest_1H_kijun) / 2;

def tk_1H = Tenkan_Sen_1H[kijunPeriod];
def kj_1H = Kijun_Sen_1H[kijunPeriod];

def h2_1H = Highest(high_1H[kijunPeriod], 2 * kijunPeriod);
def l2_1H = Lowest(low_1H[kijunPeriod], 2 * kijunPeriod);

def Senkou_Span_A_1H = (tk_1H + kj_1H) / 2;
def Senkou_Span_B_1H = (h2_1H + l2_1H) / 2;

DefineGlobalColor("Bullish", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);
AddCloud(Senkou_Span_A_1H, Senkou_Span_B_1H, GlobalColor("Bullish"), GlobalColor("Bearish"));


#1D
def high_1D = high(period = Long);
def low_1D = low(period = Long);
def close_1D = close(period = Long);

def highest_1D_tenkan = Highest(high_1D, tenkanPeriod );

def lowest_1D_tenkan = Lowest(low_1D, tenkanPeriod );

def highest_1D_kijun = Highest(high_1D, kijunPeriod );

def lowest_1D_kijun = Lowest(low_1D, kijunPeriod );

def Tenkan_Sen_1D = (highest_1D_tenkan + lowest_1D_tenkan) / 2;
def Kijun_Sen_1D = (highest_1D_kijun + lowest_1D_kijun) / 2;

def tk_1D = Tenkan_Sen_1D[kijunPeriod];
def kj_1D = Kijun_Sen_1D[kijunPeriod];

def h2_1D = Highest(high_1D[kijunPeriod], 2 * kijunPeriod);
def l2_1D = Lowest(low_1D[kijunPeriod], 2 * kijunPeriod);

def Senkou_Span_A_1D = (tk_1D + kj_1D) / 2;
def Senkou_Span_B_1D = (h2_1D + l2_1D) / 2;

DefineGlobalColor("Bullish", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);
AddCloud(Senkou_Span_A_1D, Senkou_Span_B_1D, GlobalColor("Bullish"), GlobalColor("Bearish"));


# End
 
Last edited by a moderator:

APOT7

Member
VIP
Not yet. I am trying to see if there is a better way. For now I just have it on a separate chart on my left monitor. I'll let you know if I come up with something.
Do you know how to take the colors out of the clouds and just leave the lines on the chart??
 

MerryDay

Administrative
Staff member
Staff
VIP
Lifetime
@APOT7
Find these lines of code in the script:
def Senkou_Span_A_10M = (tk_10M + kj_10M) / 2;
def Senkou_Span_B_10M = (h2_10M + l2_10M) / 2;

DefineGlobalColor("Bullish", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);
AddCloud(Senkou_Span_A_10M, Senkou_Span_B_10M, GlobalColor("Bullish"), GlobalColor("Bearish"));

Change them to look like this:
plot Senkou_Span_A_10M = (tk_10M + kj_10M) / 2;
plot Senkou_Span_B_10M = (h2_10M + l2_10M) / 2;
DefineGlobalColor("Bullish", Color.YELLOW);
DefineGlobalColor("Bearish", Color.RED);
# AddCloud(Senkou_Span_A_10M, Senkou_Span_B_10M, GlobalColor("Bullish"), GlobalColor("Bearish"));
 

Invesqua

New member
Is there a lower indicator that shows a series of dots (red=blow, green=above, grey=inside) for the cloud over multiple time frames?

If for example there were 3 time frames of interest: 15 min, 1 hr, 1 Day; then there would be 3 seperate, horizontal lines with varying colored dots (based on price location relative to cloud) for each time frame.

Trying not to re-invent something that has already been created.

Many thanks for your assistance.
 
Last edited by a moderator:

Investingtogive

Member
VIP
Ask and you shall receive.... Here is an indicator that plots 4 time frames on the bottom.

declare lower;

input Start = aggreGationPeriod.TEN_MIN;
input Short = aggreGationPeriod.fifTEEN_MIN;
input Medium = aggreGationPeriod.thirtY_MIN;
input Long = aggreGationPeriod.HOUR;

input tenkanPeriod = 9;
input kijunPeriod = 26;
input ShowStart = yes;
input Show10Minutes = yes;
input ShowHour = yes;
input ShowDay = yes;

script LookForward
{
input series = close;
input period = 26;


def lk = fold i = 0 to period with h=0 do if h == 0 and GetValue(series, -i) == yes then i else h;

plot lookforward = lk;
}

script CalculateHighest
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input length = 10;



def _highest = if new_bar then fold i1 = 0 to bartocheck with h=0 do if GetValue(barnumber, i1) >= barnumber - length + 1 then Max(h, GetValue(price, i1)) else h else _highest[1];

plot highest = _highest;
}

script CalculateLowest
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input length = 10;


def _lowest = if new_bar then fold i2 = 0 to bartocheck with l=99999999 do if GetValue(barnumber, i2) >= barnumber - length + 1 and GetValue(price, i2) > 0 then Min(l, GetValue(price, i2)) else l else _lowest[1];

plot lowest = _lowest;
}

script CalculateHighest2
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input frombar = 0;
input tobar = 10;



def _highest = if new_bar then fold i1 = 0 to bartocheck with h=0 do if GetValue(barnumber, i1) <= barnumber - frombar and GetValue(barnumber, i1) >= barnumber - tobar then Max(h, GetValue(price, i1)) else h else _highest[1];

plot highest = _highest;
}

script CalculateLowest2
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input frombar = 0;
input tobar = 10;


def _lowest = if new_bar then fold i2 = 0 to bartocheck with l=99999999 do if GetValue(barnumber, i2) <= barnumber - frombar and GetValue(barnumber, i2) >= barnumber - tobar and GetValue(price, i2) > 0 then Min(l, GetValue(price, i2)) else l else _lowest[1];

plot lowest = _lowest;
}

script LookBack
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input length = 10;



def _value = if new_bar then fold i1 = 0 to bartocheck with h=0 do if GetValue(barnumber, i1) == barnumber - length then GetValue(price, i1) else h else _value[1];

plot value = _value;
}



def barNum = CompoundValue(1, barNum[1] + 1, 1);


#Start
def high_start = high(period = start);
def low_start = low(period = start);
def close_start = close(period = start);

def highest_start_tenkan = Highest(high_start, tenkanPeriod );

def lowest_start_tenkan = Lowest(low_start, tenkanPeriod );

def highest_start_kijun = Highest(high_start, kijunPeriod );

def lowest_start_kijun = Lowest(low_start, kijunPeriod );

def Tenkan_Sen_start = (highest_start_tenkan + lowest_start_tenkan) / 2;
def Kijun_Sen_start = (highest_start_kijun + lowest_start_kijun) / 2;

def tk_start = Tenkan_Sen_start[kijunPeriod];
def kj_start = Kijun_Sen_start[kijunPeriod];

def h2_start = highest(high_start[kijunPeriod], 2*kijunPeriod);
def l2_start = lowest(low_start[kijunPeriod], 2*kijunPeriod);

def Senkou_Span_A_start = (tk_start + kj_start) / 2;
def Senkou_Span_B_start = (h2_start + l2_start) / 2;

plot IchimokuSignal_start = if ( isnaN(close),double.NaN, 4);
IchimokuSignal_start.SetPaintingStrategy(PaintingStrategy.POINTS);
IchimokuSignal_start.AssignValueColor( if (Showstart and close_start > Max(Senkou_Span_A_start, Senkou_Span_B_start)) then Color.GREEN else if (Showstart and close_start < Min(Senkou_Span_A_start, Senkou_Span_B_start)) then Color.RED else Color.Yellow);
IchimokuSignal_start.SetLineWeight(2);
IchimokuSignal_start.SetHiding(Showstart==no);


#10M
def high_10M = high(period = short);
def low_10M = low(period = short);
def close_10M = close(period = short);

def highest_10M_tenkan = Highest(high_10M, tenkanPeriod );

def lowest_10M_tenkan = Lowest(low_10M, tenkanPeriod );

def highest_10M_kijun = Highest(high_10M, kijunPeriod );

def lowest_10M_kijun = Lowest(low_10M, kijunPeriod );

def Tenkan_Sen_10M = (highest_10M_tenkan + lowest_10M_tenkan) / 2;
def Kijun_Sen_10M = (highest_10M_kijun + lowest_10M_kijun) / 2;

def tk_10M = Tenkan_Sen_10M[kijunPeriod];
def kj_10M = Kijun_Sen_10M[kijunPeriod];

def h2_10M = highest(high_10M[kijunPeriod], 2*kijunPeriod);
def l2_10M = lowest(low_10M[kijunPeriod], 2*kijunPeriod);

def Senkou_Span_A_10M = (tk_10M + kj_10M) / 2;
def Senkou_Span_B_10M = (h2_10M + l2_10M) / 2;

plot IchimokuSignal_10M = if ( isnaN(close),double.NaN, 3);
IchimokuSignal_10M.SetPaintingStrategy(PaintingStrategy.POINTS);
IchimokuSignal_10M.AssignValueColor( if (Show10Minutes and close_10M > Max(Senkou_Span_A_10M, Senkou_Span_B_10M)) then Color.GREEN else if (Show10Minutes and close_10M < Min(Senkou_Span_A_10M, Senkou_Span_B_10M)) then Color.RED else Color.Yellow);
IchimokuSignal_10M.SetLineWeight(2);
IchimokuSignal_10M.SetHiding(Show10Minutes==no);

#1H
def high_1H = high(period = medium);
def low_1H = low(period = medium);
def close_1H = close(period = medium);

def highest_1H_tenkan = Highest(high_1H, tenkanPeriod );

def lowest_1H_tenkan = Lowest(low_1H, tenkanPeriod );

def highest_1H_kijun = Highest(high_1H, kijunPeriod );

def lowest_1H_kijun = Lowest(low_1H, kijunPeriod );

def Tenkan_Sen_1H = (highest_1H_tenkan + lowest_1H_tenkan) / 2;
def Kijun_Sen_1H = (highest_1H_kijun + lowest_1H_kijun) / 2;

def tk_1H = Tenkan_Sen_1H[kijunPeriod];
def kj_1H = Kijun_Sen_1H[kijunPeriod];

def h2_1H = highest(high_1H[kijunPeriod], 2*kijunPeriod);
def l2_1H = lowest(low_1H[kijunPeriod], 2*kijunPeriod);

def Senkou_Span_A_1H = (tk_1H + kj_1H) / 2;
def Senkou_Span_B_1H = (h2_1H + l2_1H) / 2;

plot IchimokuSignal_1H = if (isnaN(close),double.NaN, 2);
IchimokuSignal_1H.SetPaintingStrategy(PaintingStrategy.POINTS);
IchimokuSignal_1H.AssignValueColor( if (ShowDay and close_1H > Max(Senkou_Span_A_1H, Senkou_Span_B_1H)) then Color.GREEN else if (ShowDay and close_1H < Min(Senkou_Span_A_1H, Senkou_Span_B_1H)) then Color.RED else Color.Yellow);
IchimokuSignal_1H.SetLineWeight(5);
IchimokuSignal_1H.SetHiding(ShowHour==no);

#1D
def high_1D = high(period = long);
def low_1D = low(period = long);
def close_1D = close(period = long);

def highest_1D_tenkan = Highest(high_1D, tenkanPeriod );

def lowest_1D_tenkan = Lowest(low_1D, tenkanPeriod );

def highest_1D_kijun = Highest(high_1D, kijunPeriod );

def lowest_1D_kijun = Lowest(low_1D, kijunPeriod );

def Tenkan_Sen_1D = (highest_1D_tenkan + lowest_1D_tenkan) / 2;
def Kijun_Sen_1D = (highest_1D_kijun + lowest_1D_kijun) / 2;

def tk_1D = Tenkan_Sen_1D[kijunPeriod];
def kj_1D = Kijun_Sen_1D[kijunPeriod];

def h2_1D = highest(high_1D[kijunPeriod], 2*kijunPeriod);
def l2_1D = lowest(low_1D[kijunPeriod], 2*kijunPeriod);

def Senkou_Span_A_1D = (tk_1D + kj_1D) / 2;
def Senkou_Span_B_1D = (h2_1D + l2_1D) / 2;

plot IchimokuSignal_1Day = if (isnaN(close),double.NaN, 1);
IchimokuSignal_1Day.SetPaintingStrategy(PaintingStrategy.POINTS);
IchimokuSignal_1Day.AssignValueColor( if (ShowDay and close_1D > Max(Senkou_Span_A_1D, Senkou_Span_B_1D)) then Color.GREEN else if (ShowDay and close_1D < Min(Senkou_Span_A_1D, Senkou_Span_B_1D)) then Color.RED else Color.Yellow);
IchimokuSignal_1Day.SetLineWeight(5);
IchimokuSignal_1Day.SetHiding(ShowDay==no);
 

Invesqua

New member
Ask and you shall receive.... Here is an indicator that plots 4 time frames on the bottom.

declare lower;

input Start = aggreGationPeriod.TEN_MIN;
input Short = aggreGationPeriod.fifTEEN_MIN;
input Medium = aggreGationPeriod.thirtY_MIN;
input Long = aggreGationPeriod.HOUR;

input tenkanPeriod = 9;
input kijunPeriod = 26;
input ShowStart = yes;
input Show10Minutes = yes;
input ShowHour = yes;
input ShowDay = yes;

script LookForward
{
input series = close;
input period = 26;


def lk = fold i = 0 to period with h=0 do if h == 0 and GetValue(series, -i) == yes then i else h;

plot lookforward = lk;
}

script CalculateHighest
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input length = 10;



def _highest = if new_bar then fold i1 = 0 to bartocheck with h=0 do if GetValue(barnumber, i1) >= barnumber - length + 1 then Max(h, GetValue(price, i1)) else h else _highest[1];

plot highest = _highest;
}

script CalculateLowest
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input length = 10;


def _lowest = if new_bar then fold i2 = 0 to bartocheck with l=99999999 do if GetValue(barnumber, i2) >= barnumber - length + 1 and GetValue(price, i2) > 0 then Min(l, GetValue(price, i2)) else l else _lowest[1];

plot lowest = _lowest;
}

script CalculateHighest2
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input frombar = 0;
input tobar = 10;



def _highest = if new_bar then fold i1 = 0 to bartocheck with h=0 do if GetValue(barnumber, i1) <= barnumber - frombar and GetValue(barnumber, i1) >= barnumber - tobar then Max(h, GetValue(price, i1)) else h else _highest[1];

plot highest = _highest;
}

script CalculateLowest2
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input frombar = 0;
input tobar = 10;


def _lowest = if new_bar then fold i2 = 0 to bartocheck with l=99999999 do if GetValue(barnumber, i2) <= barnumber - frombar and GetValue(barnumber, i2) >= barnumber - tobar and GetValue(price, i2) > 0 then Min(l, GetValue(price, i2)) else l else _lowest[1];

plot lowest = _lowest;
}

script LookBack
{
input new_bar = yes;
input baseperiod = 1;
input bartocheck = 9;
input price = 0;
input barnumber = 10;
input length = 10;



def _value = if new_bar then fold i1 = 0 to bartocheck with h=0 do if GetValue(barnumber, i1) == barnumber - length then GetValue(price, i1) else h else _value[1];

plot value = _value;
}



def barNum = CompoundValue(1, barNum[1] + 1, 1);


#Start
def high_start = high(period = start);
def low_start = low(period = start);
def close_start = close(period = start);

def highest_start_tenkan = Highest(high_start, tenkanPeriod );

def lowest_start_tenkan = Lowest(low_start, tenkanPeriod );

def highest_start_kijun = Highest(high_start, kijunPeriod );

def lowest_start_kijun = Lowest(low_start, kijunPeriod );

def Tenkan_Sen_start = (highest_start_tenkan + lowest_start_tenkan) / 2;
def Kijun_Sen_start = (highest_start_kijun + lowest_start_kijun) / 2;

def tk_start = Tenkan_Sen_start[kijunPeriod];
def kj_start = Kijun_Sen_start[kijunPeriod];

def h2_start = highest(high_start[kijunPeriod], 2*kijunPeriod);
def l2_start = lowest(low_start[kijunPeriod], 2*kijunPeriod);

def Senkou_Span_A_start = (tk_start + kj_start) / 2;
def Senkou_Span_B_start = (h2_start + l2_start) / 2;

plot IchimokuSignal_start = if ( isnaN(close),double.NaN, 4);
IchimokuSignal_start.SetPaintingStrategy(PaintingStrategy.POINTS);
IchimokuSignal_start.AssignValueColor( if (Showstart and close_start > Max(Senkou_Span_A_start, Senkou_Span_B_start)) then Color.GREEN else if (Showstart and close_start < Min(Senkou_Span_A_start, Senkou_Span_B_start)) then Color.RED else Color.Yellow);
IchimokuSignal_start.SetLineWeight(2);
IchimokuSignal_start.SetHiding(Showstart==no);


#10M
def high_10M = high(period = short);
def low_10M = low(period = short);
def close_10M = close(period = short);

def highest_10M_tenkan = Highest(high_10M, tenkanPeriod );

def lowest_10M_tenkan = Lowest(low_10M, tenkanPeriod );

def highest_10M_kijun = Highest(high_10M, kijunPeriod );

def lowest_10M_kijun = Lowest(low_10M, kijunPeriod );

def Tenkan_Sen_10M = (highest_10M_tenkan + lowest_10M_tenkan) / 2;
def Kijun_Sen_10M = (highest_10M_kijun + lowest_10M_kijun) / 2;

def tk_10M = Tenkan_Sen_10M[kijunPeriod];
def kj_10M = Kijun_Sen_10M[kijunPeriod];

def h2_10M = highest(high_10M[kijunPeriod], 2*kijunPeriod);
def l2_10M = lowest(low_10M[kijunPeriod], 2*kijunPeriod);

def Senkou_Span_A_10M = (tk_10M + kj_10M) / 2;
def Senkou_Span_B_10M = (h2_10M + l2_10M) / 2;

plot IchimokuSignal_10M = if ( isnaN(close),double.NaN, 3);
IchimokuSignal_10M.SetPaintingStrategy(PaintingStrategy.POINTS);
IchimokuSignal_10M.AssignValueColor( if (Show10Minutes and close_10M > Max(Senkou_Span_A_10M, Senkou_Span_B_10M)) then Color.GREEN else if (Show10Minutes and close_10M < Min(Senkou_Span_A_10M, Senkou_Span_B_10M)) then Color.RED else Color.Yellow);
IchimokuSignal_10M.SetLineWeight(2);
IchimokuSignal_10M.SetHiding(Show10Minutes==no);

#1H
def high_1H = high(period = medium);
def low_1H = low(period = medium);
def close_1H = close(period = medium);

def highest_1H_tenkan = Highest(high_1H, tenkanPeriod );

def lowest_1H_tenkan = Lowest(low_1H, tenkanPeriod );

def highest_1H_kijun = Highest(high_1H, kijunPeriod );

def lowest_1H_kijun = Lowest(low_1H, kijunPeriod );

def Tenkan_Sen_1H = (highest_1H_tenkan + lowest_1H_tenkan) / 2;
def Kijun_Sen_1H = (highest_1H_kijun + lowest_1H_kijun) / 2;

def tk_1H = Tenkan_Sen_1H[kijunPeriod];
def kj_1H = Kijun_Sen_1H[kijunPeriod];

def h2_1H = highest(high_1H[kijunPeriod], 2*kijunPeriod);
def l2_1H = lowest(low_1H[kijunPeriod], 2*kijunPeriod);

def Senkou_Span_A_1H = (tk_1H + kj_1H) / 2;
def Senkou_Span_B_1H = (h2_1H + l2_1H) / 2;

plot IchimokuSignal_1H = if (isnaN(close),double.NaN, 2);
IchimokuSignal_1H.SetPaintingStrategy(PaintingStrategy.POINTS);
IchimokuSignal_1H.AssignValueColor( if (ShowDay and close_1H > Max(Senkou_Span_A_1H, Senkou_Span_B_1H)) then Color.GREEN else if (ShowDay and close_1H < Min(Senkou_Span_A_1H, Senkou_Span_B_1H)) then Color.RED else Color.Yellow);
IchimokuSignal_1H.SetLineWeight(5);
IchimokuSignal_1H.SetHiding(ShowHour==no);

#1D
def high_1D = high(period = long);
def low_1D = low(period = long);
def close_1D = close(period = long);

def highest_1D_tenkan = Highest(high_1D, tenkanPeriod );

def lowest_1D_tenkan = Lowest(low_1D, tenkanPeriod );

def highest_1D_kijun = Highest(high_1D, kijunPeriod );

def lowest_1D_kijun = Lowest(low_1D, kijunPeriod );

def Tenkan_Sen_1D = (highest_1D_tenkan + lowest_1D_tenkan) / 2;
def Kijun_Sen_1D = (highest_1D_kijun + lowest_1D_kijun) / 2;

def tk_1D = Tenkan_Sen_1D[kijunPeriod];
def kj_1D = Kijun_Sen_1D[kijunPeriod];

def h2_1D = highest(high_1D[kijunPeriod], 2*kijunPeriod);
def l2_1D = lowest(low_1D[kijunPeriod], 2*kijunPeriod);

def Senkou_Span_A_1D = (tk_1D + kj_1D) / 2;
def Senkou_Span_B_1D = (h2_1D + l2_1D) / 2;

plot IchimokuSignal_1Day = if (isnaN(close),double.NaN, 1);
IchimokuSignal_1Day.SetPaintingStrategy(PaintingStrategy.POINTS);
IchimokuSignal_1Day.AssignValueColor( if (ShowDay and close_1D > Max(Senkou_Span_A_1D, Senkou_Span_B_1D)) then Color.GREEN else if (ShowDay and close_1D < Min(Senkou_Span_A_1D, Senkou_Span_B_1D)) then Color.RED else Color.Yellow);
IchimokuSignal_1Day.SetLineWeight(5);
IchimokuSignal_1Day.SetHiding(ShowDay==no);
Thank you very much! This is very good!


Question: What coding needs to be added or modificaitons such that I can view all indicator's plots across any chosen chart timeframe.

For example, let's say I have selected the 1 hr chart time frame. I would like to see the indicator "Dots" for all of the selected timeframes (5 min, 10 min, 1 hr, 1 day). As it stands right now, the indicator only plots when the selected timeframe for the chart is less than the smallest chosen timeframe in the indicator. I think this is related to the AggregationPeriod function, but not adept enough at the coding to solve this yet.
 

Similar threads

Top