Golden Zone Indicator

maximizeprofit

New member
VIP
Hello, I am interested and searching for this Fibonacci Retracement Indicator script. Any help is greatly appreciated.
Thank you.

@samer800 @halcyonguy @SleepyZ @Wiinii


Previous Day Close
To
Pre Market High

With Fibonacci retracement levels:= 78% - 88% (Golden Zone)
 

Attachments

  • 83286E84-E416-4ECC-8222-1BF30D905DD2.jpeg
    83286E84-E416-4ECC-8222-1BF30D905DD2.jpeg
    147 KB · Views: 579
  • 78047E41-14BB-44B0-AE0B-4DA2B45664AA.jpeg
    78047E41-14BB-44B0-AE0B-4DA2B45664AA.jpeg
    146.6 KB · Views: 579
Solution
Hello, I am interested and searching for this Fibonacci Retracement Indicator script. Any help is greatly appreciated.
Thank you.

@samer800 @halcyonguy @SleepyZ @Wiinii


Previous Day Close
To
Pre Market High

With Fibonacci retracement levels:= 78% - 88% (Golden Zone)
check this if can help.

CSS:
# GlobeX or Overnight High / Low with Fibonacci Values?

# Mobius?

# V01.2012?

input PlotOverNightExtremes = yes;

input coeff_1 = .236;

input coeff_2 = .327;

# gmh: added the rest of the Fibs?

input coeff_3 = .500;

input coeff_4 = .618;

input coeff_5 = .789;

input coeff_6 = .882;



def o = open;

def h = high;

def l = low;

def c = close;

def v = volume;

def bar = BarNumber();

def GlobeX =...
Hello, I am interested and searching for this Fibonacci Retracement Indicator script. Any help is greatly appreciated.
Thank you.

@samer800 @halcyonguy @SleepyZ @Wiinii


Previous Day Close
To
Pre Market High

With Fibonacci retracement levels:= 78% - 88% (Golden Zone)
check this if can help.

CSS:
# GlobeX or Overnight High / Low with Fibonacci Values?

# Mobius?

# V01.2012?

input PlotOverNightExtremes = yes;

input coeff_1 = .236;

input coeff_2 = .327;

# gmh: added the rest of the Fibs?

input coeff_3 = .500;

input coeff_4 = .618;

input coeff_5 = .789;

input coeff_6 = .882;



def o = open;

def h = high;

def l = low;

def c = close;

def v = volume;

def bar = BarNumber();

def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());

def vol = if GlobeX and !Globex[1]

          then v

          else if GlobeX

               then vol[1] + v

               else Double.NaN;

def GlobeX_Volume = vol;

def ONhigh = if GlobeX and !Globex[1]

             then h

             else if Globex and

                     h > ONhigh[1]

                     then h

                  else ONhigh[1];

def ONhighBar = if GlobeX and h == ONhigh

                then Bar

                else double.nan;

def ONlow = if GlobeX and !GlobeX[1]

            then l

            else if GlobeX and

                    l < ONlow[1]

            then l

                 else ONlow[1];

def ONlowBar = if GlobeX and l == ONlow

               then Bar

               else double.nan;

def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)

                    then ONhigh

                    else OverNightHigh[1];

def OverNightLow = if BarNumber() == HighestAll(ONlowBar)

                   then ONlow

                   else OverNightLow[1];

plot ONH = if OverNightHigh > 0

           then OverNightHigh

           else Double.NaN;

     ONH.SetHiding(!PlotOverNightExtremes);

     ONH.SetPaintingStrategy(PaintingStrategy.SQUARES);

     ONH.SetDefaultColor(Color.BLUE);

     ONH.HideBubble();

     ONH.HideTitle();

