Auto Fibonacci Time Series
A few years ago, Messy Jesse, a TOS employee appeared on the Mr. Script show at that time and provided as part of his fibonacci retracement code to which Mobius added some fibonacci timeseries code. http://tos.mx/zePls0G
I have hopefully modifed the timeseries portion to include your idea. The modification will find the higher or lower barnumber occurrence of the premarket high or low and use that as the starting point for plotting the timeseries.
The only comparison I used was the TOS timeseries drawing tool. It seems to draw a starting point where the lower barnumber of the high or low is clicked, which might mean to use the lower barnumber occurrence of the premarket high or low. I have included an option so you can choose either higher or lower as a starting point, with the lower defaulted.
In the chart below is the vertical lines created by the code below and 2 different timeseries drawn from left to right or right to left with the lower premarket chosen and all appear to provide similar results
A few years ago, Messy Jesse, a TOS employee appeared on the Mr. Script show at that time and provided as part of his fibonacci retracement code to which Mobius added some fibonacci timeseries code. http://tos.mx/zePls0G
I have hopefully modifed the timeseries portion to include your idea. The modification will find the higher or lower barnumber occurrence of the premarket high or low and use that as the starting point for plotting the timeseries.
The only comparison I used was the TOS timeseries drawing tool. It seems to draw a starting point where the lower barnumber of the high or low is clicked, which might mean to use the lower barnumber occurrence of the premarket high or low. I have included an option so you can choose either higher or lower as a starting point, with the lower defaulted.
In the chart below is the vertical lines created by the code below and 2 different timeseries drawn from left to right or right to left with the lower premarket chosen and all appear to provide similar results
Ruby:# Time Series provided by Mobius # Modified to start with the higher barnumber associated with premarket high or premarket low def barnumber = BarNumber(); def premarket = SecondsFromTime(0400) >= 0 and SecondsTillTime(0930) > 0; def prehigh = if premarket[1] == 0 and premarket then high else if premarket then Max(high, prehigh[1]) else 0; def prelow = if premarket[1] == 0 and premarket then low else if premarket then Min(low, prelow[1]) else 0; def highnumber = if high == prehigh then BarNumber() else Double.NaN; def lownumber = if low == prelow then BarNumber() else Double.NaN; # Fibonacci Time Series input starting_point = {default lower, higher}; def start = if starting_point == starting_point.higher then Max(HighestAll(highnumber), HighestAll(lownumber)) else Min(HighestAll(highnumber), HighestAll(lownumber)); rec bar1 = if start == BarNumber() then BarNumber() else bar1[1]; rec bars = if BarNumber()[1] == bar1[1] then 2 else if barnumber[1] > bar1[1] then bars[1] + 1 else 0; def coeff = Sqrt(5); def smallest = 5; def n = Floor(Log(bars * coeff + 0.5) / Log((1 + Sqrt(5)) / 2)); def inSeries = n != n[1] and bars >= smallest; def Series = if inSeries then bars else Double.NaN; AddVerticalLine(GetDay() == GetLastDay() and Series, "FTS: ( " + Series + ")", Color.CYAN, Curve.FIRM); input debug = no; AddLabel(debug, HighestAll(highnumber) + " " + HighestAll(lownumber) + " " + bar1, Color.WHITE); plot x = if debug then barnumber else Double.NaN; x.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW); #
Last edited by a moderator: