Auto Fibonacci Sequence - Determined by Entering Time of Candle.

Stockitect

New member
VIP
Hello, loving the community here.

Wondering if I could get help making a study regarding a Fibonacci sequence on one candle/bar. Dictated by manually entering the time of the bar I want.
I looked here, https://usethinkscript.com/threads/everything-fibonacci.8101/ and some of these are close, but I am looking to be able to adjust it to one bar using a specific time. I noticed some bars while trading are larger (via dark pool print or whale investors) and I like to draw a full Fibonacci sequence up, and one to the downside. All on the same candle, and many times its the same candle everyday. Meaning its at the same time everyday. For example 8:30am or 3:30pm.

So with that in mind, is it possible to develop a Fibonacci sequence indicator for a specific time everyday. With one full set to the upside and one full set to the downside.
With the ability to change the time if needed. Meaning if I don't want a 5:30pm candle anymore, I can just type in the time I do want, like a 6:32am candle etc. And the Fib sequence will adjust accordingly to that new candle I picked and plot it everyday at that time.
It would need to work on the 1min chart.

I do this below manually everyday. So I was just trying to save a step.


1701142984105.png
 
Solution
Hello, loving the community here.

Wondering if I could get help making a study regarding a Fibonacci sequence on one candle/bar. Dictated by manually entering the time of the bar I want.
I looked here, https://usethinkscript.com/threads/everything-fibonacci.8101/ and some of these are close, but I am looking to be able to adjust it to one bar using a specific time. I noticed some bars while trading are larger (via dark pool print or whale investors) and I like to draw a full Fibonacci sequence up, and one to the downside. All on the same candle, and many times its the same candle everyday. Meaning its at the same time everyday. For example 8:30am or 3:30pm.

So with that in mind, is it possible to develop a Fibonacci sequence...
Hello, loving the community here.

Wondering if I could get help making a study regarding a Fibonacci sequence on one candle/bar. Dictated by manually entering the time of the bar I want.
I looked here, https://usethinkscript.com/threads/everything-fibonacci.8101/ and some of these are close, but I am looking to be able to adjust it to one bar using a specific time. I noticed some bars while trading are larger (via dark pool print or whale investors) and I like to draw a full Fibonacci sequence up, and one to the downside. All on the same candle, and many times its the same candle everyday. Meaning its at the same time everyday. For example 8:30am or 3:30pm.

So with that in mind, is it possible to develop a Fibonacci sequence indicator for a specific time everyday. With one full set to the upside and one full set to the downside.
With the ability to change the time if needed. Meaning if I don't want a 5:30pm candle anymore, I can just type in the time I do want, like a 6:32am candle etc. And the Fib sequence will adjust accordingly to that new candle I picked and plot it everyday at that time.
It would need to work on the 1min chart.

I do this below manually everyday. So I was just trying to save a step.


View attachment 20277

This should work for the time input for the current day (premarket and regular trading hours). You can change the fib levels and the movable bubbles will reflect the change.

Screenshot 2023-11-28 165203.png

Code:
#AutoFib_Start_Time_Current_Day

input start_time = 0930;
input label      = yes;
AddLabel(label, "Fib Start_time: " + AsPrice(start_time), Color.WHITE);

def start = if SecondsFromTime(start_time)[1] < 0 and SecondsFromTime(start_time) >= 0
            then 1 else 0;
def rhi   = if start == 1 then high else rhi[1];
def rlo   = if start == 1 then low else rlo[1];

input H1 = .382;
input H2 = .786;
input H1272 = 1.272;
input H1618 = 1.618;
input H200  = 2.0;
input H2272 = 2.272;
input H2618 = 2.618;
input H300  = 3.0;
input H3272 = 3.272;
input H3618 = 3.618;

input L1 = .382;
input L2 = .786;
input L1272 = .272;
input L1618 = .618;
input L200  = 2.0;
input L2272 = 2.272;
input L2618 = 2.618;
input L300  = 3.0;
input L3272 = 3.272;
input L3618 = 3.618;

plot Mid    = (rhi + rlo) / 2;
def range   = rhi - Mid;

