dpxpress
New member
Hi I was wondering if anyone could quickly help me combine two scripts?
the first tracks price more accurately. I want to use those inputs with the plot options of mobius' code. Here is the first code
----------------
##k_kirill code posted in 2020
input lineLength = 100;
def lastBar = !IsNaN(close) && IsNaN(close[-1]);
def lastClose = if lastBar then close else lastClose[1];
plot PriceIndicatorLine = if IsNaN(close[-lineLength - 1]) then lastClose[-lineLength] else Double.NaN;
PriceIndicatorLine.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PriceIndicatorLine.SetDefaultColor(Color.CYAN);
----------------
the second has has better options to plot the script. I would like to able to edit the line style (ie. color, weight, style, length) before and after the the current candle.
# Posted from Mobius 1/15/18 - This puts a Horizontal Line at Price to see price level at potential Support / Resistance
# Here is a code Snippet that gives you all you need to limit a line both forward and backward
# Dynamic_Line
# Mobius
# V01.09.2012
input LineLimit = 100;
input OnExpansion = yes;
input OnExpansionLimit = 30;
def c = close; # Replace close with any conditional value that meets your requirement
def barNumber = BarNumber();
def bar = if IsNaN(c) then Double.NaN else BarNumber;
def ThisBar = HighestAll(bar);
def cline = if bar == ThisBar then c else Double.NaN;
def condi = CompoundValue(1, if IsNaN(c) then condi [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));
plot ExpLine = if OnExpansion and barNumber < HighestAll (bar + OnExpansionLimit) and IsNaN(c) then condi else Double.NaN;
ExpLine.SetStyle(Curve.SHORT_DASH);
ExpLine.SetLineWeight(1);
ExpLine.SetDefaultColor(CreateColor(150, 150, 150));
# End Code Dynamic Line Mobius • 8:23 PM
the first tracks price more accurately. I want to use those inputs with the plot options of mobius' code. Here is the first code
----------------
##k_kirill code posted in 2020
input lineLength = 100;
def lastBar = !IsNaN(close) && IsNaN(close[-1]);
def lastClose = if lastBar then close else lastClose[1];
plot PriceIndicatorLine = if IsNaN(close[-lineLength - 1]) then lastClose[-lineLength] else Double.NaN;
PriceIndicatorLine.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
PriceIndicatorLine.SetDefaultColor(Color.CYAN);
----------------
the second has has better options to plot the script. I would like to able to edit the line style (ie. color, weight, style, length) before and after the the current candle.
# Posted from Mobius 1/15/18 - This puts a Horizontal Line at Price to see price level at potential Support / Resistance
# Here is a code Snippet that gives you all you need to limit a line both forward and backward
# Dynamic_Line
# Mobius
# V01.09.2012
input LineLimit = 100;
input OnExpansion = yes;
input OnExpansionLimit = 30;
def c = close; # Replace close with any conditional value that meets your requirement
def barNumber = BarNumber();
def bar = if IsNaN(c) then Double.NaN else BarNumber;
def ThisBar = HighestAll(bar);
def cline = if bar == ThisBar then c else Double.NaN;
def condi = CompoundValue(1, if IsNaN(c) then condi [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));
plot ExpLine = if OnExpansion and barNumber < HighestAll (bar + OnExpansionLimit) and IsNaN(c) then condi else Double.NaN;
ExpLine.SetStyle(Curve.SHORT_DASH);
ExpLine.SetLineWeight(1);
ExpLine.SetDefaultColor(CreateColor(150, 150, 150));
# End Code Dynamic Line Mobius • 8:23 PM