plot ONL = if OverNightLow > 0

           then OverNightLow

           else Double.NaN;

     ONL.SetHiding(!PlotOverNightExtremes);

     ONL.SetPaintingStrategy(PaintingStrategy.SQUARES);

     ONL.SetDefaultColor(Color.LIGHT_GRAY);

     ONL.HideBubble();

     ONL.HideTitle();



def MaxBar = Max(HighestAll(ONhighBar), HighestAll(ONlowBar));



plot coeff1 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_1) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_1)

              else double.nan;

plot coeff2 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_2) + OverNightLow

               else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_2)

              else double.nan;

plot coeff3 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_3) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_3)

              else double.nan;

plot coeff4 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_4) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_4)

              else double.nan;

plot coeff5 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_5) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_5)

              else double.nan;

plot coeff6 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_6) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_6)

              else double.nan;

#?

# End Code GlobeX High Low with Fibs?
 
Solution

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

check this if can help.

CSS:
# GlobeX or Overnight High / Low with Fibonacci Values?

# Mobius?

# V01.2012?

input PlotOverNightExtremes = yes;

input coeff_1 = .236;

input coeff_2 = .327;

# gmh: added the rest of the Fibs?

input coeff_3 = .500;

input coeff_4 = .618;

input coeff_5 = .789;

input coeff_6 = .882;



def o = open;

def h = high;

def l = low;

def c = close;

def v = volume;

def bar = BarNumber();

def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());

def vol = if GlobeX and !Globex[1]

          then v

          else if GlobeX

               then vol[1] + v

               else Double.NaN;

def GlobeX_Volume = vol;

def ONhigh = if GlobeX and !Globex[1]

             then h

             else if Globex and

                     h > ONhigh[1]

                     then h

                  else ONhigh[1];

def ONhighBar = if GlobeX and h == ONhigh

                then Bar

                else double.nan;

def ONlow = if GlobeX and !GlobeX[1]

            then l

            else if GlobeX and

                    l < ONlow[1]

            then l

                 else ONlow[1];

def ONlowBar = if GlobeX and l == ONlow

               then Bar

               else double.nan;

def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)

                    then ONhigh

                    else OverNightHigh[1];

def OverNightLow = if BarNumber() == HighestAll(ONlowBar)

                   then ONlow

                   else OverNightLow[1];

plot ONH = if OverNightHigh > 0

           then OverNightHigh

           else Double.NaN;

     ONH.SetHiding(!PlotOverNightExtremes);

     ONH.SetPaintingStrategy(PaintingStrategy.SQUARES);

     ONH.SetDefaultColor(Color.BLUE);

     ONH.HideBubble();

     ONH.HideTitle();

plot ONL = if OverNightLow > 0

           then OverNightLow

           else Double.NaN;

     ONL.SetHiding(!PlotOverNightExtremes);

     ONL.SetPaintingStrategy(PaintingStrategy.SQUARES);

     ONL.SetDefaultColor(Color.LIGHT_GRAY);

     ONL.HideBubble();

     ONL.HideTitle();



def MaxBar = Max(HighestAll(ONhighBar), HighestAll(ONlowBar));



plot coeff1 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_1) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_1)

              else double.nan;

plot coeff2 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_2) + OverNightLow

               else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_2)

              else double.nan;

plot coeff3 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_3) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_3)

              else double.nan;

plot coeff4 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_4) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_4)

              else double.nan;

plot coeff5 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_5) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_5)

              else double.nan;

plot coeff6 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_6) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_6)

              else double.nan;

#?

# End Code GlobeX High Low with Fibs?
Thank you so much @samer800 this is extremely helpful. I highly appreciate it....
 
check this if can help.

CSS:
# GlobeX or Overnight High / Low with Fibonacci Values?

# Mobius?

# V01.2012?

input PlotOverNightExtremes = yes;

input coeff_1 = .236;

input coeff_2 = .327;

# gmh: added the rest of the Fibs?

input coeff_3 = .500;

input coeff_4 = .618;

input coeff_5 = .789;

input coeff_6 = .882;



