TFC Time Frame Continuity Script

racng69

New member
Hello All, i am looking for a TFC script similar to the AshfordTrader found on twitter that will assist with staying in a trade longer. I believe the dots in the below screenshot represent TFC 15/30/60. Does this script exist or did someone create it? I'm referring to the ones in the lower study.

unknown.png
unknown (1).png
 
Last edited by a moderator:
Solution
Solution
I modified halcyonguy work on https://usethinkscript.com/threads/simple-tfc-time-frame-continuity-study.16420/post-144641 as follows:

Code:
#mtf_grn_red
#https://usethinkscript.com/threads/simple-tfc-time-frame-continuity-study.16420/
#Simple TFC (Time Frame Continuity) Study
#
#
# 2025-11-26 modified by vollermist for MTF and visual rework to dashboard format.

declare lower;

def na = double.nan;
#def bn = barnumber();
DefineGlobalColor("up", Color.GREEN);
DefineGlobalColor("down", Color.RED);
DefineGlobalColor("neutral", Color.YELLOW);

# chart-level aggregation
def o = open;
def c = close;
def red = o > c;
def green = o < c;
def dir = if o < c then 1 else if o > c then -1 else 0;

plot dots = if !isnan(close) then 1 else na;
dots.SetPaintingStrategy(PaintingStrategy.POINTS);
dots.AssignValueColor(if dir > 0 then GlobalColor("up") else if dir < 0 then GlobalColor("down") else GlobalColor("neutral"));
dots.setlineweight(2);
dots.hidebubble();

# htf1 aggregation
input tf1 = AggregationPeriod.HOUR;
def o1 = open(period = tf1);
def c1 = close(period = tf1);
def red1 = o1 > c1;
def green1 = o1 < c1;
def dir1 = if o1 < c1 then 1 else if o1 > c1 then -1 else 0;

plot dots1 = if !isnan(close) then 2 else na;
dots1.SetPaintingStrategy(PaintingStrategy.SQUARES);
dots1.AssignValueColor(if dir1 > 0 then GlobalColor("up") else if dir1 < 0 then GlobalColor("down") else GlobalColor("neutral"));
dots1.setlineweight(5);
dots1.hidebubble();


# htf2 aggregation
input tf2 = AggregationPeriod.DAY;
def o2 = open(period = tf2);
def c2 = close(period = tf2);
def red2 = o2 > c2;
def green2 = o2 < c2;
def dir2 = if o2 < c2 then 2 else if o2 > c2 then -2 else 0;

plot dots2 = if !isnan(close) then 3 else na;
dots2.SetPaintingStrategy(PaintingStrategy.SQUARES);
dots2.AssignValueColor(if dir2 > 0 then GlobalColor("up") else if dir2 < 0 then GlobalColor("down") else GlobalColor("neutral"));
dots2.setlineweight(5);
dots2.hidebubble();


# htf3 aggregation
input tf3 = AggregationPeriod.WEEK;
def o3 = open(period = tf3);
def c3 = close(period = tf3);
def red3 = o3 > c3;
def green3 = o3 < c3;
def dir3 = if o3 < c3 then 3 else if o3 > c3 then -3 else 0;

plot dots3 = if !isnan(close) then 4 else na;
dots3.SetPaintingStrategy(PaintingStrategy.SQUARES);
dots3.AssignValueColor(if dir3 > 0 then GlobalColor("up") else if dir3 < 0 then GlobalColor("down") else GlobalColor("neutral"));
dots3.setlineweight(5);
dots3.hidebubble();


# htf4 aggregation
input tf4 = AggregationPeriod.MONTH;
def o4 = open(period = tf4);
def c4 = close(period = tf4);
def red4 = o4 > c4;
def green4 = o4 < c4;
def dir4 = if o4 < c4 then 4 else if o4 > c4 then -4 else 0;

plot dots4 = if !isnan(close) then 5 else na;
dots4.SetPaintingStrategy(PaintingStrategy.SQUARES);
dots4.AssignValueColor(if dir4 > 0 then GlobalColor("up") else if dir4 < 0 then GlobalColor("down") else GlobalColor("neutral"));
dots4.setlineweight(5);
dots4.hidebubble();
#
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
852 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

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.

How do I get started?

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.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top