plot P1   = Mid + (range * H1);
plot P2   = Mid + (range * H2);
plot P1272 = Mid + (range * H1272);
plot P1618 = Mid + (range * H1618);
plot P200 = Mid + (range * H200);
plot P2272 = Mid + (range * H2272);
plot P2618 = Mid + (range * H2618);
plot P300 = Mid + (range * H300);
plot P3272 = Mid + (range * H3272);
plot P3618 = Mid + (range * H3618);


plot N1   = Mid - (range * L1);
plot N2   = Mid - (range * L2);
plot N1272 = Mid - (range * H1272);
plot N1618 = Mid - (range * H1618);
plot N200 = Mid - (range * H200);
plot N2272 = Mid - (range * H2272);
plot N2618 = Mid - (range * H2618);
plot N300 = Mid - (range * H300);
plot N3272 = Mid - (range * H3272);
plot N3618 = Mid - (range * H3618);

plot ORH      = rhi;
plot ORL      = rlo;

ORH.SetDefaultColor(Color.MAGENTA);
ORH.SetPaintingStrategy(PaintingStrategy.DASHES);
ORH.SetLineWeight(4);

ORL.SetDefaultColor(Color.WHITE);
ORL.SetPaintingStrategy(PaintingStrategy.DASHES);
ORL.SetLineWeight(4);

Mid.SetDefaultColor(Color.MAGENTA);
Mid.SetPaintingStrategy(PaintingStrategy.DASHES);
Mid.SetLineWeight(2);

P1.SetDefaultColor(Color.WHITE);
P1.SetPaintingStrategy(PaintingStrategy.DASHES);
P1.SetLineWeight(4);

P2.SetDefaultColor(Color.WHITE);
P2.SetPaintingStrategy(PaintingStrategy.DASHES);
P2.SetLineWeight(4);

P1272.SetDefaultColor(Color.GREEN);
P1272.SetPaintingStrategy(PaintingStrategy.DASHES);
P1272.SetLineWeight(4);

P1618.SetDefaultColor(Color.GREEN);
P1618.SetPaintingStrategy(PaintingStrategy.DASHES);
P1618.SetLineWeight(4);

P200.SetDefaultColor(Color.GREEN);
P200.SetPaintingStrategy(PaintingStrategy.DASHES);
P200.SetLineWeight(2);

P2272.SetDefaultColor(Color.GREEN);
P2272.SetPaintingStrategy(PaintingStrategy.DASHES);
P2272.SetLineWeight(2);

P2618.SetDefaultColor(Color.MAGENTA);
P2618.SetPaintingStrategy(PaintingStrategy.DASHES);
P2618.SetLineWeight(2);

P300.SetDefaultColor(Color.MAGENTA);
P300.SetPaintingStrategy(PaintingStrategy.DASHES);
P300.SetLineWeight(2);

P3272.SetDefaultColor(Color.MAGENTA);
P3272.SetPaintingStrategy(PaintingStrategy.DASHES);
P3272.SetLineWeight(2);

P3618.SetDefaultColor(Color.MAGENTA);
P3618.SetPaintingStrategy(PaintingStrategy.DASHES);
P3618.SetLineWeight(2);


N1.SetDefaultColor(Color.WHITE);
N1.SetPaintingStrategy(PaintingStrategy.DASHES);
N1.SetLineWeight(4);

N2.SetDefaultColor(Color.WHITE);
N2.SetPaintingStrategy(PaintingStrategy.DASHES);
N2.SetLineWeight(4);

N1272.SetDefaultColor(Color.GREEN);
N1272.SetPaintingStrategy(PaintingStrategy.DASHES);
N1272.SetLineWeight(4);

N1618.SetDefaultColor(Color.GREEN);
N1618.SetPaintingStrategy(PaintingStrategy.DASHES);
N1618.SetLineWeight(4);

N200.SetDefaultColor(Color.GREEN);
N200.SetPaintingStrategy(PaintingStrategy.DASHES);
N200.SetLineWeight(2);

N2272.SetDefaultColor(Color.GREEN);
N2272.SetPaintingStrategy(PaintingStrategy.DASHES);
N2272.SetLineWeight(2);

N2618.SetDefaultColor(Color.MAGENTA);
N2618.SetPaintingStrategy(PaintingStrategy.DASHES);
N2618.SetLineWeight(2);

N300.SetDefaultColor(Color.MAGENTA);
N300.SetPaintingStrategy(PaintingStrategy.DASHES);
N300.SetLineWeight(2);