def o = open;

def h = high;

def l = low;

def c = close;

def v = volume;

def bar = BarNumber();

def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());

def vol = if GlobeX and !Globex[1]

          then v

          else if GlobeX

               then vol[1] + v

               else Double.NaN;

def GlobeX_Volume = vol;

def ONhigh = if GlobeX and !Globex[1]

             then h

             else if Globex and

                     h > ONhigh[1]

                     then h

                  else ONhigh[1];

def ONhighBar = if GlobeX and h == ONhigh

                then Bar

                else double.nan;

def ONlow = if GlobeX and !GlobeX[1]

            then l

            else if GlobeX and

                    l < ONlow[1]

            then l

                 else ONlow[1];

def ONlowBar = if GlobeX and l == ONlow

               then Bar

               else double.nan;

def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)

                    then ONhigh

                    else OverNightHigh[1];

def OverNightLow = if BarNumber() == HighestAll(ONlowBar)

                   then ONlow

                   else OverNightLow[1];

plot ONH = if OverNightHigh > 0

           then OverNightHigh

           else Double.NaN;

     ONH.SetHiding(!PlotOverNightExtremes);

     ONH.SetPaintingStrategy(PaintingStrategy.SQUARES);

     ONH.SetDefaultColor(Color.BLUE);

     ONH.HideBubble();

     ONH.HideTitle();

plot ONL = if OverNightLow > 0

           then OverNightLow

           else Double.NaN;

     ONL.SetHiding(!PlotOverNightExtremes);

     ONL.SetPaintingStrategy(PaintingStrategy.SQUARES);

     ONL.SetDefaultColor(Color.LIGHT_GRAY);

     ONL.HideBubble();

     ONL.HideTitle();



def MaxBar = Max(HighestAll(ONhighBar), HighestAll(ONlowBar));



plot coeff1 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_1) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_1)

              else double.nan;

plot coeff2 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_2) + OverNightLow

               else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_2)

              else double.nan;

plot coeff3 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_3) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_3)

              else double.nan;

plot coeff4 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_4) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_4)

              else double.nan;

plot coeff5 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_5) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_5)

              else double.nan;

plot coeff6 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_6) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_6)

              else double.nan;

#?

# End Code GlobeX High Low with Fibs?
Is there a script similar to this with the ability to Input Specific times of the day to run the Fibs? For Example, in lieu of the entire premarket could you have a script to input say 9:00am to 10:00am.
 
Last edited by a moderator:
Is there a script similar to this with the ability to Input Specific times of the day to run the Fibs? For Example, in lieu of the entire premarket could you have a script to input say 9:00am to 10:00am.
check the below as requested with Golden Zone indicator.

CSS:
# Fibonacci levels, custom start / EndTime time
# Golden Zone script by Bpmstocks - https://www.tradingview.com/v/oIoLaduP/
# For intraday use Only.
# Request from https://usethinkscript.com/ member
# Created by Sam4Cok@Samer800    - 10/2023

input startTime = 0830;
input endTime   = 1030;
input showVwmaLine = yes;
input ShowExtremes = yes;
input ShowFiboLevel = yes;
input fibLevel1 = 0.236;
input fibLevel2 = 0.382;
input fibLevel3 = 0.500;
input fibLevel4 = 0.618;
input fibLevel5 = 0.786;
input fibLevel6 = 1.000;

def na = Double.NaN;
def last = isNaN(close);
def bar = AbsValue(BarNumber());

def h = high;
def l = low;
def c = close;
def v = volume;

DefineGlobalColor("786", CreateColor(244,67,54));
DefineGlobalColor("618", CreateColor(129,199,132));
DefineGlobalColor("500", CreateColor(76,175,80));
DefineGlobalColor("382", CreateColor(0,150,136));
DefineGlobalColor("236", CreateColor(100,181,246));

