The Confirmation Trend Chart Setup | The End All Be All | For ThinkOrSwim

Status
Not open for further replies.
Hello,
Thank you for the hard work in creating such awesome indicators/scripts - just incredible!! Also, I have a question, what's the reason some of the scripts shared on this thread (see attached photos) doesn't work with SPX? Before hand, thank you very much for all your valuable asssistant.
DId you ever get an answer to this question?
Some of the scripts shared on this tread contain volume calculations such as
HORSERIDER VOLUME TRIPLE EXHAUSTION

SPX does not have volume, so scripts containing volume calculations will not work with SPX.
 
DISCLAIMER: Part of this strategy uses an MTF indicators (multi-timeframe). You will see the MTF signals repaint until the higher timeframe candle closes.

Maj2np8.png


Good people, welcome. The goal of this thread is to provide basic and detailed information concerning chart style(s) and studies modified by yours truly as seen previously in the Confirmation Candles thread authored by the legend @Christopher84. I will post any future modifications, study variations, screenshots, and answer any and all relevant questions from this thread. Thus, our journey down the rabbit hole continues!

qmFWs6W.png


There is not currently, nor will there ever be, an indicator combination of indicators that will replace the need for proper risk management. There is no "End All Be All" indicator. Any reference to "guaranteed" or massive returns in this thread is sarcasm. Unless one is extremely disciplined and master of their domain (it's a Seinfeld quote...), and has complete control over one's emotions, it is highly advisable to determine what risk/reward ratio you are comfortable with.

In addition to risk management, one also needs to always be mindful of price action and important levels. Though price action and key levels are a function of various indicators, they are not infallible. Therefore, users should learn to interpret and determine them without the use of indicators, and as a byproduct, one will better understand the strength and weakness of the indicators in use. (My opinion, of course)

sGtxMwh.png


Here is a link to the VIP version of this thread where I can share the chart setups that use VIP only indicators as needed: https://usethinkscript.com/threads/the-confirmation-trend-chart-setup-vip.16186/
I would like to know if there is anyexplanation on how to use the VIP version indicators
 
Current Chart Style - http://tos.mx/88U2YzQ

EMAD Range (newest variant "V1000") - http://tos.mx/5jmDs9c

2k8hZIM.png


Code:
#EMAD Range by @ Christopher84
#EMAD V1000 - added arrow conditions - histogram - and color conditions HODL

#DECLARATIONS
declare lower;


#USER INPUTS
input showHLLH = no;
input showHowToLabel = yes;
input ShowColorCodeLabel = no;
input showtestlabels = no;
input showEMACloud = yes;
input showBubbles = no;
input showTripleExh = yes;
input showehlers = no;
input showMAD = no;
input showverticalline = yes;
input bandLength = 100;
input bandLength2 = 100;
input ELlength = 34;
Input LengtH_MAD = 4;
input fastLength = 10;
input slowLength = 35;
input lengthBAD = 3;
input smoothLength = 12;
input smoothLength2 = 14;
input ATRPeriod = 5;
input ATRFactor = 2.0;
input length_3x = 1000;
input priceType = close;
input emadLineWeight = 2;
input averageType = AverageType.WILDERS;
input averageType_Sq = AverageType.SIMPLE;
input firstTrade_Sq = {default long, short};
input trailType = {default modified, unmodified};
input firstTrade = {default long, short};
input filterBounceArrows = 1;
input filter_3x = 50;
input Control_3x = 3;
input crossabovebelowzero = 20;
input bandlengthbottom2 = 3;
input Lookback = 20;
input cloudlinelook = 20;
input LHHL_Lookback = 1;
input Steplookback = 10;
input filterZeroline = 20;
input topbanddownlookback = 1;
input bottombanduplookback = 1;
input SqueezeLook = 5;
input alert4lookback = 21;
input PreviousStepsDown = 2;
input PreviousStepsUp = 2;
input alert4control = 2;
input tradeDaytimeOnly = yes; #hint tradeDaytimeOnly: (IntraDay Only) Only perform trades during hours stated
input OpenTime = 0730; #hint OpenTime: Opening time of market
input CloseTime = 1800; #hint CloseTime: Closing time of market

def bn = barnumber();
def Begin = SecondsFromTime(OpenTime);
def End = SecondsTillTime(CloseTime);
def isIntraDay = if GetAggregationPeriod() > 14400000 or GetAggregationPeriod() == 0 then 0 else 1;
def MarketOpen = if !tradeDaytimeOnly or !isIntraDay then 1 else if tradeDaytimeOnly and isIntraDay and Begin > 0 and End > 0 then 1 else 0;

#GLOBAL COLOR DEFINITIONS
DefineGlobalColor("Green", CreateColor(0, 155, 0));
DefineGlobalColor("Red", CreateColor(225, 105, 105));
DefineGlobalColor("Gray", CreateColor(192, 192, 192));
DefineGlobalColor("Yellow", CreateColor(231, 190, 0));

## UPPER EMAD LINE
def fastExpAvg = ExpAverage(priceType, fastLength);
def slowExpAvg = ExpAverage(priceType, slowLength);
def EMAD = (priceType - fastExpAvg);
def EMAD2 = (priceType - slowExpAvg);
def EMADAvg = (EMAD + EMAD2) / 2;
def upperEMADLine = ExpAverage(EMADAvg, smoothLength);
## LOWER EMAD LINE
def emadOpen = (upperEMADLine + upperEMADLine[1]) / 2;
def emadHigh = Max(upperEMADLine, upperEMADLine[1]);
def emadLow = Min(upperEMADLine, upperEMADLine[1]);
def emadClose = upperEMADLine;
def bottom = Min(emadClose[1], emadLow);
def tr = TrueRange(emadHigh, emadClose, emadLow);
def ptr = tr / (bottom + tr / 2);
def APTR = MovingAverage(averageType, ptr, smoothLength2);
def upperBand = emadClose[1] + (APTR * emadOpen);
def lowerBand = emadClose[1] - (APTR * emadOpen);
def lowerEMADLine = (upperBand + lowerBand) / 2;
## TOP AND BOTTOM BANDS
def zeroLineData = if IsNaN(close) then Double.NaN else 0;
def EMADSUp = upperEMADLine > zeroLineData;
def EMADSDown = upperEMADLine < zeroLineData;
def EMADdown = (lowerEMADLine > upperEMADLine);
def EMADup = (upperEMADLine >= lowerEMADLine);
def topBand = Highest(lowerEMADLine, bandLength);
def bottomBand = Lowest(lowerEMADLine, bandLength);
def zerolinedatacondition = if (zerolinedata > topBand) then topBand else if (zerolinedata < bottomBand) then bottomBand else 0;
## Master
def masteremadline = (upperEMADLine + lowerEMADLine) / 2;
## BAND DIRECTION (USED ONLY FOR COLORING - NOT USED FOR PLOTS)
def topBandStepDown = if topBand < topBand[1] then 1 else 0;
def topBandStepUp = if topBand > topBand[1] then 1 else 0;
def bottomBandStepDown = if bottomBand < bottomBand[1] then 1 else 0;
def bottomBandStepUp = if bottomBand > bottomBand[1] then 1 else 0;
def bothBandsDown = bottomBandStepDown and topBandStepDown;
def bothBandsUp = bottomBandStepUp and topBandStepUp;
def bullBias = (bottomBand > zeroLineData);
def bearBias = (topBand < zeroLineData);
## BUBBLE CALCULATIONS (USED ONLY FOR BUBBLES)
def midBand = (upperBand + lowerBand) / 2;
def crossesUp = if (midBand[1] > upperEMADLine[1])and(midBand < upperEMADLine) then 1 else 0;
def crossesDown = if (upperEMADLine[1] > midBand[1])and(upperEMADLine < midBand) then 1 else 0;
def valueUp = if crossesUp then midBand else 0;
def valueDown = if crossesDown then midBand else 0;
def crossesUpline = if (valueUp - bottomBand) == 0 then 1 else 0;
def crossesDownline = if (valueDown - topBand) == 0 then 1 else 0;
def crossesUpline_filter = if crossesUpline and (crossesUpline[1] or crossesUpline[2]  or crossesUpline[3]   or crossesUpline[4])then 0 else 1;
def crossesDownline_filter = if crossesDownline and (crossesDownline[1] or crossesDownline[2]  or crossesDownline[3]   or crossesDownline[4])then 0 else 1;
def crossesUpZeroline = if (valueUp) == 0 then 1 else 0;
def crossesDownZeroline = if (valueDown) == 0 then 1 else 0;
def crossesUpBottomlinebn = if crossesUpline and !crossesUpline[1] then bn else crossesUpBottomlinebn[1];
def crossesDownToplinebn = if crossesDownline and !crossesDownline[1] then bn else crossesDownToplinebn[1];
def crossuplinewithin = if crossesUpBottomlinebn < bn then bn - crossesUpBottomlinebn else crossuplinewithin[1];
def crossdownlinewithin = if crossesDownToplinebn < bn then bn - crossesDownToplinebn else crossdownlinewithin[1];
def crosslinefirst = if crossuplinewithin < crossdownlinewithin then 1 else 0;
def crosslinelogic = crossesUpBottomlinebn > crossesDownToplinebn;
def HL = crossesUpline == 0 and crossesDownline == 0 and upperEMADLine crosses above lowerEMADLine;  #Normal HL LH condition
def LH = crossesDownline == 0 and upperEMADLine crosses below lowerEMADLine; #Normal HL LH condition
def bounceUpOnce = crossesUpline <> crossesUpline[1]; #XUpBtm happened previous bar or on current bar
def bounceDnOnce = crossesDownline <> crossesDownline[1];
def trackCrUp = if bounceUpOnce then 0 else if HL then 1 else trackCrUp[1];
def trackCrDn = if bounceDnOnce then 0 else if LH then 1 else trackCrDn[1];
## SECOND HL AND LH
def HLalready = if trackCrUp and !trackCrUp[1] then 1 else 0;
def LHalready = if trackCrDn and !trackCrDn[1] then 1 else 0;
def HL2 = HLalready == 0 and upperEMADLine crosses above lowerEMADLine;
def LH2 = LHalready == 0 and upperEMADLine crosses below lowerEMADLine;
def crossedUpOnce = HLalready <> HLalready[1];
def crossedDnOnce = LHalready <> LHalready[1];
def trackCrUp2 = if crossedUpOnce then 0 else if HL2 then 1 else trackCrUp2[1];
def trackCrDn2 = if crossedDnOnce then 0 else if LH2 then 1 else trackCrDn2[1];
#####################################################
##                                                 ##
#####################################################
def HiLo = Min(high - low, 1.5 * Average(high - low, ATRPeriod));
def HRef = if low <= high[1]
    then high - close[1]
    else (high - close[1]) - 0.5 * (low - high[1]);
def LRef = if high >= low[1]
    then close[1] - low
    else (close[1] - low) - 0.5 * (low[1] - high);
def trueRange_Sq;
switch (trailType) {
case modified:
    trueRange_Sq = Max(HiLo, Max(HRef, LRef));
case unmodified:
    trueRange_Sq = TrueRange(high, close, low);
}
def loss_Sq = ATRFactor * MovingAverage(averageType_Sq, trueRange_Sq, ATRPeriod);
def state_Sq = {default init, long, short};
def trail_Sq;
switch (state_Sq[1]) {
case init:
    if (!IsNaN(loss_Sq)) {
        switch (firstTrade) {
        case long:
            state_Sq = state_Sq.long;
            trail_Sq =  close - loss_Sq;
        case short:
            state_Sq = state_Sq.short;
            trail_Sq = close + loss_Sq;
    }
    } else {
        state_Sq = state_Sq.init;
        trail_Sq = Double.NaN;
    }
case long:
    if (close > trail_Sq[1]) {
        state_Sq = state_Sq.long;
        trail_Sq = Max(trail_Sq[1], close - loss_Sq);
    } else {
        state_Sq = state_Sq.short;
        trail_Sq = close + loss_Sq;
    }
case short:
    if (close < trail_Sq[1]) {
        state_Sq = state_Sq.short;
        trail_Sq = Min(trail_Sq[1], close + loss_Sq);
    } else {
        state_Sq = state_Sq.long;
        trail_Sq =  close - loss_Sq;
    }
}
def TrailingStop_Sq = trail_Sq;
def H = Highest(TrailingStop_Sq, 12);
def L = Lowest(TrailingStop_Sq, 12);
def BulgeLengthPrice = 100;
def SqueezeLengthPrice = 100;
def BandwidthC3 = (H - L);
def IntermResistance2 = Highest(BandwidthC3, BulgeLengthPrice);
def IntermSupport2 = Lowest(BandwidthC3, SqueezeLengthPrice);
def sqzTrigger = BandwidthC3 <= IntermSupport2;
def sqzLevel = if !sqzTrigger[1] and sqzTrigger then hl2 else if !sqzTrigger then Double.NaN else sqzLevel[1];
def Squeeze_Alert_1 = if sqzLevel then (upperEMADLine + lowerEMADLine) / 2 else (upperEMADLine + lowerEMADLine) / 2 ;
#####################################################
##                                                 ##
#####################################################
def over_bought_3x = 80;
def over_sold_3x = 20;
def KPeriod_3x = 10;
def DPeriod_3x = 10;
def priceH1 = high;
def priceL1 = low;
def priceC1 = close;
def priceO1 = close;
def priceH_3x = high;
def priceL_3x = low;
def priceC_3x = close;   
def SlowK_3x = reference StochasticFull(over_bought_3x,  over_sold_3x,  KPeriod_3x,  DPeriod_3x,  priceH_3x,  priceL_3x,  priceC_3x,  3, if (averageType == 1) then AverageType.SIMPLE else AverageType.EXPONENTIAL).FullK;
def MACD_3x = reference MACD()."Value";
def priceMean_3x = Average(MACD_3x, length_3x);
def MACD_stdev_3x =  (MACD_3x - priceMean_3x) / StDev(MACD_3x, length_3x);
def dPlus_3x = reference DMI()."DI+";
def dMinus_3x = reference DMI()."DI-";
def sellerRegular = SlowK_3x < 20 and MACD_stdev_3x < -1 and dPlus_3x < 15;
def sellerExtreme = SlowK_3x < 20 and MACD_stdev_3x < -2 and dPlus_3x < 15;
def buyerRegular = SlowK_3x > 80 and MACD_stdev_3x > 1 and dMinus_3x < 15;
def buyerExtreme = SlowK_3x > 80 and MACD_stdev_3x > 2 and dMinus_3x < 15;   
def ExtremeBuy1 = if sellerExtreme[1] and !sellerExtreme then 1 else 0;
def ExtremeSell1 = if buyerExtreme[1] and !buyerExtreme then 1 else 0;
def RegularSell1 = if buyerRegular[1] and !buyerRegular then 1 else 0;
def RegularBuy1= if sellerRegular[1] and !sellerRegular then 1 else 0;
#####################################################
##                                                 ##
#####################################################
def priceE = (emadhigh + emadlow) / 2;
def coeff = ELlength * priceE * priceE - 2 * priceE * sum(priceE, ELlength)[1] + sum(priceE * priceE, ELlength)[1];
def Ehlers =  sum(coeff * priceE, ELlength) / sum(coeff, ELlength);
#####################################################
##                                                 ##
#####################################################
def dataA = masterEMADLine;
def dataA1 =
    fold aD = 0
    to LengtH_MAD
    with k = 0
    do k + dataA[aD];
def MAEMAD = dataA1 / LengtH_MAD;
def MAD = MAEMAD;
def ElCrossDN = ehlers crosses above masterEMADline;
def ElCrossUP = ehlers crosses below masterEMADline;
def bullBias2 = (emadsup);
def bearBias2 = (emadsdown);
def MADehlers = (MAD - Ehlers)/2;
def Madebad = madehlers + ehlers;
def madebadavg = average(madebad, lengthBAD);
def crossmadeup = madebad > madebad[1];
def crossmadedn = madebad < madebad[1];
def crossmade2up = if (madebad < masterEMADLine) and crossmadeup and (bullBias2 > 0) then 1 else 0;
def crossmade2dn = if (madebad > masterEMADLine) and crossmadedn and (bearBias2 > 0) then 1 else 0;
def crossmade2 = if (madebad < masterEMADLine) and crossmadeup and (bullBias2 > 0) then 1 else if (madebad > masterEMADLine) and crossmadedn and (bearBias2 > 0) then -1 else 0;
def crossmade0 = if (!crossmade2[1] or !crossmade2[1]) and (crossmade2 == 0) then 1 else 0;
#####################################################
##                                                 ##
#####################################################
def pd = 22;
def bbl = 20;
def mult = 2.0;
def lb = 50;
def ph = 0.85;
def ltLB = 40;
def mtLB = 14;
def str = 3;
def wvf = ((Highest(close, pd) - low) / (Highest(close, pd))) * 100;
def sDev = mult * StDev(wvf, bbl);
def midLine1 = SimpleMovingAvg(wvf, bbl);
def lowerBand1 = midLine1 - sDev;
def upperBand1 = midLine1 + sDev;
def rangeHigh = (Highest(wvf, lb)) * ph;
def upRange = low > low[1] and close > high[1];
def upRange_Aggr = close > close[1] and close > open[1];
def filtered = ((wvf[1] >= upperBand1[1] or wvf[1] >= rangeHigh[1]) and (wvf < upperBand1 and wvf < rangeHigh));
def filtered_Aggr = (wvf[1] >= upperBand1[1] or wvf[1] >= rangeHigh[1]);
def alert4 = upRange_Aggr and close > close[str] and (close < close[ltLB] or close < close[mtLB]) and filtered_Aggr;
def alert4close = if alert4 then close else 0;
def crossmade = if (madebad < masterEMADLine) and crossmadeup then 1 else if (madebad > masterEMADLine) and crossmadedn then -1 else 0;
def madedn = (madebad > masterEMADLine);
def madeup = (madebad < masterEMADLine);
def made2 = madebadavg;
def made3 = if !madedn and (made2 <= zerolinedata) then madebadavg else double.nan;
def made4 = if !madeup and (made2 >= zerolinedata) then madebadavg else double.nan;
def madecrossupavg = if made2 crosses below masterEMADLine then 1 else 0;
def madecrossdownavg = if made2 crosses above masterEMADLine then 1 else 0;
def crossmadelogicup = if madecrossupavg and !madecrossupavg[1] then 1 else 0;
def crossmadelogicdown = if madecrossdownavg and !madecrossdownavg[1] then 1 else 0;
def crossmademorelogicup = if crossmadelogicup and crosslinelogic and emadup[1] then 1 else 0;
def crossmademorelogicdown = if crossmadelogicdown and !crosslinelogic and emaddown[1] then 1 else 0;
def EmaPushStepUp = if topBandStepUp and EmadUp and (((upperEMADLine) - bottomband) == 0) then 1 else 0;;
def EmaPushStepDown = if bottomBandStepDown and EmadDown and (((lowerEMADLine) - bottomband) == 0) then 1 else 0;
def HLFilter = if HL[1] < HL then 1 else 0;
def LHFilter = if LH[1] > LH then 1 else 0;
def HLFilter2 = if HL[2] < HL[1] then 1 else 0;
def LHFilter2 = if LH[2] > LH[1] then 1 else 0;
#####################################################
##                                                 ##
#####################################################
def ValueUp_lookback = fold index1 = 1 to filterBounceArrows with x1 do x1 + absvalue(valueUp)[index1];
def ValueDown_lookback = fold index2 = 1 to filterBounceArrows with x2 do x2 + absvalue(valueDown)[index2];
def topBandStepDown_lookback = fold index3 = 1 to Steplookback with x3 do x3 + topBandStepDown[index3];
def topBandStepUp_lookback = fold index4 = 1 to Steplookback with x4 do x4 + topBandStepUp[index4];
def bottomBandStepDown_lookback = fold index5 = 1 to Steplookback with x5 do x5 + bottomBandStepDown[index5];
def bottomBandStepUp_lookback = fold index6 = 1 to Steplookback with x6 do x6 + bottomBandStepUp[index6];
def bothBandsDown_lookback = fold index7 = 1 to filterBounceArrows with x7 do x7 + bothBandsDown[index7];
def bothBandsUp_lookback = fold index8 = 1 to filterBounceArrows with x8 do x8 + bothBandsUp[index8];
def bullBias_lookback = fold index9 = 1 to filterBounceArrows with x9 do x9 + bullBias[index9];
def bearBias_lookback = fold index10 = 1 to filterBounceArrows with x10 do x10 + bearBias[index10];
def crossesUpZeroline_lookback = fold index11 = 1 to filterZeroline with x11 do x11 + crossesUpZeroline[index11];
def crossesDownZeroline_lookback = fold index12 = 1 to filterZeroline with x12 do x12 + crossesDownZeroline[index12];
def crossesUpBottomline_lookback = fold index13 = 1 to filterBounceArrows with x13 do x13 + crossesUpline[index13];
def crossesDownTopline_lookback = fold index14 = 1 to filterBounceArrows with x14 do x14 + crossesDownline[index14];
def CrossedUPaboveZero_lookback = fold index15 = 1 to crossabovebelowzero with x15 do x15 + crossesUpZeroline[index15];
def CrossedDOWNbelowZero_lookback = fold index16 = 1 to crossabovebelowzero with x16 do x16 + crossesDownZeroline[index16];
def HL_lookback = fold index17 = 1 to LHHL_Lookback with x17 do x17 + HL[index17];
def LH_lookback = fold index18 = 1 to LHHL_Lookback with x18 do x18 + LH[index18];
def upabovezero_lookback = fold index19 = 1 to crossabovebelowzero with x19 do x19 + HL[index19];
def downbelowzero_lookback = fold index20 = 1 to crossabovebelowzero with x20 do x20 + LH[index20];
def PriceMonitor = fold index21 = 1 to crossabovebelowzero with x21 do x21 + HL[index21];
def ExtremeBuy1_lookback = fold index24 = 1 to filter_3x with x24 do x24 + ExtremeBuy1[index24];
def ExtremeSell1_lookback = fold index25 = 1 to filter_3x with x25 do x25 + ExtremeSell1[index25];
def RegularSell1_lookback = fold index26 = 1 to filter_3x with x26 do x26 + RegularSell1[index26];
def RegularBuy1_lookback = fold index27 = 1 to filter_3x with x27 do x27 + RegularBuy1[index27];
def Squeeze_lookback = fold index28 = 1 to SqueezeLook with x28 do x28 + Squeeze_Alert_1[index28];
def ElCrossDN_lookback = fold index29 = 1 to filterBounceArrows with x29 do x29 + ElCrossDN[index29];
def ElCrossUP_lookback = fold index30 = 1 to filterBounceArrows with x30 do x30 + ElCrossUP[index30];
def bearBias2_lookback = fold index31 = 1 to filterBounceArrows with x31 do x31 + bearBias2[index31];
def bullBias2_lookback = fold index32 = 1 to filterBounceArrows with x32 do x32 + bullBias2[index32];
def crossmade0_lookback = fold index33 = 1 to cloudlinelook with x33 do x33 + crossmade0[index33];
def alert4_lookback = fold index34 = 1 to alert4lookback with x34 do x34 + alert4close[index34];
#####################################################
##                                                 ##
#####################################################
def bubblehidertopdown = topBandStepDown_lookback > PreviousStepsDown;
def bubblehidertopup = topBandStepup_lookback > PreviousStepsUp;
def bubblehiderbottomdown = bottomBandStepDown_lookback > PreviousStepsDown;
def bubblehiderbottomup = bottomBandStepup_lookback > PreviousStepsUp;
def UP1 = if marketopen and (!bubblehidertopdown or !bubblehiderbottomdown) and !EmaPushStepDown and crossmademorelogicup then midBand else double.nan;
def DOWN1 = if marketopen and (!bubblehidertopup or !bubblehiderbottomup) and !EmaPushStepUp and crossmademorelogicdown then midBand else double.nan;
#####################################################
##                                                 ##
#####################################################
plot zeroLine = zerolinedata;
plot Squeeze_Alert = if sqzLevel then (upperEMADLine + lowerEMADLine) / 2 else (upperEMADLine + lowerEMADLine) / 2 ;
plot ExtremeBuy = if showTripleExh and sellerExtreme[1] and !sellerExtreme then midband else Double.NaN;
plot ExtremeSell = if showTripleExh and buyerExtreme[1] and !buyerExtreme then midband else Double.NaN;
plot RegularSell = if showTripleExh and buyerRegular[1] and !buyerRegular then midband else Double.NaN;
plot RegularBuy = if showTripleExh and sellerRegular[1] and !sellerRegular then midband else Double.NaN;
plot topBandPlot = topBand;
plot bottomBandPlot = bottomBand;
plot upperEMADLinePlot = upperEMADLine;
plot lowerEMADLinePlot = lowerEMADLine;
plot masterEMADLinePlot2 = (upperEMADLine + lowerEMADLine) / 2;
plot masterEMADLinePlot = ((upperEMADLinePlot + lowerEMADLinePlot) / 2);
plot made1 = made4;
plot made = made3;
plot UP = UP1;
plot DOWN = DOWN1;
plot firstHL = if showHLLH and trackCrUp and !trackCrUp[1] then lowerEMADLine else double.nan;
plot firstLH = if showHLLH and trackCrDn and !trackCrDn[1] then lowerEMADLine else double.nan;
plot secondHL = if showHLLH and trackCrUp2 and !trackCrUp2[1] and !crossesUpline then lowerEMADLine else double.nan;
plot secondLH = if showHLLH and trackCrDn2 and !trackCrDn2[1] and !crossesDownline then lowerEMADLine else double.nan;
#####################################################
##                                                 ##
#####################################################
def firstHL2 = if trackCrUp and !trackCrUp[1] then 1 else 0;
def firstLH2 = if trackCrDn and !trackCrDn[1] then 1 else 0;
def HLBuy = if firstHL2 and regularsell1 or extremesell1 then 1 else 0;
def LHSell = if firstHL2 and regularbuy1 or extremebuy1 then 1 else 0;
#####################################################
##                                                 ##
#####################################################
UP.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
UP.SetLineWeight(1);
UP.SetDefaultColor(Color.white);
UP.HideBubble();
UP.HideTitle();
#####################################################
##                                                 ##
#####################################################
DOWN.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
DOWN.SetLineWeight(1);
DOWN.SetDefaultColor(Color.white);
DOWN.HideBubble();
DOWN.HideTitle();
#####################################################
##                                                 ##
#####################################################
made1.AssignValueColor(
     if crossmade2 == 1 then color.dark_green
else if crossmade2 == -1 then color.dark_red
else if crossmade0_lookback > 1 and crosslinelogic then Color.gray
else color.dark_red);
#####################################################
##                                                 ##
#####################################################
made.AssignValueColor(
     if crossmade2 == 1 then color.dark_green
else if crossmade2 == -1 then color.dark_red
else if crossmade0_lookback > 1 and crosslinelogic then Color.gray
else color.dark_red);
#####################################################
##                                                 ##
#####################################################
Squeeze_Alert.SetPaintingStrategy(PaintingStrategy.line);
Squeeze_Alert.SetLineWeight(2);
Squeeze_Alert.SetDefaultColor(Color.YELLOW);
#####################################################
##                                                 ##
#####################################################
RegularBuy.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
ExtremeBuy.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
RegularSell.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
ExtremeSell.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
#####################################################
##                                                 ##
#####################################################
RegularBuy.SetLineWeight((1));
ExtremeBuy.SetLineWeight((1));
RegularSell.SetLineWeight((1));
ExtremeSell.SetLineWeight((1));
#####################################################
##                                                 ##
#####################################################
ExtremeSell.SetDefaultColor((Color.WHITE));
ExtremeBuy.SetDefaultColor((Color.WHITE));
RegularBuy.SetDefaultColor((Color.white));
RegularSell.SetDefaultColor((Color.white));
#####################################################
##                                                 ##
#####################################################
firstHL.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
firstHL.SetLineWeight(1);
firstHL.SetDefaultColor(Color.blue);
firstHL.HideBubble();
firstHL.HideTitle();
#####################################################
##                                                 ##
#####################################################
firstLH.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
firstLH.SetLineWeight(1);
firstLH.SetDefaultColor(Color.blue);
firstLH.HideBubble();
firstLH.HideTitle();
#####################################################
##                                                 ##
#####################################################
secondHL.SetPaintingStrategy(PaintingStrategy.ARROW_UP);
secondHL.SetLineWeight(1);
secondHL.SetDefaultColor(Color.CYAN);
secondHL.HideBubble();
secondHL.HideTitle();
#####################################################
##                                                 ##
#####################################################
secondLH.SetPaintingStrategy(PaintingStrategy.ARROW_DOWN);
secondLH.SetLineWeight(1);
secondLH.SetDefaultColor(Color.CYAN);
secondLH.HideBubble();
secondLH.HideTitle();
#####################################################
##                                                 ##
#####################################################
masterEMADLinePlot.SetPaintingStrategy(PaintingStrategy.histogram);
masterEMADLinePlot.HideBubble();
masterEMADLinePlot.SetLineWeight(1);
masterEMADLinePlot.AssignValueColor(
     if alert4 then color.cyan
else if HLBuy then color.light_green
else if LHSell then color.light_red
else if crossmade2up then Color.dark_green
else if crossmade2dn then color.dark_red
else if crossmade0_lookback > 1 and crosslinelogic then Color.dark_gray
else color.dark_red
);
DefineGlobalColor("G0", CreateColor(0, 255, 0));  #Green
DefineGlobalColor("G1", CreateColor(0, 229, 0));  #Green
DefineGlobalColor("G2", CreateColor(0, 206, 0));  #Green
DefineGlobalColor("G3", CreateColor(0, 186, 0));  #Green
DefineGlobalColor("G4", CreateColor(0, 167, 0));  #Green
DefineGlobalColor("G5", CreateColor(0, 151, 0));  #Green
DefineGlobalColor("G6", CreateColor(0, 136, 0));  #Green
DefineGlobalColor("G7", CreateColor(0, 122, 0));  #Green
DefineGlobalColor("G8", CreateColor(0, 109, 0));  #Green
DefineGlobalColor("G9", CreateColor(0, 98, 0));  #Green
DefineGlobalColor("R0", CreateColor(255, 0, 0));  #Red
DefineGlobalColor("R1", CreateColor(224, 0, 0));  #Red
DefineGlobalColor("R2", CreateColor(197, 0, 0));  #Red
DefineGlobalColor("R3", CreateColor(174, 0, 0));  #Red
DefineGlobalColor("R4", CreateColor(153, 0, 0));  #Red
DefineGlobalColor("R5", CreateColor(135, 0, 0));  #Red
DefineGlobalColor("R6", CreateColor(118, 0, 0));  #Red
DefineGlobalColor("R7", CreateColor(104, 0, 0));  #Red
DefineGlobalColor("R8", CreateColor(92, 0, 0));  #Red
DefineGlobalColor("R9", CreateColor(81, 0, 0));  #Red

upperEMADLinePlot.HideTitle();
upperEMADLinePlot.HideBubble();
upperEMADLinePlot.AssignValueColor(
    if (lowerEMADLinePlot > upperEMADLinePlot) then createcolor(153, 0, 0)
    else if (lowerEMADLinePlot < upperEMADLinePlot) then createcolor(0, 167, 0)
    else GlobalColor("Gray")
);
lowerEMADLinePlot.HideTitle();
lowerEMADLinePlot.HideBubble();
lowerEMADLinePlot.AssignValueColor(
    if (lowerEMADLinePlot > upperEMADLinePlot) then Color.red
    else if (lowerEMADLinePlot < upperEMADLinePlot) then Color.green
    else GlobalColor("Gray")
);
masterEMADLinePlot2.HideTitle();
masterEMADLinePlot2.HideBubble();
masterEMADLinePlot2.SetLineWeight(emadLineWeight);
masterEMADLinePlot2.AssignValueColor(
    if masterEMADLinePlot > masterEMADLinePlot[2] then createColor(0, 186, 0)
    else if masterEMADLinePlot < masterEMADLinePlot[2] then createColor(174, 0, 0)
    else GlobalColor("Gray")
);
zeroLine.HideTitle();
zeroLine.HideBubble();
zeroLine.AssignValueColor(
    if (upperEMADLinePlot > zeroLine) then  Color.green
    else if (upperEMADLinePlot < zeroLine) then  Color.red
    else GlobalColor("Yellow")
);
topBandPlot.HideTitle();
topBandPlot.HideBubble();
topBandPlot.AssignValueColor(
    if bothBandsDown then Color.dark_red
    else if bothBandsUp then color.Dark_green
    else if topBandStepUp then Color.green
    else if topBandStepDown then Color.red
    else if bearBias then  Color.yellow
    else GlobalColor("Gray")
);
bottomBandPlot.HideTitle();
bottomBandPlot.HideBubble();
bottomBandPlot.AssignValueColor(
    if bothBandsDown then Color.dark_red
    else if bothBandsUp then color.Dark_green
    else if bottomBandStepUp then Color.green
    else if bottomBandStepDown then Color.red
    else if bullBias then Color.yellow
    else  GlobalColor("Gray")
);
AddLabel(yes, " EMAD RANGE V1000 ", color.WHITE);
AddLabel(ShowColorCodeLabel,
    if  showHowToLabel then " Bullish: Observe cloud prior to reversal " else " Bullish ", color.dark_green);       
AddLabel(ShowColorCodeLabel,
    if  showHowToLabel then " Bearish: Observe cloud prior to reversal " else " Bearish ", color.dark_red);         
AddLabel(ShowColorCodeLabel,
    if  showHowToLabel then " Vix Alert4: Bounce incoming " else " Vix Alert4 ", color.cyan);       
AddLabel(ShowColorCodeLabel, 
    if  showHowToLabel then " Seller Exhaustion: Watch for pullback / reversal when exhaustion ends " else " Seller Exhaustion ",  color.light_red); 
AddLabel(ShowColorCodeLabel, 
    if  showHowToLabel then " Seller Exhaustion: Watch for pullback / reversal when exhaustion ends " else " Buyer Exhaustion ",  color.light_green); 
AddLabel(ShowColorCodeLabel,
    if  showHowToLabel then " Neutral: Direction not confirmed " else " Neutral ",  color.gray); 
AddLabel(ShowColorCodeLabel,
    if  showHowToLabel then " Squeeze: (non-directional) potential strong move incoming " else " Squeeze ",  color.yellow); 
#####################################################
##                                                 ##
#####################################################
AddCloud(if showEMACloud and (made1 > masterEMADLinePlot) then made1 else Double.NaN, masterEMADLinePlot, Color.dark_red, Color.gray);
AddCloud(if showEMACloud and (masterEMADLinePlot >= made) then masterEMADLinePlot else Double.NaN, made,  Color.dark_green, Color.gray);
#####################################################
##                                                 ##
#####################################################
AddChartBubble(showBubbles and crossesUpline and crossesUpline_filter, midBand, "Wait for HL", GlobalColor("Green"), no);
AddChartBubble(showBubbles and crossesDownline and crossesDownline_filter, midBand,"Wait for LH" , GlobalColor("Red"), yes);
#####################################################
##                                                 ##
#####################################################
AddVerticalLine(showVerticalline and crossesUpline and crossesUpline_filter, "", GlobalColor("Green"), no);
AddVerticalLine(showVerticalline and crossesDownline and crossesDownline_filter,"" , GlobalColor("Red"), yes);

Hey @HODL-Lay-HE-hoo! , great work on the scripts that you're sharing. I'm new to this community and trying to explore quite a few different things, I was using Big4 earlier and came across this later. For the last few days I've been this C3_Big7_Max on 1 min chart and it seems to be giving great signal. However, I saw the green/red arrows are get re-painted. Just wanted to check, if you're seeing the same thing or I messed up something in my indicator setting. Don't have specific screenshot, but I did saw in few instance where a green or red arrow showed up and it was there even the candle closed. However few minutes later it went away.
 
Mrjs4Cz.png


Study Share Link - http://tos.mx/LPDfqC1 (4/25/23)

Screenshots
View attachment 18475

Example: C3 line to determine reversal / breakout probability
View attachment 18476

Code:
# C3_MF_Line_v2 Created by Christopher84 03/06/2022
# Based off of the Confirmation Candles Study. Main difference is that CC Candles weigh factors of positive
# and negative price movement to create the Consensus_Level. The Consensus_Level is considered positive if
# above zero and negative if below zero.

#Keltner Channel
declare upper;
def displace = 0;
def factorK = 2.0;
def lengthK = 20;
def price = close;
def price1 = open;
input averageType = AverageType.SIMPLE;
def trueRangeAverageType = AverageType.SIMPLE;
def BulgeLengthPrice = 100;
def SqueezeLengthPrice = 100;
def BulgeLengthPrice2 = 20;
def SqueezeLengthPrice2 = 20;
def BulgeLengthPrice3 = 12;
def SqueezeLengthPrice3 = 12;

def shift = factorK * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), lengthK);
def averageK = MovingAverage(averageType, price, lengthK);
def AvgK = averageK[-displace];
def Upper_BandK = averageK[-displace] + shift[-displace];
def Lower_BandK = averageK[-displace] - shift[-displace];

