#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());
#