def today    = GetDay() == GetLastDay();
def yyyyMmDd = getYyyyMmDd();
def isPeriodRolled = compoundValue(1, yyyyMmDd != yyyyMmDd[1], yes);
def fromTime = if isPeriodRolled then 0 else SecondsFromTime(startTime);
def tillTime = SecondsTillTime(endTime);
def GlobeX = fromTime >= 0 and tillTime > 0;
def condStart = fromTime == 0;
def condEnd   = tillTime == 0;
def barEnd = if condEnd then bar else
             if isPeriodRolled then na else barEnd[1];
def plotCond = bar >= barEnd and !last;

def ONhigh = if condStart then h else if Globex then Max(ONhigh[1], h) else ONhigh[1];
def ONlow  = if condStart then l else if GlobeX then min(if(ONlow[1], ONlow[1], l), l)  else ONlow[1];
def lastHigh = if condEnd then ONhigh else lastHigh[1];
def lastLow  = if condEnd then ONlow else lastLow[1];

def ONH = if bar >= barEnd then if lastHigh then lastHigh else h else na;
def ONL = if bar >= barEnd then if lastLow then lastLow else l else na;

def ONhighBar = if GlobeX and h == ONhigh then Bar else ONhighBar[1];
def ONlowBar  = if GlobeX and l == ONlow  then Bar else ONlowBar[1];
def bull = ONhighBar > ONlowBar;
def hiloDif = (lastHigh - lastLow);

#-- VWMA
def vol = if condStart then v else
          if GlobeX then vol[1] + v else vol[1];
def volClo = if condStart then v * c else
          if GlobeX then volClo[1] + v * c else volClo[1];
def cnt = if condStart then 0 else
          if GlobeX then cnt[1] + 1 else cnt[1];
def VWMA = (volClo / cnt) / (vol / cnt);
def vwma1 = if condEnd then VWMA else VWMA1[1];

plot vwmaLine = if showVwmaLine and plotCond then vwma1 else na;
vwmaLine.SetDefaultColor(Color.DARK_ORANGE);
vwmaLine.SetStyle(Curve.POINTS);

#--ZigZag
plot crossLine = if bar== highestAll(ONhighBar) then h else
                 if bar== highestAll(ONlowBar) then l else na;
crossLine.EnableApproximation();
crossLine.SetDefaultColor(Color.WHITE);
crossLine.SetStyle(Curve.LONG_DASH);
#- Fibo
def lvl000 = if bull then ONL else ONH;
def lvl236 = if bull then ONL + hiloDif * fibLevel1 else ONH - hiloDif * fibLevel1;
def lvl382 = if bull then ONL + hiloDif * fibLevel2 else ONH - hiloDif * fibLevel2;
def lvl500 = if bull then ONL + hiloDif * fibLevel3 else ONH - hiloDif * fibLevel3;
def lvl618 = if bull then ONL + hiloDif * fibLevel4 else ONH - hiloDif * fibLevel4;
def lvl786 = if bull then ONL + hiloDif * fibLevel5 else ONH - hiloDif * fibLevel5;
def lvl100 = if bull then ONL + hiloDif * fibLevel6 else ONH - hiloDif * fibLevel6;

plot lvl10 = if ShowFiboLevel or ShowExtremes then lvl100 else na;
plot lvl78 = if ShowFiboLevel then lvl786 else na;
plot lvl61 = if ShowFiboLevel then lvl618 else na;
plot lvl50 = if ShowFiboLevel then lvl500 else na;
plot lvl38 = if ShowFiboLevel then lvl382 else na;
plot lvl23 = if ShowFiboLevel then lvl236 else na;
plot lvl00 = if ShowFiboLevel or ShowExtremes then lvl000 else na;