def conditionK1UP = price >= Upper_BandK;
def conditionK2UP = (Upper_BandK[1] < Upper_BandK) and (Lower_BandK[1] < Lower_BandK);
def conditionK3DN = (Upper_BandK[1] > Upper_BandK) and (Lower_BandK[1] > Lower_BandK);
def conditionK4DN = price < Lower_BandK;
def BandwidthK = (Upper_BandK - Lower_BandK) / AvgK * 100;

def IntermResistance = Highest(price, BulgeLengthPrice);
#IntermResistance.AssignValueColor(if (conditionK2UP) then Color.GREEN else if (conditionK3DN) then Color.RED else Color.GRAY);
def IntermSupport = Lowest(price, SqueezeLengthPrice);
#IntermSupport.AssignValueColor(if (conditionK2UP) then Color.GREEN else if (conditionK3DN) then Color.RED else Color.GRAY);

def NearTResistance = Highest(price, BulgeLengthPrice2);
#NearTResistance.AssignValueColor(if (conditionK2UP) then Color.GREEN else if (conditionK3DN) then Color.RED else Color.GRAY);
#NearTResistance.SetStyle(Curve.SHORT_DASH);
def NearTSupport = Lowest(price, SqueezeLengthPrice2);
#NearTSupport.AssignValueColor(if (conditionK2UP) then Color.GREEN else if (conditionK3DN) then Color.RED else Color.GRAY);
#NearTSupport.SetStyle(Curve.SHORT_DASH);

