//♠️♥️♣️♦️START♠️♥️♣️♦️
//@version=4
//Patch 5.1
//Gambit's Royal Flush <(^^,)>

study(title="Gambit's Royal Flush", overlay=true)

//Scalp Trading EMA's

showEMA1= input(true, title="Scalp EMA 7")
Len1 = input(7, title="EMA (7)")
showEMA2= input(false, title="Scalp EMA 21")
Len2 = input(21, title="EMA (21)")
showEMA3= input(true, title="Scalp EMA 55")
Len3 = input(55, title="EMA (55)")
showEMA4= input(false, title="Scalp EMA 100")
Len4 = input(100, title="EMA (100)")
showMA1= input(true, title="Scalp MA 200")
Len5 = input(200, title="MA (200)")

srcEMA = input (close, "Moving Averages Sources")
EMA1=ema(srcEMA,Len1)
EMA2=ema(srcEMA,Len2)
EMA3=sma(srcEMA,Len3)
EMA4=sma(srcEMA,Len4)
MA1=sma(srcEMA,Len5)

plot(showEMA1?EMA1:na , title="EMA (7)", color = #FF9800, linewidth=4) 
plot(showEMA2?EMA2:na , title="EMA (21)", color = #0000FF, linewidth=4)
plot(showEMA3?EMA3:na , title="EMA (55)", color = #00FF00, linewidth=4)
plot(showEMA4?EMA4:na , title="EMA (100)", color = #FFFF00, linewidth=4)
plot(showMA1?MA1:na , title="MA (200)", color = #FF0000, linewidth=4) 

//Ichimoku

showIchi = input(true, title="Ichimoku Cloud")
conversionPeriods = input(7, minval=1, title="Conversion Line Periods (7)"),
basePeriods = input(14, minval=1, title="Base Line Periods (14)")
laggingSpan2Periods = input(75, minval=1, title="Lagging Span/Barney (75)"),
displacement = input(25, minval=1, title="Displacement (25)")
donchian(len) => avg(lowest(len), highest(len))
conversionLine = donchian(conversionPeriods)
baseLine = donchian(basePeriods)
leadLine1 = avg(conversionLine, baseLine)
leadLine2 = donchian(laggingSpan2Periods)
//plot(showIchi?conversionLine:na, color=#0496ff, title="Conversion Line", transp=100) 
//plot(showIchi?baseLine:na, color=#991515, title="Base Line", transp=100) 
plot(showIchi?close:na, offset = -displacement , color=#9C27B0, title="Lagging Span/Barney", linewidth=4, transp=0)
p1ichi = plot(showIchi?leadLine1:na, offset = displacement, color=color.green, title="Lead 1", transp=100)
p2ichi = plot(showIchi?leadLine2:na, offset = displacement, color=color.red,  title="Lead 2", transp=100)
fill(p1ichi, p2ichi, color = leadLine1 > leadLine2 ? color.green : color.red, title="Ichimoku Cloud", transp=60)

//Bollinger Bands

showBB = input(true, title="Bollinger Band")
lenBB = input(20, minval=1, title="Bollinger Band Length (20)")
srcBB = input(close, title="BB Source (close)")
mult = input(2, minval=0.001, maxval=50, title="Multi (2)")
basis = sma(srcBB, lenBB)
dev = mult * stdev(srcBB, lenBB)
tol2 = input(0, minval=0, type=input.float, title="Basis Color Tolerance (0)")
upper = basis + dev
lower = basis - dev

plot(showBB?basis:na, color=#800000, title="BB Basis", transp=100)
p1 = plot(showBB?upper:na, color=#000000, title="BB Upper Band", linewidth=3)
p2 = plot(showBB?lower:na, color=#000000, title="BB Lower Band", linewidth=3)
fill(p1, p2, title="Bollinger Band", transp=100)

//Hull

//showHULL = input(false, title="Hull")
//hullLength = input(4, minval=4, title="Hull Length (4)")
//hullSource = input(close,title="Hull Source")
//hullVal = wma(2 * wma(hullSource, hullLength / 2) - wma(hullSource, hullLength), round(sqrt(hullLength)))
//plot(showHULL?hullVal:na,title="Hull",color=#aeeff3, linewidth=2,style=4,transp=60)

//SuperTrend
showTrend = input(true, title="SuperTrend")
src = input(defval=close, title="Source")
per = input(defval=100, minval=1, title="Sampling Period")

//Range Multiplier

mult2 = input(defval=2.0, minval=0.1, title="Range Multiplier")

//Smooth Average Range

smoothrng(x, t, m) =>
    wper = t * 2 - 1
    avrng = ema(abs(x - x[1]), t)
    smoothrng = ema(avrng, wper) * m
    smoothrng
smrng = smoothrng(src, per, mult)

//Range Filter

rngfilt(x, r) =>
    rngfilt = x
    rngfilt := x > nz(rngfilt[1]) ? x - r < nz(rngfilt[1]) ? nz(rngfilt[1]) : x - r : 
       x + r > nz(rngfilt[1]) ? nz(rngfilt[1]) : x + r
    rngfilt
filt = rngfilt(src, smrng)

//Filter Direction

upward = 0.0
upward := filt > filt[1] ? nz(upward[1]) + 1 : filt < filt[1] ? 0 : nz(upward[1])
downward = 0.0
downward := filt < filt[1] ? nz(downward[1]) + 1 : filt > filt[1] ? 0 : nz(downward[1])

//Target Bands

hband = filt + smrng
lband = filt - smrng

//Colors

filtcolor = upward > 0 ? color.lime : downward > 0 ? color.red : color.orange
barcolor = src > filt and src > src[1] and upward > 0 ? color.lime : 
   src > filt and src < src[1] and upward > 0 ? color.green : 
   src < filt and src < src[1] and downward > 0 ? color.red : 
   src < filt and src > src[1] and downward > 0 ? color.maroon : color.orange

filtplot = plot(showTrend?filt:na, color=filtcolor, linewidth=3, title="Range Filter", transp=100)

//Break Outs

longCond = bool(na)
shortCond = bool(na)
longCond := src > filt and src > src[1] and upward > 0 or 
   src > filt and src < src[1] and upward > 0
shortCond := src < filt and src < src[1] and downward > 0 or 
   src < filt and src > src[1] and downward > 0

CondIni = 0
CondIni := longCond ? 1 : shortCond ? -1 : CondIni[1]
longCondition = longCond and CondIni[1] == -1
shortCondition = shortCond and CondIni[1] == 1

//Alerts

plotshape(showTrend?longCondition:na, title="Buy Signal", text="BUY", textcolor=color.white, style=shape.labelup, size=size.normal, location=location.belowbar, color=color.green, transp=0)
plotshape(showTrend?shortCondition:na, title="Sell Signal", text="SELL", textcolor=color.white, style=shape.labeldown, size=size.normal, location=location.abovebar, color=color.red, transp=0)


//♠️♥️♣️♦️END♠️♥️♣️♦️ <(^^,)>

 
Reaction
1 reaction

//♠️♥️♣️♦️START♠️♥️♣️♦️
//@version=4
//Patch 5.0
//Gambit's High Card <(^^,)>️

study(title="Gambit's High Card", shorttitle="High Card", format=format.price, precision=2)
src2 = close, len2 = input(6, minval=1, title="Length (6)")
up = rma(max(change(src2), 0), len2)
down = rma(-min(change(src2), 0), len2)
rsi = down == 0 ? 100 : up == 0 ? 0 : 100 - (100 / (1 + up / down))
plot(rsi, color=#000000)
band1 = hline(70)
band0 = hline(30)
fill(band1, band0, color=#000000, transp=90)

len = input(title="RSI Period (14)", minval=1, defval=14)
src = input(title="RSI Source", defval=close)
lbR = input(title="Pivot Lookback Right (2)", defval=2)
lbL = input(title="Pivot Lookback Left (2)", defval=2)
rangeUpper = input(title="Max of Lookback Range (60)", defval=60)
rangeLower = input(title="Min of Lookback Range (5)", defval=5)
plotBull = input(title="Plot Bullish", defval=true)
plotHiddenBull = input(title="Plot Hidden Bullish", defval=false)
plotBear = input(title="Plot Bearish", defval=true)
plotHiddenBear = input(title="Plot Hidden Bearish", defval=false)

bearColor = color.red
bullColor = color.green
hiddenBullColor = color.new(color.green, 80)
hiddenBearColor = color.new(color.red, 80)
textColor = color.white
noneColor = color.new(color.white, 100)

osc = rsi(src, len)

plot(osc, title="RSI", linewidth=2, color=#8D1699)
hline(50, title="Middle Line", linestyle=hline.style_dotted)
obLevel = hline(70, title="Overbought", linestyle=hline.style_dotted)
osLevel = hline(30, title="Oversold", linestyle=hline.style_dotted)
fill(obLevel, osLevel, title="Background", color=#9915FF, transp=90)

plFound = na(pivotlow(osc, lbL, lbR)) ? false : true
phFound = na(pivothigh(osc, lbL, lbR)) ? false : true

_inRange(cond) =>
    bars = barssince(cond == true)
    rangeLower <= bars and bars <= rangeUpper

// Regular Bullish
// Osc: Higher Low

oscHL = osc[lbR] > valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])

// Price: Lower Low
priceLL = low[lbR] < valuewhen(plFound, low[lbR], 1)

bullCond = plotBull and priceLL and oscHL and plFound

plot(
     plFound ? osc[lbR] : na,
     offset=-lbR,
     title="Regular Bullish",
     linewidth=2,
     color=(bullCond ? bullColor : noneColor),
     transp=0
     )

plotshape(
     bullCond ? osc[lbR] : na,
     offset=-lbR,
     title="Regular Bullish Label",
     text=" Bull ",
     style=shape.labelup,
     location=location.absolute,
     color=bullColor,
     textcolor=textColor,
     transp=0
     )

// Hidden Bullish
// Osc: Lower Low

oscLL = osc[lbR] < valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])

// Price: Higher Low
priceHL = low[lbR] > valuewhen(plFound, low[lbR], 1)

hiddenBullCond = plotHiddenBull and priceHL and oscLL and plFound

plot(
     plFound ? osc[lbR] : na,
     offset=-lbR,
     title="Hidden Bullish",
     linewidth=2,
     color=(hiddenBullCond ? hiddenBullColor : noneColor),
     transp=0
     )

plotshape(
     hiddenBullCond ? osc[lbR] : na,
     offset=-lbR,
     title="Hidden Bullish Label",
     text=" H Bull ",
     style=shape.labelup,
     location=location.absolute,
     color=bullColor,
     textcolor=textColor,
     transp=0
     )

// Regular Bearish
// Osc: Lower High

oscLH = osc[lbR] < valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])

// Price: Higher High
priceHH = high[lbR] > valuewhen(phFound, high[lbR], 1)

bearCond = plotBear and priceHH and oscLH and phFound

plot(
     phFound ? osc[lbR] : na,
     offset=-lbR,
     title="Regular Bearish",
     linewidth=2,
     color=(bearCond ? bearColor : noneColor),
     transp=0
     )

plotshape(
     bearCond ? osc[lbR] : na,
     offset=-lbR,
     title="Regular Bearish Label",
     text=" Bear ",
     style=shape.labeldown,
     location=location.absolute,
     color=bearColor,
     textcolor=textColor,
     transp=0
     )

// Hidden Bearish
// Osc: Higher High

oscHH = osc[lbR] > valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])

// Price: Lower High
priceLH = high[lbR] < valuewhen(phFound, high[lbR], 1)

hiddenBearCond = plotHiddenBear and priceLH and oscHH and phFound

plot(
     phFound ? osc[lbR] : na,
     offset=-lbR,
     title="Hidden Bearish",
     linewidth=2,
     color=(hiddenBearCond ? hiddenBearColor : noneColor),
     transp=0
     )

plotshape(
     hiddenBearCond ? osc[lbR] : na,
     offset=-lbR,
     title="Hidden Bearish Label",
     text=" H Bear ",
     style=shape.labeldown,
     location=location.absolute,
     color=bearColor,
     textcolor=textColor,
     transp=0
     )
     
//♠️♥️♣️♦️END♠️♥️♣️♦️ <(^^,)>

 
Reaction
0 reactions

Below are the links to the videos.

Gambit's Royal Flush: https://1drv.ms/v/s!Am9z9dyatMCVjw_5duVP0NIPt1t9
Additional Indicators: https://1drv.ms/v/s!Am9z9dyatMCVjxbsDYTIftZy_sQH?e=bhzJgh
Binance Setup: https://1drv.ms/v/s!Am9z9dyatMCVjxcY9wqTgV6RewU0?e=uJUiul

♠️♥️♣️♦️<(^^,)>♠️♥️♣️♦️

 

 
Reaction
0 reactions