Can we get this supply and demand indicator?

W

whats up

New member
can we get this supply and demand indicator? ,like the one in the video i just posted thanks BenTen

Staff
VIP
Warehouse
Supply and Demand Zones are nothing but Support and Resistance (as noted by the YouTuber). It's better if you learn how to draw the S/R levels manually. An indicator won't do it justice for the stock. You can check out this indicator below.

Code:
# Mobius
# Mobius on My Trade
# Support / Resistance
# V01.06.2012 V02.08.2013
# Added lower bar for clouds, Volume condition for plot and Vertical line for time.

input n = 13;
input ShowLines = yes;
input PlotTime = 1215; #hint PlotTime: Enter Bars End to plot Bars Start 0 for none.

def h = high;
def l = low;
def v = volume;
def Firstbar = barNumber();
def Highest = fold i = 1 to n + 1
with p = 1
while p
do h > getValue(h,-i);

def HVn = if V == Highest(v, n)
then l
else Double.NaN;

def A = if (Firstbar > n
and h == highest(h, n)
and Highest)
and HVn
then h
else double.NaN;
def Alow = if (Firstbar > n
and h == highest(h, n)
and Highest)
and HVn
then l
else double.nan;
def Lowest = fold j = 1 to n + 1
with q = 1
while q
do l < getValue(l, -j);
def B = if (Firstbar > n
and l == lowest(l, n)
and Lowest)
and HVn
then l
else double.NaN;
def Bhigh = if (Firstbar > n
and l == lowest(l, n)
and Lowest)
and HVn
then h
else double.nan;
def Al = if !isNaN(A)
then A
else Al;
def A2 = if !isNaN(Alow)
then Alow
else A2;
def Bl = if !isNaN(B)
then B
else Bl;
def B2 = if !isNaN(Bhigh)
then Bhigh
else B2;

plot ph = Round(A, 2);
ph.setPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

plot hL = if Al > 0
then Al
else double.NaN;
hL.setHiding(!showLines);
hL.SetPaintingStrategy(PaintingStrategy.Dashes);
hL.SetDefaultColor(Color.Yellow);
plot hL2 = if A2 > 0
then A2
else double.nan;
hL2.setHiding(!showLines);
hL2.SetPaintingStrategy(PaintingStrategy.Dashes);
hL2.SetDefaultColor(Color.Yellow);
AddCloud(hL, hL2, Color.Light_Red, Color.Light_Red);

plot pl = Round(B, 2);
pl.setPaintingStrategy(PaintingStrategy.VALUES_BELOW);

plot ll = if Bl > 0
then Bl
else double.NaN;
ll.setHiding(!showLines);
ll.SetPaintingStrategy(PaintingStrategy.Dashes);
ll.SetDefaultColor(Color.Blue);
plot lH = if B2 > 0
then B2
else Double.NaN;
lH.setHiding(!showLines);
lH.SetPaintingStrategy(PaintingStrategy.Dashes);
lH.SetDefaultColor(Color.Blue);
AddCloud(ll, lH, Color.Light_Green, Color.Light_Green);

# Time Markers
AddVerticalLine(SecondsTillTime(PlotTime) == 0, "", Color.Red, Curve.Short_Dash);

plot priceLine = highestAll(if isNaN(close[-1])
and !isNAN(close)
then close
else Double.NaN);
priceLine.SetStyle(Curve.Long_Dash);
priceLine.SetDefaultColor(CreateColor(75,75,75));
priceLine.SetLineWeight(1);
# End Code

• whats up and markos markos

Well-known member
VIP
Warehouse
There are several studies like this on the site. Type the word Pivot in the search box above and see what you come up with.

• whats up and BenTen markos

Well-known member
VIP
Warehouse
Or you could use fractal boxes... Last edited:
W

whats up

New member
Supply and Demand Zones are nothing but Support and Resistance (as noted by the YouTuber). It's better if you learn how to draw the S/R levels manually. An indicator won't do it justice for the stock. You can check out this indicator below.

Code:
# Mobius
# Mobius on My Trade
# Support / Resistance
# V01.06.2012 V02.08.2013
# Added lower bar for clouds, Volume condition for plot and Vertical line for time.

input n = 13;
input ShowLines = yes;
input PlotTime = 1215; #hint PlotTime: Enter Bars End to plot Bars Start 0 for none.

def h = high;
def l = low;
def v = volume;
def Firstbar = barNumber();
def Highest = fold i = 1 to n + 1
with p = 1
while p
do h > getValue(h,-i);

def HVn = if V == Highest(v, n)
then l
else Double.NaN;

def A = if (Firstbar > n
and h == highest(h, n)
and Highest)
and HVn
then h
else double.NaN;
def Alow = if (Firstbar > n
and h == highest(h, n)
and Highest)
and HVn
then l
else double.nan;
def Lowest = fold j = 1 to n + 1
with q = 1
while q
do l < getValue(l, -j);
def B = if (Firstbar > n
and l == lowest(l, n)
and Lowest)
and HVn
then l
else double.NaN;
def Bhigh = if (Firstbar > n
and l == lowest(l, n)
and Lowest)
and HVn
then h
else double.nan;
def Al = if !isNaN(A)
then A
else Al;
def A2 = if !isNaN(Alow)
then Alow
else A2;
def Bl = if !isNaN(B)
then B
else Bl;
def B2 = if !isNaN(Bhigh)
then Bhigh
else B2;

plot ph = Round(A, 2);
ph.setPaintingStrategy(PaintingStrategy.VALUES_ABOVE);

plot hL = if Al > 0
then Al
else double.NaN;
hL.setHiding(!showLines);
hL.SetPaintingStrategy(PaintingStrategy.Dashes);
hL.SetDefaultColor(Color.Yellow);
plot hL2 = if A2 > 0
then A2
else double.nan;
hL2.setHiding(!showLines);
hL2.SetPaintingStrategy(PaintingStrategy.Dashes);
hL2.SetDefaultColor(Color.Yellow);
AddCloud(hL, hL2, Color.Light_Red, Color.Light_Red);

plot pl = Round(B, 2);
pl.setPaintingStrategy(PaintingStrategy.VALUES_BELOW);

plot ll = if Bl > 0
then Bl
else double.NaN;
ll.setHiding(!showLines);
ll.SetPaintingStrategy(PaintingStrategy.Dashes);
ll.SetDefaultColor(Color.Blue);
plot lH = if B2 > 0
then B2
else Double.NaN;
lH.setHiding(!showLines);
lH.SetPaintingStrategy(PaintingStrategy.Dashes);
lH.SetDefaultColor(Color.Blue);
AddCloud(ll, lH, Color.Light_Green, Color.Light_Green);

# Time Markers
AddVerticalLine(SecondsTillTime(PlotTime) == 0, "", Color.Red, Curve.Short_Dash);

plot priceLine = highestAll(if isNaN(close[-1])
and !isNAN(close)
then close
else Double.NaN);
priceLine.SetStyle(Curve.Long_Dash);
priceLine.SetDefaultColor(CreateColor(75,75,75));
priceLine.SetLineWeight(1);
# End Code
thank you so much for your response
I will try it

Last edited by a moderator:
• markos
J

john3

Member
VIP
Warehouse
@markos What are fractal boxes? markos

Well-known member
VIP
Warehouse
@markos What are fractal boxes?
@john3 I put it in a separate thread on this site. They are basically areas of support/resistance in a given time frame. You can then see when it escapes the box. Markets are fractal, but I have no idea how this would work or be of benefit on small aggs/ timeframes. Hope that helps.

• whats up
Thread starter Similar threads Forum Replies Date Custom 0
S Questions 9 Indicators 16