lvl10.SetDefaultColor(Color.MAGENTA);
lvl78.SetDefaultColor(GlobalColor("786"));
lvl61.SetDefaultColor(GlobalColor("618"));
lvl50.SetDefaultColor(GlobalColor("500"));
lvl38.SetDefaultColor(GlobalColor("382"));
lvl23.SetDefaultColor(GlobalColor("236"));
lvl00.SetDefaultColor(Color.CYAN);

def lastBarCond = today and GlobeX;

plot VolWMA = if showVwmaLine and lastBarCond then highestAll(inertiaAll(vwma1, 2)) else na;
plot lvl10l = if lastBarCond and (ShowFiboLevel or ShowExtremes) then highestAll(inertiaAll(lvl100, 2)) else na;
plot lvl78l = if lastBarCond and ShowFiboLevel then highestAll(inertiaAll(lvl786, 2)) else na;
plot lvl61l = if lastBarCond and ShowFiboLevel then highestAll(inertiaAll(lvl618, 2)) else na;
plot lvl50l = if lastBarCond and ShowFiboLevel then highestAll(inertiaAll(lvl500, 2)) else na;
plot lvl38l = if lastBarCond and ShowFiboLevel then highestAll(inertiaAll(lvl382, 2)) else na;
plot lvl23l = if lastBarCond and ShowFiboLevel then highestAll(inertiaAll(lvl236, 2)) else na;
plot lvl00l = if lastBarCond and (ShowFiboLevel or ShowExtremes) then highestAll(inertiaAll(lvl000, 2)) else na;

VolWMA.SetStyle(Curve.SHORT_DASH);
lvl10l.SetStyle(Curve.MEDIUM_DASH);
lvl78l.SetStyle(Curve.MEDIUM_DASH);
lvl61l.SetStyle(Curve.MEDIUM_DASH);
lvl50l.SetStyle(Curve.MEDIUM_DASH);
lvl38l.SetStyle(Curve.MEDIUM_DASH);
lvl23l.SetStyle(Curve.MEDIUM_DASH);
lvl00l.SetStyle(Curve.MEDIUM_DASH);

VolWMA.SetDefaultColor(Color.DARK_ORANGE);
lvl10l.SetDefaultColor(Color.MAGENTA);
lvl78l.SetDefaultColor(GlobalColor("786"));
lvl61l.SetDefaultColor(GlobalColor("618"));
lvl50l.SetDefaultColor(GlobalColor("500"));
lvl38l.SetDefaultColor(GlobalColor("382"));
lvl23l.SetDefaultColor(GlobalColor("236"));
lvl00l.SetDefaultColor(Color.CYAN);

#//@version=4
#// This script plots Fibonacci retracements and the Golden Zone to help identify potential future price movements.
#study("Golden Zone", overlay=true)

#// Inputs for customizing the script
input ShowGoldenZone = yes;        # "Remove Golden Zone background?
input GoldenZoneCalcMethod = {Default "High/Low", "Day", "Week", "Month"};
input length = 60;                 # "Length (number of bars)"
input retracementLevel1 = 50;      # "Retracement Level 1 (in %)"
input retracementLevel2 = 61.8;    # "Retracement Level 2 (in %)"

def time = GetTime();
def RTH = if time >= RegularTradingStart(GetYYYYMMDD()) and time <= RegularTradingEND(GetYYYYMMDD()) then 1 else na;
def ret1 = retracementLevel1 / 100;
def ret2 = retracementLevel2 / 100;
def tfHi = Fundamental(FundamentalType.HIGH, Period = GoldenZoneCalcMethod);
def tfLo = Fundamental(FundamentalType.LOW, Period = GoldenZoneCalcMethod);
#// Get highest high and lowest low
#def day = GetDay();
def dhh = if !isNaN(rth) then tfHi else dhh[1];
def dll = if !isNaN(rth) then tfLo else dll[1];
def chh = highest(h, length);
def cll = lowest(l, length);

def hh; def ll;
Switch (GoldenZoneCalcMethod) {
Case "High/Low" :
    hh = chh;
    ll = cll;
Default :
    hh = dhh;
    ll = dll;
}

