fib lines stay based off the previous close, not current day

Fox

New member
Hi guys, is there a way to use the auto fib
https://usethinkscript.com/threads/auto-fib-fibonacci-levels-indicator-for-thinkorswim.14/#post-9719
but limit its movement until the close of the day? For example, at the end of the day, it calculates the retracements I want for the next day, but as soon as market opens the lines move (obviously) as price moves. My goal is to have the lines stay based off the previous close, not current day movement. I’ve tried tinkering with aggregate periods, but that doesn’t work.
 
Solution
Hi guys, is there a way to use the auto fib
https://usethinkscript.com/threads/auto-fib-fibonacci-levels-indicator-for-thinkorswim.14/#post-9719
but limit its movement until the close of the day? For example, at the end of the day, it calculates the retracements I want for the next day, but as soon as market opens the lines move (obviously) as price moves. My goal is to have the lines stay based off the previous close, not current day movement. I’ve tried tinkering with aggregate periods, but that doesn’t work.

This should help

Ruby:
#Auto_FibPrevDay - plots high/low from previous day and fib levels based thereon

input ShowTodayOnly = yes;
input showbubbles   = yes;
input bubblemover   = 4; #Hint n: Number of Bars to...
Hi guys, is there a way to use the auto fib
https://usethinkscript.com/threads/auto-fib-fibonacci-levels-indicator-for-thinkorswim.14/#post-9719
but limit its movement until the close of the day? For example, at the end of the day, it calculates the retracements I want for the next day, but as soon as market opens the lines move (obviously) as price moves. My goal is to have the lines stay based off the previous close, not current day movement. I’ve tried tinkering with aggregate periods, but that doesn’t work.

This should help

Ruby:
#Auto_FibPrevDay - plots high/low from previous day and fib levels based thereon

input ShowTodayOnly = yes;
input showbubbles   = yes;
input bubblemover   = 4; #Hint n: Number of Bars to shift bubble to the right
input period        = AggregationPeriod.DAY;
input displace      = 1;

plot ORH = if showtodayonly and !IsNaN(close(period = period)[-1]) then double.nan else high(period = period)[displace];
plot ORL = if showtodayonly and !IsNaN(close(period = period)[-1]) then double.nan else  low(period = period)[displace];

ORH.SetDefaultColor(Color.RED);
ORH.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ORH.SetLineWeight(2);

ORL.SetDefaultColor(Color.GREEN);
ORL.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
ORL.SetLineWeight(2);

input F1 = -1.00;
input F2 = -0.62;
input F3 = -0.27;
input F4 = 0.236;
input F5 = 0.382;
input F6 = 0.500;
input F7 = 0.618;
input F8 = 0.764;
input F10 = 1.27;
input F11 = 1.618;
input F12 = 2.00;

def rHi =  ORH;
def rLo =  ORL;

def range  = rHi - rLo;
plot FF1   = rLo + (range * F1);
plot FF2   = rLo + (range * F2);
plot FF3   = rLo + (range * F3);
plot FF4   = rLo + (range * F4);
plot FF5   = rLo + (range * F5);
plot FF6   = rLo + (range * F6);
plot FF7   = rLo + (range * F7);
plot FF8   = rLo + (range * F8);
plot FF10  = rLo + (range * F10);
plot FF11  = rLo + (range * F11);
plot FF12  = rLo + (range * F12);

def h = high(period = AggregationPeriod.DAY);
def l = low(period = AggregationPeriod.DAY);



FF1.SetDefaultColor(Color.GREEN);
FF1.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF1.SetLineWeight(1);

FF2.SetDefaultColor(Color.GREEN);
FF2.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF2.SetLineWeight(1);

FF3.SetDefaultColor(Color.GREEN);
FF3.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF3.SetLineWeight(1);

FF4.SetDefaultColor(Color.RED);
FF4.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF4.SetLineWeight(1);

FF5.SetDefaultColor(Color.RED);
FF5.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF5.SetLineWeight(1);

FF6.SetDefaultColor(Color.YELLOW);
FF6.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF6.SetLineWeight(1);

FF7.SetDefaultColor(Color.cyan);
FF7.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF7.SetLineWeight(1);

FF8.SetDefaultColor(Color.cyan);
FF8.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF8.SetLineWeight(1);


FF10.SetDefaultColor(Color.GREEN);
FF10.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF10.SetLineWeight(1);

FF11.SetDefaultColor(Color.GREEN);
FF11.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF11.SetLineWeight(1);

FF12.SetDefaultColor(Color.GREEN);
FF12.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
FF12.SetLineWeight(1);

def   b           = bubblemover;
def   b1          = b + 1;
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF1[b], F1, FF1.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF2[b], F2, FF2.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF3[b], F3, FF3.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF4[b], F4, FF4.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF5[b], F5, FF5.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF6[b], F6, FF6.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF7[b], F7, FF7.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF8[b], F8, FF8.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF10[b], F10, FF10.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF11[b], F11, FF11.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), FF12[b], F12, FF12.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), orh[b], 1, orh.Takevaluecolor());
AddChartBubble(IsNaN(close[b]) and !IsNaN(close[b1]), orl[b], 0, orl.Takevaluecolor());
 
Solution

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

Hey Sleepy, thanks for the quick response! You’re amazing. Does this still adhere to the auto fib where it will draw the high/low or low/high retracement based off up or down trend? I only ask because it states autofib prev day high/low (but that’s it).
 
Hey Sleepy, thanks for the quick response! You’re amazing. Does this still adhere to the auto fib where it will draw the high/low or low/high retracement based off up or down trend? I only ask because it states autofib prev day high/low (but that’s it).

This one is set to have low always 0 and high always 1.
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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