Market Checker Codes

//Codes past times Chrismoody

study(title="market checker codes", shorttitle="market checker codes", overlay=true)
//Inputs Tab Criteria.
pd = input(22, title="market checker codes")
bbl = input(20, title="market checker codes")
mult = input(2.0    , minval=1, maxval=5, title="market checker codes")
lb = input(50  , title="market checker codes")
ph = input(.85, title="market checker codes")
novel = input(false, title="market checker codes" )
sbc = input(false, title="market checker codes")
sbcc = input(false, title="market checker codes")
new2 = input(false, title="market checker codes" )
sbcFilt = input(true, title="market checker codes")
sbcAggr = input(true, title="market checker codes")
ltLB = input(40, minval=25, maxval=99, title="market checker codes")
mtLB = input(14, minval=10, maxval=20, title="market checker codes")
str = input(3, minval=1, maxval=9, title="market checker codes")
//Alerts Instructions too Options Below...Inputs Tab
new4 = input(false, title="market checker codes" )
new5 = input(false, title="market checker codes")
sa1 = input(false, title="market checker codes")
sa2 = input(false, title="market checker codes")
sa3 = input(false, title="market checker codes")
sa4 = input(false, title="market checker codes")

//Williams Vix Fix Formula
wvf = ((highest(close, pd)-low)/(highest(close, pd)))*100
sDev = mult * stdev(wvf, bbl)
midLine = sma(wvf, bbl)
lowerBand = midLine - sDev
upperBand = midLine + sDev
rangeHigh = (highest(wvf, lb)) * ph

//Filtered Bar Criteria
upRange = depression > low[1] too unopen > high[1]
upRange_Aggr = unopen > close[1] too unopen > open[1]
//Filtered Criteria
filtered = ((wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) too (wvf < upperBand too wvf < rangeHigh))
filtered_Aggr = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) too non (wvf < upperBand too wvf < rangeHigh)

//Alerts Criteria
alert1 = wvf >= upperBand or wvf >= rangeHigh ? 1 : 0
alert2 = (wvf[1] >= upperBand[1] or wvf[1] >= rangeHigh[1]) too (wvf < upperBand too wvf < rangeHigh) ? 1 : 0
alert3 = upRange too unopen > close[str] too (close < close[ltLB] or unopen < close[mtLB]) too filtered ? 1 : 0
alert4 = upRange_Aggr too unopen > close[str] too (close < close[ltLB] or unopen < close[mtLB]) too filtered_Aggr ? 1 : 0

plotshape(sbcc and  alert1 ? alert1 : na, title="market checker codes", color=lime, style=shape.arrowup, location=location.belowbar ,text='Buttom', transp=0)
plotshape(sbc and  alert2 ? alert2 : na, title="market checker codes", color=aqua, style=shape.arrowup, location=location.belowbar ,text='Entry/Rev', transp=0)
plotshape(sbcAggr too alert4 ? alert4 : na, title="market checker codes",color=orange, style=shape.arrowup, location=location.belowbar ,text='Early in/Rev', transp=0)
plotshape(sbcFilt too alert3 ? alert3 : na, title="market checker codes", color=fuchsia, style=shape.arrowup, location=location.belowbar ,text='confirm entry/Rev', transp=0)

// Find all Fractals.
// This department based on [RS]Fractal Levels  past times RicardoSantos
hidefractals = input(false)
hidelevels = input(false)
topfractal = high[2] > high[1] too high[2] > high too high[2] > high[3] too high[2] > high[4]
botfractal = low[2] < low[1] too low[2] < depression too low[2] < low[3] too low[2] < low[4]

plotshape(hidefractals ? na : topfractal, color=green, transp=0, style=shape.triangleup, location=location.abovebar, offset=-2, size=size.tiny)
plotshape(hidefractals ? na : botfractal, color=red, transp=0, style=shape.triangledown, location=location.belowbar, offset=-2, size=size.tiny)

topfractals = topfractal ? high[2] : topfractals[1]
botfractals = botfractal ? low[2] : botfractals[1]

topfcolor = topfractals != topfractals[1] ? na : green
botfcolor = botfractals != botfractals[1] ? na : red

plot(hidelevels ? na : topfractals, color=topfcolor, transp=0, linewidth=2)
plot(hidelevels ? na : botfractals, color=botfcolor, transp=0, linewidth=2)



//Coloring Criteria of Williams Vix Fix
col = wvf >= upperBand or wvf >= rangeHigh ? lime : gray

//Plots for Williams Vix Fix Histogram too Alerts
plot(sa2 too alert2 ? alert2 : 0, title="market checker codes", style=line, linewidth=2, color=aqua)
plot(sa3 too alert3 ? alert3 : 0, title="market checker codes", style=line, linewidth=2, color=fuchsia)
plot(sa4 too alert4 ? alert4 : 0, title="market checker codes", style=line, linewidth=2, color=orange)

matype   = input(defval="HullMA", title="market checker codes", type=string)
malength = input(defval=20, title="market checker codes", minval=1)
src      = input(close,title="market checker codes")

