• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Trying to Understand Market Forecast by Mobius

Splinter

New member
VIP
Hi all, brand new to the forum and ToS. I located the following script "Market Forecast" by Mobius.

I find it pretty fascinating, I was hoping someone may be able to tell what the green segmented lines are on the top and bottom. I'm thinking divergence but not sure. Also if anyone one has any background using this indicator I'd like to hear it.

Thanks to all who contribute on this forum and especially the coders, I've learned a lot since I've been here.

0IfBQcs.jpg


Code:
# Mobius©:



# Market Forecast with indicator arrows

#Hint: Buy signal when all lines reverse in the bottom or top zones.



declare lower;



input showBreadth_Fast_Slow     = No;

input showFlags_Fast_Slow       = Yes;

input showBreadth_Fast_Medium   = No;

input showFlags_Fast_Medium     = Yes;

input FlagTriggerLevel          = 45;

input VertDisp                  = -50;



# plot the horizontal reference lines

plot Line20 = 20 + VertDisp;

Line20.SetDefaultColor(Color.Light_Red);

Line20.HideBubble();

Line20.HideTitle();



plot Line50 = 50 + VertDisp;

Line50.SetDefaultColor(Color.White);

Line50.HideBubble();

Line50.HideTitle();



plot Line80 = 80 + VertDisp;

Line80.SetDefaultColor(Color.Light_Red);

Line80.HideBubble();

Line80.HideTitle();



Plot plusfifty = +50;

Plot minusfifty = -50;



plot TriggerUp = if showBreadth_Fast_Slow or showBreadth_Fast_Medium then 

  FlagTriggerLevel + 50 + VertDisp else double.nan;

TriggerUp.SetDefaultColor(Color.Gray);

TriggerUp.SetStyle(Curve.Short_Dash);

TriggerUp.HideBubble();



plot TriggerDn = if showBreadth_Fast_Slow or showBreadth_Fast_Medium then

  - FlagTriggerLevel + 50 + VertDisp else double.nan;

TriggerDn.SetDefaultColor(Color.Gray);

TriggerDn.SetStyle(Curve.Short_Dash);

TriggerDn.HideBubble();



# The Momentum, ShortTerm and Intermediate plots

plot Fast = MarketForecast().Momentum      + VertDisp;

Fast.SetDefaultColor(Color.Yellow);

Fast.SetLineWeight(1);

plot Medium = MarketForecast().NearTerm   + VertDisp;

Medium.SetDefaultColor(Color.Red);

Medium.SetLineWeight(1);



plot Slow = MarketForecast().Intermediate  + VertDisp;

Slow.SetDefaultColor(Color.Green);

Slow.SetLineWeight(1);



# Breadth plot for (Fast - Slow) Breadth

def Diff_Fast_Slow = Fast - Slow;

plot Fast_Slow_Breadth =

  if showBreadth_Fast_Slow then

    Diff_Fast_Slow + 50 + VertDisp

  else double.nan;

Fast_Slow_Breadth.SetDefaultColor(Color.Green);

Fast_Slow_Breadth.SetStyle(Curve.Short_Dash);

#

# limes for (Fast - Slow) Breadth

plot Flag_Fast_Slow_Up =

  if showFlags_Fast_Slow and Diff_Fast_Slow > FlagTriggerLevel then

    Diff_Fast_Slow + 35 + VertDisp

  else double.nan;

Flag_Fast_Slow_Up.SetDefaultColor(Color.Green);

Flag_Fast_Slow_Up.SetPaintingStrategy(PaintingStrategy.Line_vs_Points);

Flag_Fast_Slow_Up.HideBubble();

plot Flag_Fast_Slow_Dn =

  if showFlags_Fast_Slow and Diff_Fast_Slow < -FlagTriggerLevel then

    Diff_Fast_Slow + 65 + VertDisp

  else double.nan;

Flag_Fast_Slow_Dn.SetDefaultColor(Color.Green);

Flag_Fast_Slow_Dn.SetPaintingStrategy(PaintingStrategy.Line_vs_Points);

Flag_Fast_Slow_Dn.HideBubble();

#

# Breadth plot for (Fast - Medium) Breadth

def Diff_Fast_Medium = Fast - Medium;

plot Fast_Medium_Breadth =

  if showBreadth_Fast_Medium then

    Diff_Fast_Medium + 40 + VertDisp

  else double.nan;

Fast_Medium_Breadth.SetDefaultColor(Color.Red);

Fast_Medium_Breadth.SetStyle(Curve.Short_Dash);

