I would love some help coding labels showing what color candle current candle have on each timeframes. Would love to have the option to turn some of the timeframes off as well.
5m, 15m, 1h, 4,h, daily, weekly, something like this below:
hal_agg![]()
input agg1 = AggregationPeriod.five_min;
input agg2 = AggregationPeriod.fifteen_min;
input agg3 = AggregationPeriod.Hour;
input agg4 = AggregationPeriod.four_Hours;
input agg5 = AggregationPeriod.day;
input agg6 = AggregationPeriod.week;
input agg7 = AggregationPeriod.month;
def agg1grn = (close(period =...
I would love some help coding labels showing what color candle current candle have on each timeframes. Would love to have the option to turn some of the timeframes off as well.
5m, 15m, 1h, 4,h, daily, weekly, something like this below:
hal_agg![]()
input agg1 = AggregationPeriod.five_min;
input agg2 = AggregationPeriod.fifteen_min;
input agg3 = AggregationPeriod.Hour;
input agg4 = AggregationPeriod.four_Hours;
input agg5 = AggregationPeriod.day;
input agg6 = AggregationPeriod.week;
input agg7 = AggregationPeriod.month;
def agg1grn = (close(period = agg1) > open(period = agg1));
def agg2grn = (close(period = agg2) > open(period = agg2));
def agg3grn = (close(period = agg3) > open(period = agg3));
def agg4grn = (close(period = agg4) > open(period = agg4));
def agg5grn = (close(period = agg5) > open(period = agg5));
def agg6grn = (close(period = agg6) > open(period = agg6));
def x = 1;
addlabel(x, " ", color.black);
addlabel(x, "5m", (if agg1grn then color.green else color.red));
addlabel(x, "15m", (if agg2grn then color.green else color.red));
addlabel(x, "Hr", (if agg3grn then color.green else color.red));
addlabel(x, "4Hr", (if agg4grn then color.green else color.red));
addlabel(x, "D", (if agg5grn then color.green else color.red));
addlabel(x, "W", (if agg6grn then color.green else color.red));
addlabel(x, " ", color.black);
#
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Awesome!! Thanks. Will try it out later todayi just typed this up on my cell, i think it will work.
Code:input agg1 = AggregationPeriod.five_min; input agg2 = AggregationPeriod.fifteen_min; input agg3 = AggregationPeriod.Hour; input agg4 = AggregationPeriod.four_Hour; input agg5 = AggregationPeriod.day; input agg6 = AggregationPeriod.week; input agg7 = AggregationPeriod.month; def x = 1; addlabel(x, "5m", (if close(period = agg1) > open(period = agg1) then color.green else color.red); addlabel(x, "15m", (if close(period = agg2) > open(period = agg1) then color.green else color.red); addlabel(x, "Hr", (if close(period = agg3) > open(period = agg1) then color.green else color.red); addlabel(x, "4Hr", (if close(period = agg4) > open(period = agg1) then color.green else color.red); addlabel(x, "D", (if close(period = agg5) > open(period = agg1) then color.green else color.red); addlabel(x, "W", (if close(period = agg6) > open(period = agg1) then color.green else color.red);
fixed my code today, sorry for typosI would love some help coding labels showing what color candle current candle have on each timeframes. Would love to have the option to turn some of the timeframes off as well.
5m, 15m, 1h, 4,h, daily, weekly, something like this below:
thanks! will this show current candle color? or close of last candle color?fixed my code today, sorry for typos
those are the same thing.thanks! will this show current candle color? or close of last candle color?
so if current 1h candle is red and 30 min into the candle, label will show red?those are the same thing.
it reads close prices from the current candle, in different times
Yes, as previously stated, MTF indicators will provide repainting triggers until the higher timeframe closes.so if current 1h candle is red and 30 min into the candle, label will show red?
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
J | Change Candle color based on its Volume | Questions | 4 | |
J | I need help scripting color Zero Line above/below candle | Questions | 4 | |
K | SPY candle color based on "reverse VIX" (-VIX) DMI | Questions | 2 | |
A | Candle color change | Questions | 2 | |
A | Single Candle color help | Questions | 2 |
Start a new thread and receive assistance from our community.
useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.
We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.
If you are new, or just looking for guidance, here are some helpful links to get you started.