// Returns MA input pick variant, default to SMA if blank or typo.
variant(type, src, len) =>
    v1 = sma(src, len)                                                  // Simple
    v2 = ema(src, len)                                                  // Exponential
    v3 = wma(src, len)                                                  // Weighted
    v4 = vwma(src, len)                                                 // Volume Weighted
    v5 = na(v5[1]) ? sma(src, len) : (v5[1] * (len - 1) + src) / len    // Smoothed
    v6 = two * v2 - ema(v2, len)                                          // Double Exponential
    v7 = iii * (v2 - ema(v2, len)) + ema(ema(v2, len), len)               // Triple Exponential
    v8 = wma(2 * wma(src, len / 2) - wma(src, len), round(sqrt(len)))   // Hull
    ema1 = ema(src, len)
    ema2 = ema(ema1, len)
    v10 = ema1+(ema1-ema2)                                              // Zero Lag Exponential
    v11 = sma(sma(src,len),len)                                         // Trianglular
    // supply variant, defaults to SMA if input invalid.
    type=="EMA"?v2 : type=="WMA"?v3 : type=="VWMA"?v4 : type=="SMMA"?v5 : type=="DEMA"?v6 : type=="TEMA"?v7 : type=="HullMA"?v8 : type=="ZEMA"?v10 : type=="TMA"?v11 : v1


// Calculate selected MA too become management of tendency from it.
zlema= variant(matype,src,malength)

upwardly = zlema > zlema[1] ? 1 : 0
downwards = zlema < zlema[1] ? 1 : 0



// This department based on Candlestick Patterns With EMA past times rmwaddelljr
//
ufb  = input(false, title="market checker codes")
udc  = input(true, title="market checker codes" )
upl  = input(true, title="market checker codes" )
ube  = input(true, title="market checker codes" )
ubh  = input(true, title="market checker codes" )
upb  = input(true,  title="market checker codes")
pctP = input(66, minval=1, maxval=99, title="market checker codes")
// This department based on CM_Price-Action-Bars past times ChrisMoody
// Change the pivot bar calculation, too thence tin survive used for marketplace position direction.
urpb= input(false, title="market checker codes")
usb = input(false, title="market checker codes")
uob = input(false, title="market checker codes")
uib = input(false, title="market checker codes")
pctRP = input(72, minval=1, maxval=99, title="market checker codes")
pctS = input(5, minval=1, maxval=99, title="market checker codes")
pblb =input(6,minval=1,title="market checker codes")
//
stnd = input(true, title="market checker codes")
//
// Get MACD for Alert Filtering
umacd  = input(true,title="market checker codes")
fastMA = input(title="market checker codes", type = integer, defval = 12, minval = 2)
slowMA = input(title="market checker codes", type = integer, defval = 26, minval = 7)
dot = input(title="market checker codes",type=integer,defval=9,minval=1)

//
sgb = input(false, title="market checker codes")
salc = input(true, title="market checker codes")
//
[currMacd,_,_] = macd(close[0], fastMA, slowMA, signal)
[prevMacd,_,_] = macd(close[1], fastMA, slowMA, signal)
plotColor = currMacd > 0
    ? currMacd > prevMacd ? greenish : red
    : currMacd < prevMacd ? crimson : green

// Show alarm on this bar?
sbarUp = (not umacd or plotColor==green) too (not stnd or up)
sbarDn = (not umacd or plotColor==red) too (not stnd or down)

//PBar Percentages
pctCp = pctP * .01

//Shaved Bars Percentages
pctCs = pctS * .01
pctSPO = pctCs
//ma50 = sma(close,50)

attain = high - low

///Reversal PinBars
pctCRp = pctRP * .01
pctCRPO = 1 - pctCRp
//
//pBarRUp= upb too open<close too opened upwardly > high - (range * pctCRPO) too unopen > high - (range * pctCRPO) too depression <= lowest(pblb) ? 1 : 0
//pBarRDn = upb too open>close too opened upwardly < high - (range *  pctCRp) too unopen < high-(range * pctCRp) too high >= highest(pblb) ? 1 : 0
pBarRUp = urpb and  opened upwardly > high - (range * pctCRPO) too unopen > high - (range * pctCRPO) too depression <= lowest(pblb) ? 1 : 0
pBarRDn = urpb and  opened upwardly < high - (range *  pctCRp) too unopen < high-(range * pctCRp) too high >= highest(pblb) ? 1 : 0

//Shaved Bars filter to the MA50 line
sBarUp   = usb too (close >= (high - (range * pctCs))) // too close>ma50
sBarDown = usb too (close <= (low + (range * pctCs)))  // too close<ma50

//Inside Bars
insideBarUp = uib too (high < high[1] too depression > low[1])
insideBarDn = uib too (high < high[1] too depression > low[1])
outsideBarUp= uob too (high > high[1] too depression < low[1])
outsideBarDn= uob too (high > high[1] too depression < low[1])

// PinBars representing possible alter inwards tendency direction
barcolor(pBarRUp ? greenish : na)
barcolor(pBarRDn ? crimson : na)

