Sorry I missed this before, once the candle is closed the signal is set in stone.Very nice @YungTraderFromMontana
What is slippedthroughthecracksup evaluating?
Also, I didn't realize this, but it seems like this redraws at some point? It was 10:00am, and I saw a green up arrow with price through the resistance. I checked another chart, then came back to the chart a few minutes later and the resistance had been redrawn higher and the arrow was gone. Is that how it normally works?
Hey Yung can i talk to you via Direct Message about this indicator ? my dm is in my signaturehaha thanks, I still enjoy cod every once in a while.
def price = (open + close)/2;
def length = 1;
def displace = 0;
def SMA = Average(price[-displace], length);
#1
input LookbackPeriod1 = 8;
def FirstBar = BarNumber();
def Highest = fold i = 1
to LookbackPeriod1 + 1
with p = 1
while p
do high > GetValue(high, -i);
def A = if (FirstBar > LookbackPeriod1
and high == Highest(high, LookbackPeriod1)
and Highest)
then high
else Double.NaN;
def Lowest = fold j = 1
to LookbackPeriod1 + 1
with q = 1
while q
do low < GetValue(low, -j);
def B = if (FirstBar > LookbackPeriod1
and low == Lowest(low, LookbackPeriod1)
and Lowest)
then low
else Double.NaN;
#--------------------------------------------------------------
def _highInPeriod1 = Highest(high, LookbackPeriod1);
def _lowInPeriod1 = Lowest(low, LookbackPeriod1);
#--------------------------------------------------------------
def marketLow1 = if _lowInPeriod1 < _lowInPeriod1[-LookbackPeriod1] then _lowInPeriod1 else _lowInPeriod1[-LookbackPeriod1];
def _markedLow1 = low == marketLow1;
rec _lastMarkedLow1 = CompoundValue(1, if IsNaN(_markedLow1) then _lastMarkedLow1[1] else if _markedLow1 then low else _lastMarkedLow1[1], low);
#--------------------------------------------------------------
def marketHigh1 = if _highInPeriod1 > _highInPeriod1[-LookbackPeriod1] then _highInPeriod1 else _highInPeriod1[-LookbackPeriod1];
def _markedHigh1 = high == marketHigh1;
rec _lastMarkedHigh1 = CompoundValue(1, if IsNaN(_markedHigh1) then _lastMarkedHigh1[1] else if _markedHigh1 then high else _lastMarkedHigh1[1], high);
#--------------------------------------------------------------
plot Resistance1 = _lastMarkedHigh1;
plot Support1 = _lastMarkedLow1;
def lower_close1 = (sma crosses below Support1[1]);
def higher_close1 = (sma crosses above Resistance1[1]);
#---------------------------------------
def ph1 = Round(A, 2);
def pl1 = Round(B, 2);
#--------------------------------------------------------------
Resistance1.SetPaintingStrategy(PaintingStrategy.DASHES);
Resistance1.SetDefaultColor(Color.GREEN);
#--------------------------------------------------------------
Support1.SetPaintingStrategy(PaintingStrategy.DASHES);
Support1.SetDefaultColor(Color.RED);
def doublebreakup1 = higher_close1;
def doublebreakdown1 = lower_close1;
#2
input LookbackPeriod0 = 4;
def FirstBar0 = BarNumber();
def Highest0 = fold i0 = 1
to LookbackPeriod0 + 1
with p0 = 1
while p0
do high > GetValue(high, -i0);
def A0 = if (FirstBar0 > LookbackPeriod0
and high == Highest(high, LookbackPeriod0)
and Highest0)
then high
else Double.NaN;
def Lowest0 = fold j0 = 1
to LookbackPeriod0 + 1
with q0 = 1
while q0
do low < GetValue(low, -j0);
def B0 = if (FirstBar0 > LookbackPeriod0
and low == Lowest(low, LookbackPeriod0)
and Lowest0)
then low
else Double.NaN;
#--------------------------------------------------------------
def _highInPeriod10 = Highest(high, LookbackPeriod0);
def _lowInPeriod10 = Lowest(low, LookbackPeriod0);
#--------------------------------------------------------------
def marketLow10 = if _lowInPeriod10 < _lowInPeriod10[-LookbackPeriod0] then _lowInPeriod1 else _lowInPeriod10[-LookbackPeriod0];
def _markedLow10 = low == marketLow10;
rec _lastMarkedLow10 = CompoundValue(1, if IsNaN(_markedLow10) then _lastMarkedLow10[1] else if _markedLow10 then low else _lastMarkedLow10[1], low);
#--------------------------------------------------------------
def marketHigh10 = if _highInPeriod10 > _highInPeriod10[-LookbackPeriod0] then _highInPeriod10 else _highInPeriod10[-LookbackPeriod0];
def _markedHigh10 = high == marketHigh10;
rec _lastMarkedHigh10 = CompoundValue(1, if IsNaN(_markedHigh10) then _lastMarkedHigh10[1] else if _markedHigh10 then high else _lastMarkedHigh10[1], high);
#--------------------------------------------------------------
def Resistance10 = _lastMarkedHigh10;
def Support10 = _lastMarkedLow10;
def lower_close0 = (sma crosses below Support10[1]);
def higher_close0 = (sma crosses above Resistance10[1]);
#---------------------------------------
def ph0 = Round(A, 2);
def pl0 = Round(B, 2);
def doublebreakup2 = higher_close0;
def doublebreakdown2 = lower_close0;
#3
input LookbackPeriod00 = 2;
def FirstBar00 = BarNumber();
def Highest00 = fold i00 = 1
to LookbackPeriod00 + 1
with p00 = 1
while p00
do high > GetValue(high, -i00);
def A00 = if (FirstBar00 > LookbackPeriod00
and high == Highest(high, LookbackPeriod00)
and Highest00)
then high
else Double.NaN;
def Lowest00 = fold j00 = 1
to LookbackPeriod00 + 1
with q00 = 1
while q00
do low < GetValue(low, -j00);
def B00 = if (FirstBar00 > LookbackPeriod00
and low == Lowest(low, LookbackPeriod00)
and Lowest00)
then low
else Double.NaN;
#--------------------------------------------------------------
def _highInPeriod100 = Highest(high, LookbackPeriod00);
def _lowInPeriod100 = Lowest(low, LookbackPeriod00);
#--------------------------------------------------------------
def marketLow100 = if _lowInPeriod100 < _lowInPeriod100[-LookbackPeriod00] then _lowInPeriod100 else _lowInPeriod100[-LookbackPeriod00];
def _markedLow100 = low == marketLow100;
rec _lastMarkedLow100 = CompoundValue(1, if IsNaN(_markedLow100) then _lastMarkedLow100[1] else if _markedLow100 then low else _lastMarkedLow100[1], low);
#--------------------------------------------------------------
def marketHigh100 = if _highInPeriod100 > _highInPeriod100[-LookbackPeriod00] then _highInPeriod100 else _highInPeriod1[-LookbackPeriod00];
def _markedHigh100 = high == marketHigh100;
rec _lastMarkedHigh100 = CompoundValue(1, if IsNaN(_markedHigh100) then _lastMarkedHigh100[1] else if _markedHigh100 then high else _lastMarkedHigh100[1], high);
#--------------------------------------------------------------
def Resistance100 = _lastMarkedHigh100;
def Support100 = _lastMarkedLow100;
def lower_close00 = (sma crosses below Support100[1]);
def higher_close00 = (sma crosses above Resistance100[1]);
#---------------------------------------
def ph000 = Round(A, 2);
def pl000 = Round(B, 2);
def doublebreakup3 = higher_close00;
def doublebreakdown3 = lower_close00;
def twoathree = doublebreakup1 or doublebreakup2;
def twoofthree2 = doublebreakup1 or doublebreakup3;
def twoathree3 = doublebreakdown1 or doublebreakdown2;
def twoofthree3 = doublebreakdown1 or doublebreakdown3;
plot allbreakup = if doublebreakup1 and doublebreakup2 and doublebreakup3 then close else double.NaN;
plot allbreakdown = if doublebreakdown1 and doublebreakdown2 and doublebreakdown3 then close else double.NaN;;
plot twoofthreeup = if twoofthree2 and twoofthree2 then close else double.NaN;;
plot twoofthreedown = if twoathree3 and twoofthree3 then close else double.NaN;;
plot slippedthroughthecracksup = if twoofthreeup and (price[1] < resistance1 and price > resistance1) then close else double.NaN;;
plot slippedthroughthecracksdown = if twoofthreedown and (price[1] > support1) and (price < support1) then close else double.NaN;;
input BuyEntry = 3;
input SellEntry = 3;
def QB = Highest(high, BuyEntry);
def QS = Lowest(low, SellEntry);
plot trueqb = qb[1];
plot trueqs = qs[1];
allbreakup.SetPaintingStrategy(PaintingStrategy.ARROW_up);
allbreakdown.SetPaintingStrategy(PaintingStrategy.ARROW_down);
twoofthreeup.SetPaintingStrategy(PaintingStrategy.ARROW_up);
twoofthreedown.SetPaintingStrategy(PaintingStrategy.ARROW_down);
slippedthroughthecracksup.SetPaintingStrategy(PaintingStrategy.ARROW_up);
slippedthroughthecracksdown.SetPaintingStrategy(PaintingStrategy.ARROW_down);
trueqb.hide();
trueqs.hide();
Join useThinkScript to post your question to a community of 21,000+ developers and traders.
Start a new thread and receive assistance from our community.
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.
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.