Repaints ATR Fib Levels For ThinkOrSwim

Repaints

eagle_ai

Member
Author states:
ATR Fib Levels are based on the previous days ATR and the current days opening tick.
It takes that info and uses Fibonacci to automatically draw key levels for the day.
I have added the BULL BAR ( Green bar ) and Bear Bar ( Red Bar ) to signal as a Go Long / Go Short line in the sand.
The Tan bars are also proven key "Take Profit" levels.
These are, on average, major points of reversals, dip buys or consolidation.

I use this on the 5min timeframe and a close above or below a key level is my signal and direction. Auto Levels have proven to be a great indicator of major support and resistance.

HOW I USE THIS INDICATOR

I use the 5m timeframe and generally wait to trade after the 3rd tick closes for direction.
If I get a 5min candle closing ABOVE the green "Bull Bar" I go long. If it closes BELOW the Red Bear Bar, I go short.
I do not trade in the area below the green and red bars. That is a chop zone. It has to leave that zone to count as a tradeable move. ( of course if I get a solid rejection at the bull or bear bar Ill scalp the reversal inside the chop zone )

The tan filled bars are, on average, Take Profit zones. These are likely points of contention, consolidation or areas most will close longs or shorts. You can see accumulation around these bars as buyers and sellers fight to see what the next direction is.

n00HKHw.png

Original Tradingview code
https://www.tradingview.com/script/LlrDgKpB-AutoLevels/

Must scroll down to the next post to get the new ThinkOrSwim code
 
Last edited by a moderator:

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

check the below:

CSS:
#// Indicator for TOS
#// © steven_eth
#indicator('ATR FibLevels', overlay=true,explicit_plot_zorder = true)
# Converted by sam4Cok@Samer800    - 11/2024

input atrLength = 14; #, minval=1, title='ATR Length')
input Timeframe = AggregationPeriod.DAY; #(title='Timeframe', defval='D')
input mult1 = 0.236;
input mult2 = 0.382;
input mult3 = 0.618;
input mult5 = 1.0;

def na = Double.NaN;
def last = isNaN(close);
def current = GetAggregationPeriod();
def tf = Max(current, timeframe);
def tr = TrueRange(high(period = tf), close(Period = tf), low(Period = tf));
def atr = WildersAverage(tr, atrLength);

def current_day_open = open(Period = tf);
def atr_value_at_current_day_open = atr[1];

def u_mult1 = current_day_open + atr_value_at_current_day_open / 2 * mult1;
def u_mult2 = current_day_open + atr_value_at_current_day_open / 2 * mult2;
def u_mult3 = current_day_open + atr_value_at_current_day_open / 2 * mult3;
def u_mult4 = current_day_open + atr_value_at_current_day_open / 2 * mult5;
def l_mult1 = current_day_open - atr_value_at_current_day_open / 2 * mult1;
def l_mult2 = current_day_open - atr_value_at_current_day_open / 2 * mult2;
def l_mult3 = current_day_open - atr_value_at_current_day_open / 2 * mult3;
def l_mult4 = current_day_open - atr_value_at_current_day_open / 2 * mult5;

plot line1 = if last[10] then na else u_mult1;
plot line2 = if last[10] then na else u_mult2;
plot line3 = if last[10] then na else u_mult3;
plot line4 = if last[10] then na else u_mult4;
plot line5 = if last[10] then na else l_mult1;
plot line6 = if last[10] then na else l_mult2;
plot line7 = if last[10] then na else l_mult3;
plot line8 = if last[10] then na else l_mult4;

line1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line6.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line7.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line8.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
line1.SetDefaultColor(CreateColor(76, 175, 79));
line2.SetDefaultColor(CreateColor(76, 175, 79));
line3.SetDefaultColor(CreateColor(175, 147, 76));
line4.SetDefaultColor(CreateColor(175, 147, 76));
line5.SetDefaultColor(CreateColor(221, 48, 48));
line6.SetDefaultColor(CreateColor(221, 48, 48));
line7.SetDefaultColor(CreateColor(175, 147, 76));
line8.SetDefaultColor(CreateColor(175, 147, 76));

#-- END of CODE
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
244 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