def NearTResistance1 = Highest(price, BulgeLengthPrice3);
def NearTSupport1 = Lowest(price, SqueezeLengthPrice3);

#MACD with Price
def fastLength = 12;
def slowLength = 26;
def MACDLength = 9;
input MACD_AverageType = {SMA, default EMA};
def MACDLevel = 0.0;

def fastEMA = ExpAverage(price, fastLength);
def slowEMA = ExpAverage(price, slowLength);
def Value;
def Avg;
switch (MACD_AverageType) {
case SMA:
    Value = Average(price, fastLength) - Average(price, slowLength);
    Avg = Average(Value, MACDLength);
case EMA:
    Value = fastEMA - slowEMA;
    Avg = ExpAverage(Value, MACDLength);
}
def Diff = Value - Avg;
def Level = MACDLevel;

def condition1 = Value[1] <= Value;
def condition1D = Value[1] > Value;

#RSI
def RSI_length = 14;
def RSI_AverageType = AverageType.WILDERS;
def RSI_OB = 70;
def RSI_OS = 30;

def NetChgAvg = MovingAverage(RSI_AverageType, price - price[1], RSI_length);
def TotChgAvg = MovingAverage(RSI_AverageType, AbsValue(price - price[1]), RSI_length);
def ChgRatio = if TotChgAvg != 0 then NetChgAvg / TotChgAvg else 0;
def RSI = 50 * (ChgRatio + 1);

