• LIMITED TIME OFFER: use coupon code PRIMEDAY (case sensitive) at checkout to save $50 off VIP membership (down to $149 / year). Valid through Tuesday 6/22. Biggest discount this year!

Number of timeframe show on the upper left of the indicator window?

rad14733

Well-known member
VIP
@kryptoniken Are you talking about something similar to the 1Y 1D or 5D 3M timeframe information already displayed at the top of every chart but as chart labels...??? If so, why would you want to use valuable resources computing and redisplaying redundant information...???
 

OBW

Member
I use this on my charts.

Ruby:
# Display Chart Time Frame
# Robert Payne
# FunWithThinkscript
declare once_per_bar;
input theme = {default light, dark};
def r;
def g;
def b;
if theme == theme.dark
then {
    r = 10;
    g = 80;
    b = 200;
} else {
    r = 137;
    g = 207;
    b = 240;
}
def nMinutes = GetAggregationPeriod() / 60000;
def Monthly = nMinutes == 43200;
def Weekly = nMinutes == 10080;
def Daily = nMinutes == 1440;
def Intraday = nMinutes < 1440 and nMinutes >= 1;
def tick = nMinutes < 1;

DefineGlobalColor("time", CreateColor(r, g, b));
AddLabel(yes, GetSymbol(), GlobalColor("time" ));
AddLabel(Monthly, "Monthly", GlobalColor("time" ));
AddLabel(Weekly, "Weekly", GlobalColor("time" ));
AddLabel(Daily, "Daily", GlobalColor("time" ));
AddLabel(Intraday, nMinutes + " Minute", GlobalColor("time" ));
AddLabel(tick, GetAggregationPeriod() + " tick", GlobalColor("time"));
 

Similar threads

Top