#

# cherries for (Fast - Medium) Breadth

plot Flag_Fast_Medium_Up =

  if showFlags_Fast_Medium and Diff_Fast_Medium > FlagTriggerLevel then

    Diff_Fast_Medium + 60 + VertDisp

  else double.nan;

Flag_Fast_Medium_Up.SetDefaultColor(Color.Red);

Flag_Fast_Medium_Up.SetPaintingStrategy(PaintingStrategy.Line_vs_Points);

Flag_Fast_Medium_Up.HideBubble();

plot Flag_Fast_Medium_Dn =

  if showFlags_Fast_Medium and Diff_Fast_Medium < -FlagTriggerLevel then

    Diff_Fast_Medium + 50 + VertDisp

  else double.nan;

Flag_Fast_Medium_Dn.SetDefaultColor(Color.Red);

Flag_Fast_Medium_Dn.SetPaintingStrategy(PaintingStrategy.Line_vs_Points);

Flag_Fast_Medium_Dn.HideBubble();

#



#########

plot upone = if (Fast > Line80 and Fast [1] <= Line80 [1]) then Fast [1] else double.NaN;

upone.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

upone.SetDefaultColor(color.white);

upone.SetLineWeight(2);



plot downone = if (Fast < Line20 and Fast [1] >= Line20 [1]) then Fast [1] else double.NaN;

downone.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

downone.SetDefaultColor(color.Yellow);

downone.SetLineWeight(2);



####



plot uptwo = if (Fast > Line20 and Fast [1] <= Line20 [1]) then Fast

[1] else double.NaN;

uptwo.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

uptwo.SetDefaultColor(color.white);

uptwo.SetLineWeight(2);



plot downtwo = if (Fast < Line80 and Fast [1] >= Line80 [1]) then Fast [1] else double.NaN;

downtwo.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

downtwo.SetDefaultColor(color.Yellow);

downtwo.SetLineWeight(2);



######



plot upone1 = if (Medium > Line80 and Medium [1] <= Line80 [1]) then Medium [1] else double.NaN;

upone1.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

upone1.SetDefaultColor(color.cyan);

upone1.SetLineWeight(4);



plot downone1 = if (Medium < Line20 and Medium [1] >= Line20 [1]) then Medium [1] else double.NaN;

downone1.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

downone1.SetDefaultColor(color.Red);

downone1.SetLineWeight(4);



####



plot uptwo1 = if (Medium > Line20 and Medium [1] <= Line20 [1]) then Medium

[1] else double.NaN;

uptwo1.SetPaintingStrategy(PaintingStrategy.ARROW_UP);

uptwo1.SetDefaultColor(color.cyan);

uptwo1.SetLineWeight(4);



plot downtwo1 = if (Medium < Line80 and Medium [1] >= Line80 [1]) then Medium [1] else double.NaN;

downtwo1.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);

downtwo1.SetDefaultColor(color.Red);

downtwo1.SetLineWeight(4);



###############



plot up = if (Fast > Medium  and Fast [1] <= Medium [1]) then Fast [1] else double.NaN;

up.SetPaintingStrategy(paintingstrategy.line_vs_squares );

up.SetDefaultColor(color.blue);

;

up.SetLineWeight(4);



plot down = if (Fast < Medium and Fast [1] >= Medium  [1]) then Fast [1] else double.NaN;

down.SetPaintingStrategy(paintingstrategy.line_vs_squares );

down.SetDefaultColor(color.plum);

down.SetLineWeight(4);



#####

AddCloud (Medium, Line50 , color. green, color. red);



input LineLimit = 30;

input Detrend = 0;

input OnExpansion = yes;

input ShowPriceBubble = yes;



   def c = Medium;

   def barNumber = barNumber();

   def bar = if IsNaN(c)

             then Double.NaN

             else BarNumber();

   def ThisBar = HighestAll(bar) - Detrend;

   def cLine   = if bar == ThisBar

                 then c

                 else Double.NaN;

   def cond1 = CompoundValue(1, if IsNaN(c)

                                then cond1[1]

                                else c, c);

  plot P = if ThisBar - LineLimit <= bar

           then HighestAll(cLine)

           else Double.NaN;

       P.SetStyle(Curve.Short_Dash);

       P.SetLineWeight(1);

       P.SetDefaultColor(CreateColor(75,250,150));

AddLabel(1,"FAST", color.YELLOW);

AddLabel(1,"MEDIUM", color.RED);

AddLabel(1,"SLOW", color.GREEN);

#end
 

Similar threads

Top