def condition2 = (RSI[3] < RSI) is true or (RSI >= 80) is true;
def condition2D = (RSI[3] > RSI) is true or (RSI < 20) is true;
def conditionOB1 = RSI > RSI_OB;
def conditionOS1 = RSI < RSI_OS;

#MFI
def MFI_Length = 14;
def MFIover_Sold = 20;
def MFIover_Bought = 80;
def movingAvgLength = 1;
def MoneyFlowIndex = Average(MoneyFlow(high, close, low, volume, MFI_Length), movingAvgLength);
def MFIOverBought = MFIover_Bought;
def MFIOverSold = MFIover_Sold;

def condition3 = (MoneyFlowIndex[2] < MoneyFlowIndex) is true or (MoneyFlowIndex > 85) is true;
def condition3D = (MoneyFlowIndex[2] > MoneyFlowIndex) is true or (MoneyFlowIndex < 20) is true;
def conditionOB2 = MoneyFlowIndex > MFIover_Bought;
def conditionOS2 = MoneyFlowIndex < MFIover_Sold;

#Forecast
def na = Double.NaN;
def MidLine = 50;
def Momentum = MarketForecast().Momentum;
def NearT =  MarketForecast().NearTerm;
def Intermed = MarketForecast().Intermediate;
def FOB = 80;
def FOS = 20;
def upperLine = 110;

