Thank you. I will see what I can do. I appreciate it
@Beauteallover were you able to make a column version?
i saw sleepyz posted a chart study, so i waited to see if it worked for you.
i made this watchlist column study version of
@SleepyZ study in post25 (thanks for posting it)
'include extended hours' needs to be checked
zhilotime0b
http://tos.mx/N8zQEhO
this version shows the time and the price
since this is a column study, you can't change inputs. you have to change the code.
for 2 variables, there are 2 versions of the code line.
enable one of them and
disable the other one. ( by putting a # in front of the line)
these code lines are near the beginning of the study.
#---------------------------------
# change which line is enabled, to show the price
input showprice_in_bubble = yes;
#input showprice_in_bubble = no;
#---------------------------------
#---------------------------------
# enable 1 of these lines , first for time, 2nd for bars back . notice the placement of 'default'
#
input display = { default time , bars_back };
#input display = { time , default bars_back };
#---------------------------------
color of the font is based on which is the most recent, hod or lod.
if the high price is most recent then the cell is green, if low price is most recent then red.
i put H or L as the first character, for sorting like items together.
it uses 4 labels, and enables 1 at a time, depending on the data.
column study
Ruby:
# zhilotime0b
# mod chart study for a column
# bars back since hi/lo
# https://usethinkscript.com/threads/how-do-you-get-the-time-of-high-of-day.3751/page-2#post-97451
# SleepyZ
#---------------------------------
# change which line is enabled, to show the price
input showprice_in_bubble = yes;
#input showprice_in_bubble = no;
#---------------------------------
#---------------------------------
# enable 1 of these lines , first for time, 2nd for bars back
#
input display = { default time , bars_back };
#input display = { time , default bars_back };
#---------------------------------
def d;
switch (display) {
case time:
d = 1;
case bars_back:
d = 2;
}
def bn = barnumber();
#Time Defined
input timezone = {default "ET", "CT", "MT", "PT"};
def starthour = (if timezone == timezone."ET"
then 9
else if timezone == timezone."CT"
then 8
else if timezone == timezone."MT"
then 7
else 6) ;
def hour = Floor(((starthour * 60 + 30) + (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 60000) / 60);
def minutes = (GetTime() - RegularTradingStart(GetYYYYMMDD())) / 60000 - ((hour - starthour) * 60 + 30) + 60;
#Highest High during RTH
def dayhi = CompoundValue(1, if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())
then high
else if high > dayhi[1]
then high
else dayhi[1]
, dayhi[1]);
def dayhibn = if GetDay() == GetLastDay()
then if high == dayhi
then BarNumber()
else dayhibn[1]
else 0;
def highday = if BarNumber() == HighestAll(dayhibn)
then high
else highday[1];
def hihr = if high == highday then hour else hihr[1];
def himin = if high == highday then minutes else himin[1];
def hibarsago = bn - dayhibn;
# AddLabel(showlabel,
# "H: " +
# (hihr + ":") +
# (if himin < 10
# then "0" + himin
# else "" + himin) +
# " | " +
# Asdollars(highday), Color.WHITE);
#addlabel(1, hibarsago, Color.magenta);
#AddChartBubble(showbubbles and high == highday, high,
# "H: "+
# (hihr + ":") +
# (if himin < 10
# then "0" + himin
# else "" + himin) +
# "\n" +
# (if showprice_in_bubble then Asdollars(highday) else ""), Color.WHITE);
#addlabel(1, " ", Color.black);
#Lowest Low During RTH
def daylo = CompoundValue(1, if GetTime() crosses above RegularTradingStart(GetYYYYMMDD())
then low
else if low < daylo[1]
then low
else daylo[1],
low);
def daylobn = if GetDay() == GetLastDay()
then if low == daylo
then BarNumber()
else daylobn[1]
else 0;
def lowday = if BarNumber() == HighestAll(daylobn)
then low
else lowday[1];
def lowhr = if low == lowday then hour else lowhr[1];
def lowmin = if low == lowday then minutes else lowmin[1];
def lobarsago = bn - daylobn;
#AddLabel(showlabel,
# "L: " +
# (lowhr + ":") +
# (if lowmin < 10
# then "0" + lowmin
# else "" + lowmin ) +
# " | " + Asdollars(lowday) , Color.YELLOW);
#addlabel(1, lobarsago, Color.magenta);
#AddChartBubble(showbubbles and low == lowday, low,
# "L: " +
# (lowhr + ":") +
# (if lowmin < 10
# then "0" + lowmin
# else "" + lowmin) +
# "\n" +
# if showprice_in_bubble then Asdollars(lowday) else "", Color.yellow, no);
#
#
# ============================================
# ============================================
# is hi more recent than lo ?
def ishicloser = (hibarsago < lobarsago);
# ///////////////////////////////////////
AddLabel( ishicloser and d == 1,
# time of peak , hi 1st
( "H " + (hihr + ":") + (if himin < 10 then "0" + himin else "" + himin) +
" " + (if showprice_in_bubble then Asdollars(highday) else ""))
+ " | " +
"L " + (lowhr + ":") + (if lowmin < 10 then "0" + lowmin else "" + lowmin) +
" " + (if showprice_in_bubble then Asdollars(lowday) else "")
, (if ishicloser then Color.green else color.red) );
AddLabel( !ishicloser and d == 1,
# time of dip , lo 1st
( "L " + (lowhr + ":") + (if lowmin < 10 then "0" + lowmin else "" + lowmin) +
" " + (if showprice_in_bubble then Asdollars(lowday) else ""))
+ " | " +
"H " + (hihr + ":") + (if himin < 10 then "0" + himin else "" + himin) +
" " + (if showprice_in_bubble then Asdollars(highday) else "")
, (if ishicloser then Color.green else color.red) );
AddLabel( ishicloser and d == 2,
## bars since peak , hi 1st
( "H " + (if hibarsago < 10 then "0" else "") + hibarsago + " bars " +
(if showprice_in_bubble then Asdollars(highday) else "") +
" | " +
"L " + (if lobarsago < 10 then "0" else "") + lobarsago + " bars " +
(if showprice_in_bubble then Asdollars(lowday) else "") )
, (if ishicloser then Color.green else color.red));
AddLabel( !ishicloser and d == 2,
## bars since peak , lo 1st
( "L " + (if lobarsago < 10 then "0" else "") + lobarsago + " bars " +
(if showprice_in_bubble then Asdollars(lowday) else "") +
" | " +
"H " + (if hibarsago < 10 then "0" else "") + hibarsago + " bars " +
(if showprice_in_bubble then Asdollars(highday) else "") )
, (if ishicloser then Color.green else color.red));
#
#
show bars back and price
show time and price
show time and no price