//Shaved Bars
barcolor(sBarDown ? fuchsia : na)
barcolor(sBarUp   ? aqua : na)

//Inside too Outside Bars
barcolor((insideBarUp or insideBarDn)? yellowish : na )
barcolor((outsideBarUp or outsideBarDn) ? orangish : na )


//Long shadow PinBars supporting marketplace position direction
///PinBars Long Upper Shadow stand upwardly for selling pressure
pBarDn = upb too opened upwardly < high - (range * pctCp) too unopen < high - (range * pctCp)
plotshape(pBarDn too (not pBarRUp too non pBarRDn), title= "Bearish Pin Bar",  color=red, style=shape.arrowdown, text="Bearish\nPinBar")
///PinBars amongst Long Lower Shadow stand upwardly for buying pressure
pBarUp = upb too opened upwardly > depression + (range * pctCp) too unopen > depression + (range * pctCp)
plotshape(pBarUp too (not pBarRUp too non pBarRDn),  title= "Bullish Pin Bar", location=location.belowbar, color=green, style=shape.arrowup, text="Bullish\nPinBar")

dcc = udc too (close[1]>open[1] too abs(close[1]-open[1])/range[1]>=0.7 too close<open too abs(close-open)/range>=0.7 too open>=close[1] too close>open[1] too close<((open[1]+close[1])/2))
plotshape(dcc, title="market checker codes",text='DarkCloud\nCover',color=red, style=shape.arrowdown,location=location.abovebar)

pln= upl too (close[1]<open[1] too abs(open[1]-close[1])/range[1]>=0.7 too close>open too abs(close-open)/range>=0.7 too open<=close[1] too close<open[1] too close>((open[1]+close[1])/2))
plotshape(pln, title="market checker codes",text="Piercing\nLine",color=green, style=shape.arrowup,location=location.belowbar)

beh = ubh too (close[1] > open[1] too opened upwardly > unopen too opened upwardly <= close[1] too depression >= open[1] too opened upwardly - unopen < close[1] - open[1] too (high < high[1] too depression > low[1]))
plotshape(beh too non dcc, title= "Bearish Harami",  color=red, style=shape.arrowdown, text="Bear\nHarami")

blh = ubh too (open[1] > close[1] too unopen > opened upwardly too unopen <= open[1] too high <= open[1] too unopen - opened upwardly < open[1] - close[1] too (high < high[1] too depression > low[1]))
plotshape(blh too non pln,  title= "Bullish Harami", location=location.belowbar, color=green, style=shape.arrowup, text="Bull\nHarami")

bee = ube too (close[1] > open[1] too unopen < opened upwardly too close<=low[1] too open>= close[1])
plotshape(bee,  title= "Bearish Engulfing", color=red, style=shape.arrowdown, text="Bearish\nEngulf")

ble = ube too (close[1] < open[1] too unopen > opened upwardly too unopen >= high[1] too open<=close[1])
plotshape(ble, title= "Bullish Engulfing", location=location.belowbar, color=green, style=shape.arrowup, text="Bullish\nEngulf")

blfr = ufb too crossover(close,topfractals)
plotshape(blfr too non ble too non blh too non sBarUp, title= "Bullish Fractal Cross", location=location.belowbar, color=green, style=shape.arrowup, text="Fractal\nCross")
befr = ufb too crossunder(close,botfractals)
plotshape(befr too non bee too non beh too non sBarDown,  title= "Bearish Fractal Cross", color=red, style=shape.arrowdown, text="Fractal\nCross")

//
bcolorDn = sbarDn too not(pBarRDn or pBarRUp or sBarDown or insideBarDn or outsideBarDn) too (beh or bee or dcc or befr or pBarDn)
bcolorUp = sbarUp too not(pBarRDn or pBarRUp or sBarUp or insideBarUp or outsideBarUp) too (blh or ble or pln or blfr or pBarUp)
barcolor(bcolorDn ? maroon : na)
barcolor(bcolorUp ? lime : na)
//
barcolor(sgb too unopen ? gray : na)

//
barAlertDn = (sbarDn too (befr or bee or beh or pBarDn  or dcc)) or (sbarDn too (insideBarDn or outsideBarDn or sBarDown)) or pBarRDn
barAlertUp = (sbarUp too (blfr or ble or blh or pBarUp  or pln)) or (sbarUp too (insideBarUp or outsideBarUp or sBarUp))  or pBarRUp
barAlert = barAlertDn or barAlertUp
alertcondition(barAlert,title="market checker codes", message="CDLTRD Bar Alert")
// exhibit solely when alarm status is met too bar closed.
plotshape(salc too barAlert[1],title= "Alert Indicator Closed", location=location.bottom, color=barAlertDn[1]?red:green, transp=0, style=shape.circle,offset=-1)
//EOF



Credits to
chrismoody
Ricardosantos
justbyuncle

Komentar

Postingan populer dari blog ini

Learn Forex Inward Ii Weeks

Sniper Trading

Codes To Notice Rejection As Well As Retest