def condition4 = (Intermed[1] <= Intermed) or (NearT >= MidLine);
def condition4D = (Intermed[1] > Intermed) or (NearT < MidLine);
def conditionOB3 = Intermed > FOB;
def conditionOS3 = Intermed < FOS;
def conditionOB4 = NearT > FOB;
def conditionOS4 = NearT < FOS;

#Change in Price
def lengthCIP = 5;
def CIP = (price - price[1]);
def AvgCIP = ExpAverage(CIP[-displace], lengthCIP);
def CIP_UP = AvgCIP > AvgCIP[1];
def CIP_DOWN = AvgCIP < AvgCIP[1];

def condition5 = CIP_UP;
def condition5D = CIP_DOWN;

#EMA_1
def EMA_length = 8;
def AvgExp = ExpAverage(price[-displace], EMA_length);

def condition6 = (price >= AvgExp) and (AvgExp[2] <= AvgExp);
def condition6D = (price < AvgExp) and (AvgExp[2] > AvgExp);

#EMA_2
def EMA_2length = 20;
def displace2 = 0;
def AvgExp2 = ExpAverage(price[-displace2], EMA_2length);

def condition7 = (price >= AvgExp2) and (AvgExp2[2] <= AvgExp);
def condition7D = (price < AvgExp2) and (AvgExp2[2] > AvgExp);