#// Calculate Fibonacci retracements
def diff = hh - ll;
def fib50 = hh - diff * ret1;
def fib61 = hh - diff * ret2;

#// Draw the filled area or box in the background
def line50 = if !ShowGoldenZone then na else fib50;
def line61 = if !ShowGoldenZone then na else fib61;
AddCloud(if last then na else line50, line61, Color.VIOLET);

# End of Code
 
check this if can help.

CSS:
# GlobeX or Overnight High / Low with Fibonacci Values?

# Mobius?

# V01.2012?

input PlotOverNightExtremes = yes;

input coeff_1 = .236;

input coeff_2 = .327;

# gmh: added the rest of the Fibs?

input coeff_3 = .500;

input coeff_4 = .618;

input coeff_5 = .789;

input coeff_6 = .882;



def o = open;

def h = high;

def l = low;

def c = close;

def v = volume;

def bar = BarNumber();

def GlobeX = GetTime() < RegularTradingStart(GetYYYYMMDD());

def vol = if GlobeX and !Globex[1]

          then v

          else if GlobeX

               then vol[1] + v

               else Double.NaN;

def GlobeX_Volume = vol;

def ONhigh = if GlobeX and !Globex[1]

             then h

             else if Globex and

                     h > ONhigh[1]

                     then h

                  else ONhigh[1];

def ONhighBar = if GlobeX and h == ONhigh

                then Bar

                else double.nan;

def ONlow = if GlobeX and !GlobeX[1]

            then l

            else if GlobeX and

                    l < ONlow[1]

            then l

                 else ONlow[1];

def ONlowBar = if GlobeX and l == ONlow

               then Bar

               else double.nan;

def OverNightHigh = if BarNumber() == HighestAll(ONhighBar)

                    then ONhigh

                    else OverNightHigh[1];

def OverNightLow = if BarNumber() == HighestAll(ONlowBar)

                   then ONlow

                   else OverNightLow[1];

plot ONH = if OverNightHigh > 0

           then OverNightHigh

           else Double.NaN;

     ONH.SetHiding(!PlotOverNightExtremes);

     ONH.SetPaintingStrategy(PaintingStrategy.SQUARES);

     ONH.SetDefaultColor(Color.BLUE);

     ONH.HideBubble();

     ONH.HideTitle();

plot ONL = if OverNightLow > 0

           then OverNightLow

           else Double.NaN;

     ONL.SetHiding(!PlotOverNightExtremes);

     ONL.SetPaintingStrategy(PaintingStrategy.SQUARES);

     ONL.SetDefaultColor(Color.LIGHT_GRAY);

     ONL.HideBubble();

     ONL.HideTitle();



def MaxBar = Max(HighestAll(ONhighBar), HighestAll(ONlowBar));



plot coeff1 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_1) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_1)

              else double.nan;

plot coeff2 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_2) + OverNightLow

               else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_2)

              else double.nan;

plot coeff3 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_3) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_3)

              else double.nan;

plot coeff4 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_4) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_4)

              else double.nan;

plot coeff5 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_5) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_5)

              else double.nan;

plot coeff6 = if HighestAll(ONhighBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then ((OverNightHigh - OverNightLow) * coeff_6) + OverNightLow

              else if HighestAll(ONlowBar) == MaxBar and OverNightLow > 0 and OverNightHigh > 0

              then OverNightHigh - ((OverNightHigh - OverNightLow) * coeff_6)

              else double.nan;

#?

# End Code GlobeX High Low with Fibs?
Hi @samer800 @halcyonguy @SleepyZ @Wiinii Is it possible to make the globex levels to cover the highs and lows of the whole pre-market session? I appreciate any input!
 

Attachments

  • 2023-12-17 at 12.43.57.png
    2023-12-17 at 12.43.57.png
    82.5 KB · Views: 107

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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