N3272.SetDefaultColor(Color.MAGENTA);
N3272.SetPaintingStrategy(PaintingStrategy.DASHES);
N3272.SetLineWeight(2);

N3618.SetDefaultColor(Color.MAGENTA);
N3618.SetPaintingStrategy(PaintingStrategy.DASHES);
N3618.SetLineWeight(2);

ORH.HideBubble();
ORL.HideBubble();
Mid.HideBubble();
P1.HideBubble();
P2.HideBubble();
P1272.HideBubble();
P1618.HideBubble();
P200.HideBubble();
P2272.HideBubble();
P2618.HideBubble();
P300.HideBubble();
P3272.HideBubble();
P3618.HideBubble();


N1.HideBubble();
N2.HideBubble();
N1272.HideBubble();
N1618.HideBubble();
N200.HideBubble();
N2272.HideBubble();
N2618.HideBubble();
N300.HideBubble();
N3272.HideBubble();
N3618.HideBubble();


input showbubbles = yes;

input bubblemover = 5;
def m  = bubblemover;
def m1 = m + 1;
def mover = showbubbles and IsNaN(close[m]) and !IsNaN(close[m1]);

AddChartBubble(mover, Mid[m1], "0%" + AsText(Mid[m1]), Mid.TakeValueColor());
AddChartBubble(mover, ORH[m1], "100% " + AsText(ORH[m1]), ORH.TakeValueColor());
AddChartBubble(mover, P1[m1], H1 * 100 + "%" + AsText(P1[m1]), P1.TakeValueColor());
AddChartBubble(mover, P2[m1], H2 * 100 + "% " + AsText(P2[m1]), P2.TakeValueColor());
AddChartBubble(mover, P1272[m1], H1272 * 100 + "% " + AsText(P1272[m1]), P1272.TakeValueColor());
AddChartBubble(mover, P1618[m1], H1618 * 100 + "% " + AsText(P1618[m1]), P1618.TakeValueColor());
AddChartBubble(mover, P200[m1], H200 * 100 + "% " + AsText(P200[m1]), P200.TakeValueColor());
AddChartBubble(mover, P2272[m1], H2272 * 100 + "% " + AsText(P2272[m1]), P2272.TakeValueColor());
AddChartBubble(mover, P2618[m1], H2618 * 100 + "% " + AsText(P2618[m1]), P2618.TakeValueColor());
AddChartBubble(mover, P300[m1], H300 * 100 + "% " + AsText(P300[m1]), P300.TakeValueColor());
AddChartBubble(mover, P3272[m1], H3272 * 100 + "% " + AsText(P3272[m1]), P3272.TakeValueColor());
AddChartBubble(mover, P3618[m1], H3618 * 100 + "% " + AsText(P3618[m1]), P3618.TakeValueColor());

AddChartBubble(mover, ORL[m1], "100% " + AsText(ORL[m1]), ORL.TakeValueColor());
AddChartBubble(mover, N1[m1], L1 * 100 + "%" + AsText(N1[m1]), N1.TakeValueColor());
AddChartBubble(mover, N2[m1], L2 * 100 + "% " + AsText(N2[m1]), N2.TakeValueColor());
AddChartBubble(mover, N1272[m1], L1272 * 100 + "% " + AsText(N1272[m1]), N1272.TakeValueColor());
AddChartBubble(mover, N1618[m1], L1618 * 100 + "% " + AsText(N1618[m1]), N1618.TakeValueColor());
AddChartBubble(mover, N200[m1], L200 * 100 + "% " + AsText(N200[m1]), N200.TakeValueColor());
AddChartBubble(mover, N2272[m1], L2272 * 100 + "% " + AsText(N2272[m1]), N2272.TakeValueColor());
AddChartBubble(mover, N2618[m1], L2618 * 100 + "% " + AsText(N2618[m1]), N2618.TakeValueColor());
AddChartBubble(mover, N300[m1], L300 * 100 + "% " + AsText(N300[m1]), N300.TakeValueColor());
AddChartBubble(mover, N3272[m1], L3272 * 100 + "% " + AsText(N3272[m1]), N3272.TakeValueColor());
AddChartBubble(mover, N3618[m1], L3618 * 100 + "% " + AsText(N3618[m1]), N3618.TakeValueColor());

#
 
Solution

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
493 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