#DMI Oscillator
def DMI_length = 5;#Typically set to 10
input DMI_averageType = AverageType.WILDERS;
def diPlus = DMI(DMI_length, DMI_averageType)."DI+";
def diMinus = DMI(DMI_length, DMI_averageType)."DI-";
def Osc = diPlus - diMinus;
def Hist = Osc;
def ZeroLine = 0;

def condition8 = Osc >= ZeroLine;
def condition8D = Osc < ZeroLine;

#Trend_Periods
def TP_fastLength = 3;#Typically 7
def TP_slowLength = 4;#Typically 15
def Periods = Sign(ExpAverage(close, TP_fastLength) - ExpAverage(close, TP_slowLength));

def condition9 = Periods > 0;
def condition9D = Periods < 0;

#Polarized Fractal Efficiency
def PFE_length = 5;#Typically 10
def smoothingLength = 2.5;#Typically 5
def PFE_diff = close - close[PFE_length - 1];
def val = 100 * Sqrt(Sqr(PFE_diff) + Sqr(PFE_length)) / Sum(Sqrt(1 + Sqr(close - close[1])), PFE_length - 1);
def PFE = ExpAverage(if PFE_diff > 0 then val else -val, smoothingLength);
def UpperLevel = 50;
def LowerLevel = -50;

def condition10 = PFE > 0;
def condition10D = PFE < 0;
def conditionOB5 = PFE > UpperLevel;
def conditionOS5 = PFE < LowerLevel;

#Bollinger Bands PercentB
input BBPB_averageType = AverageType.SIMPLE;
def BBPB_length = 20;#Typically 20
def Num_Dev_Dn = -2.0;
def Num_Dev_up = 2.0;
def BBPB_OB = 100;
def BBPB_OS = 0;
def upperBand = BollingerBands(price, displace, BBPB_length, Num_Dev_Dn, Num_Dev_up, BBPB_averageType).UpperBand;
def lowerBand = BollingerBands(price, displace, BBPB_length, Num_Dev_Dn, Num_Dev_up, BBPB_averageType).LowerBand;
def PercentB = (price - lowerBand) / (upperBand - lowerBand) * 100;
def HalfLine = 50;
def UnitLine = 100;

def condition11 = PercentB > HalfLine;
def condition11D = PercentB < HalfLine;
def conditionOB6 = PercentB > BBPB_OB;
def conditionOS6 = PercentB < BBPB_OS;

#STARC Bands
def ATR_length = 15;
def SMA_lengthS = 6;
def multiplier_factor = 1.25;
def valS = Average(price, SMA_lengthS);
def average_true_range = Average(TrueRange(high, close, low), length = ATR_length);
def Upper_BandS = valS[-displace] + multiplier_factor * average_true_range[-displace];
def Middle_BandS = valS[-displace];
def Lower_BandS = valS[-displace] - multiplier_factor * average_true_range[-displace];

def condition12 = (Upper_BandS[1] <= Upper_BandS) and (Lower_BandS[1] <= Lower_BandS);
def condition12D = (Upper_BandS[1] > Upper_BandS) and (Lower_BandS[1] > Lower_BandS);

#Klinger Histogram
def Klinger_Length = 13;
def KVOsc = KlingerOscillator(Klinger_Length).KVOsc;
def KVOH = KVOsc - Average(KVOsc, Klinger_Length);
def condition13 = (KVOH > 0);
def condition13D = (KVOH < 0);

#Projection Oscillator
def ProjectionOsc_length = 30;#Typically 10
def MaxBound = HighestWeighted(high, ProjectionOsc_length, LinearRegressionSlope(price = high, length = ProjectionOsc_length));
def MinBound = LowestWeighted(low, ProjectionOsc_length, LinearRegressionSlope(price = low, length = ProjectionOsc_length));
def ProjectionOsc_diff = MaxBound - MinBound;
def PROSC = if ProjectionOsc_diff != 0 then 100 * (close - MinBound) / ProjectionOsc_diff else 0;
def PROSC_OB = 80;
def PROSC_OS = 20;

def condition14 = PROSC > 50;
def condition14D = PROSC < 50;
def conditionOB7 = PROSC > PROSC_OB;
def conditionOS7 = PROSC < PROSC_OS;

#Trend Confirmation Calculator
#Confirmation_Factor range 1-15.
input coloredCandlesOn = yes;
input Confirmation_Factor = 7;
#Use for testing conditions individually. Remove # from line below and change Confirmation_Factor to 1.
#def Agreement_Level = condition1;
def Agreement_LevelOB = 10;
def Agreement_LevelOS = -10;

def Agreement_Level = condition1 + condition2 + condition3 + condition4 + condition5 + condition6 + condition7 + condition8 + condition9 + condition10 + condition11 + condition12 + condition13 + condition14 + conditionK1UP + conditionK2UP;

def Agreement_LevelD = (condition1D + condition2D + condition3D + condition4D + condition5D + condition6D + condition7D + condition8D + condition9D + condition10D + condition11D + condition12D + condition13D + condition14D + conditionK3DN + conditionK4DN);

def Consensus_Level = Agreement_Level - Agreement_LevelD;

def UP = Consensus_Level >= 6;
def DOWN = Consensus_Level < -6;

def priceColor = if UP then 1
                 else if DOWN then -1
                 else priceColor[1];

#Keltner #2
input showCloud = yes;
def factorK2 = 3.25;
def lengthK2 = 20;

def shiftK2 = factorK2 * MovingAverage(trueRangeAverageType, TrueRange(high, close, low), lengthK2);
def averageK2 = MovingAverage(averageType, price, lengthK2);
def AvgK2 = averageK2[-displace];
def Upper_BandK2 = averageK2[-displace] + shiftK2[-displace];
def Lower_BandK2 = averageK2[-displace] - shiftK2[-displace];
def condition_BandRevDn = (Upper_BandS > Upper_BandK2);
def condition_BandRevUp = (Lower_BandS < Lower_BandK2);

#Consensus_Level.AssignValueColor(
#if Consensus_Level > Consensus_Level[1] and Consensus_Level >= 0 then Color.LIGHT_GREEN
#else if Consensus_Level < Consensus_Level[1] and Consensus_Level >= 0 then Color.LIGHT_GREEN
#else if Consensus_Level < Consensus_Level[1] and Consensus_Level < 0 then Color.RED else
#if Consensus_Level > Consensus_Level[1] and Consensus_Level < 0 then Color.RED
#else Color.GRAY);

def Zero_Line = 0;


#AddCloud(Consensus_Level, Agreement_LevelOB, Color.LIGHT_RED, Color.CURRENT);
#AddCloud(Consensus_Level, Agreement_LevelOS, Color.CURRENT, Color.LIGHT_GREEN);

#plot BulgeCC = Highest(Consensus_Level, BulgeLengthCC);
#BulgeCC.AssignValueColor(if (conditionK2) then Color.GREEN else if (conditionK3) then Color.RED else Color.GRAY);

#plot SqueezeCC = Lowest(Consensus_Level, SqueezeLengthCC);
#SqueezeCC.AssignValueColor(if (conditionK2) then Color.GREEN else if (conditionK3) then Color.RED else Color.GRAY);

#plot BulgeCC2 = Highest(Consensus_Level, BulgeLengthCC2);
#BulgeCC2.AssignValueColor(if (conditionK2) then Color.GREEN else if (conditionK3) then Color.RED else Color.GRAY);
#BulgeCC2.SetStyle(Curve.SHORT_DASH);

#plot SqueezeCC2 = Lowest(Consensus_Level, SqueezeLengthCC2);
#SqueezeCC2.AssignValueColor(if (conditionK2) then Color.GREEN else if (conditionK3) then Color.RED else Color.GRAY);
#SqueezeCC2.SetStyle(Curve.SHORT_DASH);
##########################################################################################################################

script WMA_Smooth {
    input price = hl2;
    plot smooth = (4 * price
+ 3 * price[1]
+ 2 * price[2]
+ price[3]) / 10;
}

script Phase_Accumulation {
# This is Ehler's Phase Accumulation code. It has a full cycle delay.
# However, it computes the correction factor to a very high degree.
#
    input price = hl2;

    rec Smooth;
    rec Detrender;
    rec Period;
    rec Q1;
    rec I1;
    rec I1p;
    rec Q1p;
    rec Phase1;
    rec Phase;
    rec DeltaPhase;
    rec DeltaPhase1;
    rec InstPeriod1;
    rec InstPeriod;
    def CorrectionFactor;

    if BarNumber() <= 5
    then {
        Period = 0;
        Smooth = 0;
        Detrender = 0;
        CorrectionFactor = 0;
        Q1 = 0;
        I1 = 0;
        Q1p = 0;
        I1p = 0;
        Phase = 0;
        Phase1 = 0;
        DeltaPhase1 = 0;
        DeltaPhase = 0;
        InstPeriod = 0;
        InstPeriod1 = 0;
    } else {
        CorrectionFactor = 0.075 * Period[1] + 0.54;

# Smooth and detrend my smoothed signal:
        Smooth = WMA_Smooth(price);
        Detrender = ( 0.0962 * Smooth
+ 0.5769 * Smooth[2]
- 0.5769 * Smooth[4]
- 0.0962 * Smooth[6] ) * CorrectionFactor;

# Compute Quadrature and Phase of Detrended signal:
        Q1p = ( 0.0962 * Detrender
+ 0.5769 * Detrender[2]
- 0.5769 * Detrender[4]
- 0.0962 * Detrender[6] ) * CorrectionFactor;
        I1p = Detrender[3];

# Smooth out Quadrature and Phase:
        I1 = 0.15 * I1p + 0.85 * I1p[1];
        Q1 = 0.15 * Q1p + 0.85 * Q1p[1];

# Determine Phase
        if I1 != 0
        then {
# Normally, ATAN gives results from -pi/2 to pi/2.
# We need to map this to circular coordinates 0 to 2pi

            if Q1 >= 0 and I1 > 0
            then { # Quarant 1
                Phase1 = ATan(AbsValue(Q1 / I1));
            } else if Q1 >= 0 and I1 < 0
            then { # Quadrant 2
                Phase1 = Double.Pi - ATan(AbsValue(Q1 / I1));
            } else if Q1 < 0 and I1 < 0
            then { # Quadrant 3
                Phase1 = Double.Pi + ATan(AbsValue(Q1 / I1));
            } else { # Quadrant 4
                Phase1 = 2 * Double.Pi - ATan(AbsValue(Q1 / I1));
            }
        } else if Q1 > 0
        then { # I1 == 0, Q1 is positive
            Phase1 = Double.Pi / 2;
        } else if Q1 < 0
        then { # I1 == 0, Q1 is negative
            Phase1 = 3 * Double.Pi / 2;
        } else { # I1 and Q1 == 0
            Phase1 = 0;
        }

# Convert phase to degrees
        Phase = Phase1 * 180 / Double.Pi;

        if Phase[1] < 90 and Phase > 270
        then {
# This occurs when there is a big jump from 360-0
            DeltaPhase1 = 360 + Phase[1] - Phase;
        } else {
            DeltaPhase1 = Phase[1] - Phase;
        }

# Limit our delta phases between 7 and 60
        if DeltaPhase1 < 7
        then {
            DeltaPhase = 7;
        } else if DeltaPhase1 > 60
        then {
            DeltaPhase = 60;
        } else {
            DeltaPhase = DeltaPhase1;
        }

# Determine Instantaneous period:
        InstPeriod1 =
-1 * (fold i = 0 to 40 with v=0 do
if v < 0 then
v
else if v > 360 then
-i
else
v + GetValue(DeltaPhase, i, 41)
);

        if InstPeriod1 <= 0
        then {
            InstPeriod = InstPeriod[1];
        } else {
            InstPeriod = InstPeriod1;
        }

        Period = 0.25 * InstPeriod + 0.75 * Period[1];
    }
    plot DC = Period;
}

script Ehler_MAMA {
    input price = hl2;
    input FastLimit = 0.5;
    input SlowLimit = 0.05;


    rec Period;
    rec Period_raw;
    rec Period_cap;
    rec Period_lim;

    rec Smooth;
    rec Detrender;
    rec I1;
    rec Q1;
    rec jI;
    rec jQ;
    rec I2;
    rec Q2;
    rec I2_raw;
    rec Q2_raw;

    rec Phase;
    rec DeltaPhase;
    rec DeltaPhase_raw;
    rec alpha;
    rec alpha_raw;

    rec Re;
    rec Im;
    rec Re_raw;
    rec Im_raw;

    rec SmoothPeriod;
    rec vmama;
    rec vfama;

    def CorrectionFactor = Phase_Accumulation(price).CorrectionFactor;

    if BarNumber() <= 5
    then {
        Smooth = 0;
        Detrender = 0;

        Period = 0;
        Period_raw = 0;
        Period_cap = 0;
        Period_lim = 0;
        I1 = 0;
        Q1 = 0;
        I2 = 0;
        Q2 = 0;
        jI = 0;
        jQ = 0;
        I2_raw = 0;
        Q2_raw = 0;
        Re = 0;
        Im = 0;
        Re_raw = 0;
        Im_raw = 0;
        SmoothPeriod = 0;
        Phase = 0;
        DeltaPhase = 0;
        DeltaPhase_raw = 0;
        alpha = 0;
        alpha_raw = 0;
        vmama = 0;
        vfama = 0;
    } else {
# Smooth and detrend my smoothed signal:
        Smooth = WMA_Smooth(price);
        Detrender = ( 0.0962 * Smooth
+ 0.5769 * Smooth[2]
- 0.5769 * Smooth[4]
- 0.0962 * Smooth[6] ) * CorrectionFactor;

        Q1 = ( 0.0962 * Detrender
+ 0.5769 * Detrender[2]
- 0.5769 * Detrender[4]
- 0.0962 * Detrender[6] ) * CorrectionFactor;
        I1 = Detrender[3];

        jI = ( 0.0962 * I1
+ 0.5769 * I1[2]
- 0.5769 * I1[4]
- 0.0962 * I1[6] ) * CorrectionFactor;

        jQ = ( 0.0962 * Q1
+ 0.5769 * Q1[2]
- 0.5769 * Q1[4]
- 0.0962 * Q1[6] ) * CorrectionFactor;

# This is the complex conjugate
        I2_raw = I1 - jQ;
        Q2_raw = Q1 + jI;

        I2 = 0.2 * I2_raw + 0.8 * I2_raw[1];
        Q2 = 0.2 * Q2_raw + 0.8 * Q2_raw[1];

        Re_raw = I2 * I2[1] + Q2 * Q2[1];
        Im_raw = I2 * Q2[1] - Q2 * I2[1];

        Re = 0.2 * Re_raw + 0.8 * Re_raw[1];
        Im = 0.2 * Im_raw + 0.8 * Im_raw[1];

# Compute the phase
        if Re != 0 and Im != 0
        then {
            Period_raw = 2 * Double.Pi / ATan(Im / Re);
        } else {
            Period_raw = 0;
        }

        if Period_raw > 1.5 * Period_raw[1]
        then {
            Period_cap = 1.5 * Period_raw[1];
        } else if Period_raw < 0.67 * Period_raw[1] {
            Period_cap = 0.67 * Period_raw[1];
        } else {
            Period_cap = Period_raw;
        }

        if Period_cap < 6
        then {
            Period_lim = 6;
        } else if Period_cap > 50
        then {
            Period_lim = 50;
        } else {
            Period_lim = Period_cap;
        }

        Period = 0.2 * Period_lim + 0.8 * Period_lim[1];
        SmoothPeriod = 0.33 * Period + 0.67 * SmoothPeriod[1];

        if I1 != 0
        then {
            Phase = ATan(Q1 / I1);
        } else if Q1 > 0
        then { # Quadrant 1:
            Phase = Double.Pi / 2;
        } else if Q1 < 0
        then { # Quadrant 4:
            Phase = -Double.Pi / 2;
        } else { # Both numerator and denominator are 0.
            Phase = 0;
        }

        DeltaPhase_raw = Phase[1] - Phase;
        if DeltaPhase_raw < 1
        then {
            DeltaPhase = 1;
        } else {
            DeltaPhase = DeltaPhase_raw;
        }

        alpha_raw = FastLimit / DeltaPhase;
        if alpha_raw < SlowLimit
        then {
            alpha = SlowLimit;
        } else {
            alpha = alpha_raw;
        }
        vmama = alpha * price + (1 - alpha) * vmama[1];
        vfama = 0.5 * alpha * vmama + (1 - 0.5 * alpha) * vfama[1];
    }

    plot MAMA = vmama;
    plot FAMA = vfama;
}


input price2 = hl2;
input FastLimit = 0.5;
input SlowLimit = 0.05;

def MAMA = Ehler_MAMA(price2, FastLimit, SlowLimit).MAMA;
def FAMA = Ehler_MAMA(price2, FastLimit, SlowLimit).FAMA;

def Crossing = Crosses((MAMA < FAMA), yes);
#Crossing.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);

def Crossing1 = Crosses((MAMA > FAMA), yes);
#Crossing1.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);

##################################
plot C3_MF_Line = (MAMA + FAMA) / 2;
C3_MF_Line.SetPaintingStrategy(PaintingStrategy.Line);
C3_MF_Line.SetLineWeight(3);
C3_MF_Line.AssignValueColor(if coloredCandlesOn and ((priceColor == 1) and (price1 > Upper_BandS) and (condition_BandRevDn)) then Color.YELLOW else if coloredCandlesOn and ((priceColor == -1) and (price1 < Lower_BandS) and (condition_BandRevUp)) then Color.YELLOW else if coloredCandlesOn and priceColor == -1 then Color.RED  else if coloredCandlesOn and (priceColor == 1) then Color.GREEN else Color.CURRENT);

#Vertical Line
#AddVerticalLine(( GetDay() <> GetDay()[1]), "", Color.Dark_Gray, Curve.SHORT_DASH);
@HODL-Lay-HE-hoo! Do we have a watchlist for C3_Line, can you kindly point me to the link please..
 
For Confirmation Candles version 10 or similar ones where the Confirmation Level ranges from 0 to 16, is there a way to make a scan looking for a specific Confirmation Level or higher or lower? I could not accomplish this with my little coding skills. Thanks in advance for your response.
 
Hey @HODL-Lay-HE-hoo! , great work on the scripts that you're sharing. I'm new to this community and trying to explore quite a few different things, I was using Big4 earlier and came across this later. For the last few days I've been this C3_Big7_Max on 1 min chart and it seems to be giving great signal. However, I saw the green/red arrows are get re-painted. Just wanted to check, if you're seeing the same thing or I messed up something in my indicator setting. Don't have specific screenshot, but I did saw in few instance where a green or red arrow showed up and it was there even the candle closed. However few minutes later it went away.
C3_Big7_Max - every indication is single ag and cannot re-paint. Note that an indication appearing when a bar is open then disappearing by the time the bar is closed is not re-paint. Now if an indication from 3 bars ago disappears that is re-paint which only occurs when the code references future bars which this one does not.

The only studies that will re-paint on page one are TS_V9_Filtered and the MTF version of C3 (I no longer use any MTF indicators)
 
C3_Big7_Max - every indication is single ag and cannot re-paint. Note that an indication appearing when a bar is open then disappearing by the time the bar is closed is not re-paint. Now if an indication from 3 bars ago disappears that is re-paint which only occurs when the code references future bars which this one does not.

The only studies that will re-paint on page one are TS_V9_Filtered and the MTF version of C3 (I no longer use any MTF indicators)
I will see if anything could be causing re-paint though I have not witnessed it myself... the green and red arrows are the "Spark" arrows which in that study are filtered to remove multiple consecutive arrows in the same direction.
 
For Confirmation Candles version 10 or similar ones where the Confirmation Level ranges from 0 to 16, is there a way to make a scan looking for a specific Confirmation Level or higher or lower? I could not accomplish this with my little coding skills. Thanks in advance for your response.
I believe there is a scan posted by a user on the Confirmation Candles thread. I dont use them personally.
 
Hey Thanks for the indicator and all the work you did. I have C3_Max_Spark and C3_line and EMAD_V2 on my chart and I trade NQ and futures for quick scalp and also do some options swings. I was wondering what is the best timeframe to trade futures for quick scalp and swings confirmation for stocks for options. I would like to know about a timeframe that works best and gives perfect confirmation. Also do I need to add Big7 or any other indicator that can help in scalping futures and buying options for swings ? Also what is spark and consensus how can I take that into consideration while playing scalps or options swings. My chart is like this.
1699985539147.png
 
I added a vertical line plot to C3_BIG_MAX to show when TS_V9 - Spark - and Direction (from big4) are all in agreement. Will update with screenshot. https://tos.mx/orjbi5M

Also the "Squeeze" dots will be gray when the big4 direction = 0. The normal big4 has one direction plot. On this however there are 2 direction plots one has different settings than the other. I say that so you will not see colored candles and wonder why the squeeze dots are still gray. One direction condition is involved in painting candles the other was originally for the arrows and is now included in the squeeze color condition. My aim was to see if I could make the Squeeze indication directional but it did not work out so when the direction one or two is confirmed the squeeze dot is yellow.

Updated Screenshot

ZeDWrwq.png


3xmp8AS.png
 
Last edited:
Hey Thanks for the indicator and all the work you did. I have C3_Max_Spark and C3_line and EMAD_V2 on my chart and I trade NQ and futures for quick scalp and also do some options swings. I was wondering what is the best timeframe to trade futures for quick scalp and swings confirmation for stocks for options. I would like to know about a timeframe that works best and gives perfect confirmation. Also do I need to add Big7 or any other indicator that can help in scalping futures and buying options for swings ? Also what is spark and consensus how can I take that into consideration while playing scalps or options swings. My chart is like this.View attachment 20159

First... Hell will freeze over before we get an indicator with perfect confirmation... unless your code knows the future.

You are using an older version which is not much different than the current version... would suggest uploading the new chart style...

http://tos.mx/chHKmMG
ZeDWrwq.png


You will notice it does not include the C3 Line (green and red line on top of the candles) as the candle colors in my opinion do the same job.

I scalp futures as well and on page one the screenshots with the entry methods shown are what I use 99% of the time... I use them on any timeframe chart. I generally use the 1,2,3 min chart with another higher tf chart 10,15,30,1hr beside it. Hell sometimes I use the 1 and 3 min charts after I do the following:

Go to the higher TF charts and find some key levels or previously ob os levels that are within reach of the low TF chart you are using. Mark the level(s) close that chart go to the low TF chart and wait until the entry method criteria is met.

eobl9lf.png


Things to keep in mind:
When the horizontal zones are compressed expect some chop... for example either wait it out or just know that when I buy at this level because I think it will bounce it is going to be a quick scalp because the other zone is close by.

Your chart shows the cyan/magenta candles - on the new they are in the EMAD lower indicator (still cyan no magenta)

The new emad vs what is on your chart is far better in my opinion.

How do I choose a TF? I look through the lower TFs to see which chart is plotting the levels and indication in a way that is more easily understood. Same for the higher TF. Trade in the same direction as the higher TF and use a stoploss!
 
Last edited:
@HODL-Lay-HE-hoo! you have done a great deal of analysis on many different types of indicators, and you write very well about many different types of tools that you are using together.

It looks as if you have planned around the limitations of "over correlation" or the statistical costs of using to many indicators together, but you might be encouraged by remembering that many technologies and techniques are only possible by using many different measurements together.
This mathmetician Youtube channel does and excellent job of reminding us of the positive side of using very large data sets with many types of techniques such as you often do.

 
Like you and several other members here, I would always tend to use every single type of code under the sun but constrained to only show once relevant...

If you go back to developing massive studies you might want to consider a video diary . That is what I do and you would be amazed how that can benefit your decision making process.

Thank you again for sharing your coding adventure with us.
 
Good people...

I am currently working on a thing... Testing at the moment with more improvements to come... or I will end up scrapping the idea all together who knows.

So far I have added the setting to choose

1. The original arrow plots where each arrow for spark, tsv9, big4 (signal up) etc. are separate plots.
or
2. The "input" arrow plot option: (adding further explanation soon!)

FfsGLuJ.png
 
Last edited:
Status
Not open for further replies.

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

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
401 Online
Create Post

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