Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=3
- //test
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦ VOLATTITLITY PRICE ¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- sTitle = "Dynamic Support And Resistance "
- sShort = "📊 DSAR ®"
- sRelease = "2018-7-21"
- sOverlay = true
- sScale = scale.right
- sPrecision = 0
- // strategy(title=sTitle+" [v"+sRelease+"]", shorttitle=sShort, overlay=sOverlay, scale=sScale, precision=sPrecision,
- // initial_capital=sInitial_capital, commission_value=sCommission_value, pyramiding=sPyramiding,
- // default_qty_type=sDefault_qty_type, default_qty_value=sDefault_qty_value, calc_on_order_fills=sCalc_on_order_fills)
- study(title=sTitle+" [v"+sRelease+"]", shorttitle=sShort, overlay=sOverlay, scale=sScale, precision=sPrecision)
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?DEFAULT SETTINGS?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- defLongLen = 390
- defLongTF = 0
- defShortLen = 70
- defShortTF = 0
- //INPUTS
- //INPUTS
- defLongDev = "price"
- defLongDev1 = 1.28
- defLongDev2 = 2.01
- defLongDev3 = 2.51
- defLongDev4 = 3.09
- defLongDev5 = 4.01
- defShortDev = "price"
- defShortDev1 = 0.00
- defShortDev2 = 0.00
- defShortDev3 = 0.0
- defShortDev4 = 0.00
- defShortDev5 = 0.00
- defShowLongBands = "[4] Standard to Bronze"
- defShowShortBands = "[4] Standard to Bronze"
- defThemeLongShade = "Dark"
- defThemeColorAboveLong = "01 Red"
- defThemeColorBelowLong = "12 Blue"
- defThemeLongCenter = "Light Grey"
- defThemeShortShade = "Dark"
- defThemeColorAboveShort = "01 Red"
- defThemeColorBelowShort = "12 Blue"
- defThemeShortCenter = "Light Grey"
- defThemeMiniShade = "Dark"
- defThemeColorAboveMini = "01 Red"
- defThemeColorBelowMini = "08 Green"
- defThemeMiniCenter = "Light Cyan"
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?FUNCTION INPUTS?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // VWAP Length (average over N bars back)
- longLength = input( title="Length (bars back)", type=integer, defval=defLongLen, minval=1 )
- multiplier = input(1, minval=0,maxval=20, title="time multiplier")
- vol = volume
- src = close
- // Calculate Anchor Length Multiplier from Period
- func_intbyMints() =>
- intMints = 0.0
- intMints := isintraday ? interval :
- isdaily ? interval * 24 * 60 :
- isweekly ? interval * 7 * 24 * 60 :
- ismonthly ? interval * 4 * 7 * 24 * 60 : interval
- intMints // output
- anchor = multiplier * func_intbyMints()
- mult = not interval or anchor==1 or interval>=anchor or anchor>10000 ? 1 : round(anchor/interval)>1? round(anchor/interval) : 1
- mult := interval or anchor==1 or interval>=anchor or anchor>1 ? mult: round(anchor/interval)>1? round(anchor/interval) : 1
- longerLength = mult==1 ? longLength : (longLength * multiplier)
- sorce = input(defval=close, title='Source')
- fslen = input(defval=13, title='Fast Ma', minval=5)
- melen = input(defval=21, title='Medium Ma', minval=8)
- sllen = input(defval=34, title='Slow Ma', minval=13)
- brkfb = input(defval=1.13, title='Breaking', minval=0.62, step=0.02)
- multx = input(1,'Multiplier', minval=1)
- func_linx_WSMA(_val, _len) =>
- ema(_val, (_len*2)-1)
- func_linx_TEMA(_val, _len) =>
- ema1 = ema(_val, _len)
- ema2 = ema(ema1, _len)
- ema3 = ema(ema2, _len)
- tema = 3 * (ema1 - ema2) + ema3
- out = nz(tema)
- func_linx_DEMA(_val, _len) =>
- out1 = ema(_val, _len)
- out2 = ema(out1, _len)
- out = 2 * out1 - out2
- func_linx_EHMA(_val, _len) =>
- out = ema(2*ema(nz(_val), _len/2)-ema(nz(_val), _len), round(sqrt(_len)))
- func_linx_MHLMA(_val, _len) =>
- HHH = highest(high,round(_len*0.66))
- LLL = lowest(low,round(_len*0.66))
- MHL = avg(avg(HHH,LLL),_val)
- MHT1 = func_linx_DEMA( MHL,round(_len*0.66))
- MHT2 = func_linx_EHMA( MHT1,round(_len*0.66))
- Miff = MHT1 - MHT2
- ZLML = MHT1 + Miff
- TEMHL = func_linx_EHMA(ZLML,round(_len*1.32))
- out = func_linx_EHMA(TEMHL,_len)
- // 8- Hull Moving Average
- func_linx_HULL(_val, _len) =>
- out = wma(2*wma(nz(_val), _len/2)-wma(nz(_val), _len), round(sqrt(_len)))
- func_linx_Steep(_val, _len, _tf) =>
- isP = false, isM = true , mnts =func_intbyMints()
- iTF = nz(_tf) >= 1 ? nz(_tf) : 1
- dec = abs(log(syminfo.mintick*syminfo.pointvalue) / log(10))
- mPi = 3.141592653589793 , tang = 180
- val = nz(_val) , len = nz(_len) //Rise (Fall) / Run - Price Diff => rise-fall / number of bars - run
- slp = ((change(val,len))*100)/len
- out = isP ? isM ? ((slp/mnts)*iTF)*pow(10,dec) : slp*pow(10,2) : isM ? (((atan(slp/100)/mPi*tang)/mnts)*iTF)*pow(10,dec) : (atan(slp/100)/mPi*tang)*pow(10,2)
- func_linx_3732(_val) =>
- (.5 * _val + .866* _val[1] + 1* _val[2] + .866 * _val[3]+.5 * _val[4] ) / 3.732
- func_slope(v,l)=>(linreg(v,l,0)-linreg(v,l,0)[l])/l // orj
- fnVWAPp(Price, Weight, Length) => sum(Price * Weight, Length ) / sum(Weight, Length)
- MC = sorce////
- s1 = func_slope(MC,fslen)
- s2 = func_slope(MC,melen)
- s3 = func_slope(MC,sllen)
- Price = MC , Price := s1 > 0 and s2 > 0 and s3 > 0 ? lowest(MC,sllen) : s1 < 0 and s2 < 0 and s3 < 0 ? highest(MC,sllen): nz(Price[1])
- Price := func_linx_MHLMA(Price, melen) //
- chup = Price+ (atr(sllen)*brkfb), chdw = Price- (atr(sllen)*brkfb)
- crng = (chup-chdw), zone =(chup-chdw)*0.240
- bullSignal = crossover(s1, s3)
- bearSignal = crossunder(s1, s3)
- alertcondition(bullSignal,title="BUY Alert",message="BUY Alert")
- alertcondition(bearSignal,title="SELL Alert",message="SELL Alert")
- //enableScalpGuides = input(true, title="Mini Scalper Engage?")
- //________________________________
- // LONG TIMEFRAME SETTINGS
- enableLong = input(true, title="Long Bands[On/Off]")
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?LONG DEVIATION INPUT SETTINGS?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- showLongBands = defShowLongBands
- // Long Standard Deviations Parameters (default: Metallic Means)
- longDev1 = defLongDev1 // Zero ratio (Fib ratio n=0)
- longDev2 = defLongDev2 // Golden ratio (Fib ratio n=1)
- longDev3 = defLongDev3 // Silver ratio (Fib ratio n=2)
- longDev4 = defLongDev4 // Bronze ratio (Fib ratio n=3)
- longDev5 = defLongDev5 // Copper ratio (Fib ratio n=4)
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?LONG TIMEFRAME INPUTS?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- themeLongShade = input(title="🎨 shade", type=string, defval=defThemeLongShade,
- options=["Dark", "Light"])
- // Long: Color selection for each side
- themeColorAboveLong = input(title="🎨 🔼", type=string, defval=defThemeColorAboveLong,
- options=["01 Red","08 Green","12 Blue","04 Black"])
- themeColorBelowLong = input(title="🎨 🔽", type=string, defval=defThemeColorBelowLong,
- options=["01 Red", "08 Green","12 Blue","04 Black"])
- // Long alternating fill selector (bullish/bearish)
- longFillAlt = input(false, title="📈/📉")
- // Center and "opposite" bands (other side of the mean)
- themeLongCenter = defThemeLongCenter
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?SHORT TIMEFRAME INPUT?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- enableShort = input(true, title="Short Bands[On/Off]")
- // VWAP Length
- shortLength = input( title="Length (bars back)", type=integer, defval=defShortLen, minval=1 )
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?DEVIATION INPUTS?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- showShortBands = defShowShortBands
- // Standard Deviations Parameters (default: Metallic Means)type = float, step = 0.1)
- shortDev1 = defShortDev1 // Zero ratio (Fib ratio n=0)
- shortDev2 = defShortDev2 // Golden ratio (Fib ratio n=1)
- shortDev3 = defShortDev3 // Silver ratio (Fib ratio n=2)
- shortDev4 = defShortDev4 // Bronze ratio (Fib ratio n=3)
- shortDev5 = defShortDev5 // Copper ratio (Fib ratio n=4)
- // Fine-tune volume weight and deviations
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?THEMES?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // Short shades (Dark to Light)
- themeShortShade = input(title="🎨 shade", type=string, defval=defThemeShortShade,
- options=["Dark", "Light"])
- // Short: Color selection for each side
- themeColorAboveShort = input(title="🎨 🔼", type=string, defval=defThemeColorAboveShort,
- options=["01 Red", "08 Green","12 Blue","04 Black"])
- themeColorBelowShort = input(title="🎨 🔽 ", type=string, defval=defThemeColorBelowShort,
- options=["01 Red","08 Green","12 Blue","04 Black"])
- // Short alternating fill selector (bullish/bearish)
- shortFillAlt = input(false, title="📈/📉")
- // Short alternating fill selector (bullish/bearish)
- MiniFillAlt = input(false, title="m📈/m📉")
- // Center and "opposite" bands (other side of the mean)
- themeShortCenter =defThemeShortCenter
- enableScalpGuides = input(false, title="Bell Algo")
- enableBuyandSell = input(true, title= "Buy/Sell")
- //Mini Theme
- themeMiniShade = input(title="🎨", type=string, defval=defThemeMiniShade,
- options=["Dark", "Light"])
- // Short: Color selection for each side
- themeColorAboveMini = input(title="🎨 🔼", type=string, defval=defThemeColorAboveMini,
- options=["01 Red", "08 Green"])
- themeColorBelowMini = input(title="🎨 🔽", type=string, defval=defThemeColorBelowMini,
- options=["01 Red","08 Green"])
- // Center and "opposite" bands (other side of the mean)
- themeMiniCenter = defThemeMiniCenter
- plotshape( enableBuyandSell == true ? bearSignal : na , title="BUY NOW", location = location.abovebar,style=shape.triangledown, text="BEAR", color=#EF5350, transp=0)
- plotshape( enableBuyandSell == true ? bullSignal : na , title="SELL IT",location = location.belowbar, style=shape.triangleup, text="BULL", color=#2196F3, transp=0)
- fnVWAP(Price, Weight, Length) => sum(Price * Weight, Length ) / sum(Weight, Length)
- longSMA = sma(src,longerLength)
- shortSMA = sma(src,shortLength)
- longfnWeightedStDev(Price, Weight, Length) => sqrt( sum(Weight * pow(Price-longSMA, 2), Length ) / sum(Weight, Length) )
- shortfnWeightedStDev(Price, Weight, Length) => sqrt( sum(Weight * pow(Price-shortSMA , 2), Length ) / sum(Weight, Length) )
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ? CALCULATE?
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦???¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // Evaluate if long and short deviation multipliers are the same (otherwise use short value).
- shortDev1 := shortDev1 == 0 ? longDev1 : shortDev1
- shortDev2 := shortDev2 == 0 ? longDev2 : shortDev2
- shortDev3 := shortDev3 == 0 ? longDev3 : shortDev3
- shortDev4 := shortDev4 == 0 ? longDev4 : shortDev4
- shortDev5 := shortDev5 == 0 ? longDev5 : shortDev5
- longPrice = src
- longVolume = vol
- shortPrice = src
- shortVolume = vol
- shortTime = anchor
- longTime = anchor
- // VWAP
- longMean = fnVWAP( longPrice, longVolume, longerLength)
- shortMean = fnVWAP(shortPrice, shortVolume, shortLength)
- //hold_me = crossover(longTime,longPrice)
- //alertcondition(hold_me,title="Hold Alert", message="HOLD Alert")
- // WEIGHTED STANDARD DEVIATION
- longDeviation = longfnWeightedStDev( longPrice, longTime, longerLength)
- shortDeviation = shortfnWeightedStDev(shortPrice, shortTime,shortLength)
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦??¦¦¦¦¦¦¦
- // ?Deviations?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // Which long lines to calculate and draw
- showLongDev5 = showLongBands=="[5] All"
- showLongDev4 = showLongBands=="[4] Standard to Bronze" or showLongDev5
- showLongDev3 = showLongBands=="[3] Stardard to Silver" or showLongDev4
- showLongDev2 = showLongBands=="[2] Standard & Golden" or showLongDev3
- showLongDev1 = showLongBands=="[1] Standard Deviation" or showLongDev2
- showLongMean = showLongBands=="VWAP only" or showLongDev1
- // Which short lines to calculate and draw
- showShortDev5 = showShortBands=="[5] All"
- showShortDev4 = showShortBands=="[4] Standard to Bronze" or showShortDev5
- showShortDev3 = showShortBands=="[3] Stardard to Silver" or showShortDev4
- showShortDev2 = showShortBands=="[2] Standard & Golden" or showShortDev3
- showShortDev1 = showShortBands=="[1] Standard Deviation" or showShortDev2
- showShortMean = showShortBands=="VWAP only" or showShortDev1
- // Long Timeframe above*
- longDevLineAbove1 = showLongDev1 ? longMean + ( longDev1 * longDeviation ) : na
- longDevLineAbove2 = showLongDev2 ? longMean + ( longDev2 * longDeviation ) : na
- longDevLineAbove3 = showLongDev3 ? longMean + ( longDev3 * longDeviation ) : na
- longDevLineAbove4 = showLongDev4 ? longMean + ( longDev4 * longDeviation ) : na
- longDevLineAbove5 = showLongDev5 ? longMean + ( longDev5 * longDeviation ) : na
- // Long Timeframe below
- longDevLineBelow1 = showLongDev1 ? longMean - ( longDev1 * longDeviation ) : na
- longDevLineBelow2 = showLongDev2 ? longMean - ( longDev2 * longDeviation ) : na
- longDevLineBelow3 = showLongDev3 ? longMean - ( longDev3 * longDeviation ) : na
- longDevLineBelow4 = showLongDev4 ? longMean - ( longDev4 * longDeviation ) : na
- longDevLineBelow5 = showLongDev5 ? longMean - ( longDev5 * longDeviation ) : na
- // Short Timeframe above
- shortDevLineAbove1 = showShortDev1 ? shortMean + ( shortDev1 * shortDeviation ) : na
- shortDevLineAbove2 = showShortDev2 ? shortMean + ( shortDev2 * shortDeviation ) : na
- shortDevLineAbove3 = showShortDev3 ? shortMean + ( shortDev3 * shortDeviation ) : na
- shortDevLineAbove4 = showShortDev4 ? shortMean + ( shortDev4 * shortDeviation ) : na
- shortDevLineAbove5 = showShortDev5 ? shortMean + ( shortDev5 * shortDeviation ) : na
- // Long Timeframe below
- shortDevLineBelow1 = showShortDev1 ? shortMean - ( shortDev1 * shortDeviation ) : na
- shortDevLineBelow2 = showShortDev2 ? shortMean - ( shortDev2 * shortDeviation ) : na
- shortDevLineBelow3 = showShortDev3 ? shortMean - ( shortDev3 * shortDeviation ) : na
- shortDevLineBelow4 = showShortDev4 ? shortMean - ( shortDev4 * shortDeviation ) : na
- shortDevLineBelow5 = showShortDev5 ? shortMean - ( shortDev5 * shortDeviation ) : na
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?DESIGN?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦??¦¦¦??¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- red20 = #EF9A9A
- red30 = #E57373
- red50 = #F44336
- red70 = #EF5350
- red90 = #EF5350
- black00 = #000000
- blue20 = #90CAF9
- blue30 = #64B5F6
- blue50 = #2196F3
- blue70 = #1976D2
- blue90 = #0D47A1
- green20 = #A5D6A7
- green30 = #81C784
- green50 = #4CAF50
- green70 = #4CAF50
- green90 = #4CAF50
- grey20 = #EEEEEE
- grey30 = #E0E0E0
- grey40 = #BDBDBD
- grey50 = #9E9E9E
- grey70 = #616161
- grey80 = #424242
- grey90 = #212121
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?COLOR THEMES?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦???¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // work out the shade here first, then plug that variable into colorAbove and colorBelow
- colorLongRed = themeLongShade=="Dark" ? red90 : red70
- colorLongBlue = themeLongShade=="Dark" ? blue90 : blue70
- colorLongGreen = themeLongShade=="Dark" ? green90 : green70
- colorLongGrey = themeLongShade=="Dark" ? grey30 : grey30
- colorShortRed = themeShortShade=="Dark" ? red90 : red70
- colorShortBlue = themeShortShade=="Dark" ? blue90 : blue70
- colorShortGreen = themeShortShade=="Dark" ? green90 : green70
- colorShortGrey = themeShortShade=="Dark" ? grey30 : grey30
- colorLongBlack = themeLongShade=="Dark" ? black00 : black00
- colorShortBlack = themeShortShade=="Dark" ? black00 : black00
- //MINI SCALP THEME
- colorMiniBlack = themeMiniShade=="Dark" ? black00 : black00
- //MINI SCALP THEME
- colorMiniRed = themeMiniShade=="Dark" ? red90 : red70
- colorMiniGreen = themeMiniShade=="Dark" ? green90 : green70
- colorMiniGrey = themeMiniShade=="Dark" ? grey30 : grey30
- colorAboveMini =
- themeColorAboveMini=="01 Red" ? colorLongRed :
- themeColorAboveMini=="08 Green" ? colorLongGreen :
- colorMiniGrey
- colorBelowMini =
- themeColorBelowMini=="01 Red" ? colorShortRed :
- themeColorBelowMini=="08 Green" ? colorShortGreen :
- colorMiniGrey
- colorAboveLong =
- themeColorAboveLong=="01 Red" ? colorLongRed :
- themeColorAboveLong=="08 Green" ? colorLongGreen :
- themeColorAboveLong=="12 Blue" ? colorLongBlue :
- themeColorAboveLong=="04 Black" ? colorLongBlack :
- colorLongGrey
- colorBelowLong =
- themeColorBelowLong=="01 Red" ? colorLongRed :
- themeColorBelowLong=="08 Green" ? colorLongGreen :
- themeColorBelowLong=="12 Blue" ? colorLongBlue :
- themeColorBelowLong=="04 Black" ? colorLongBlack :
- colorLongGrey
- colorAboveShort =
- themeColorAboveShort=="01 Red" ? colorShortRed :
- themeColorAboveShort=="08 Green" ? colorShortGreen :
- themeColorAboveShort=="12 Blue" ? colorShortBlue :
- themeColorAboveShort=="04 Black" ? colorShortBlack :
- colorShortGrey
- colorBelowShort =
- themeColorBelowShort=="01 Red" ? colorShortRed :
- themeColorBelowShort=="08 Green" ? colorShortGreen :
- themeColorBelowShort=="12 Blue" ? colorShortBlue :
- themeColorBelowShort=="04 Black" ? colorShortBlack :
- colorShortGrey
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦??¦¦¦??¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?FILL POINTS FOR BULLISH/BEARISH?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- longFillCenter = themeLongCenter=="Light Grey" ? grey40 : themeLongCenter=="Dark Grey" ? grey90 : themeLongCenter=="Red" ? red : blue
- shortFillCenter = themeShortCenter=="Light Grey" ? grey40 : themeLongCenter=="Dark Grey" ? grey90 : themeLongCenter=="Red" ? red : blue
- MiniFillCenter = themeMiniCenter== "Light Cyan" ? green90 : themeMiniCenter=="Light Grey" ? grey40 :themeMiniCenter=="Dark Grey" ? grey90 : themeMiniCenter=="Red" ? red : blue
- isLongBullish = close > longMean
- fillLongAbove = not(isLongBullish) and longFillAlt ? longFillCenter : colorAboveLong
- fillLongBelow = isLongBullish and longFillAlt ? longFillCenter : colorBelowLong
- // Short bands fill color
- isShortBullish = close > shortMean
- fillShortAbove = not(isShortBullish) and shortFillAlt ? shortFillCenter : colorAboveShort
- fillShortBelow = isShortBullish and shortFillAlt ? shortFillCenter : colorBelowShort
- // Short bands fill color
- isMiniBullish = close > Price
- fillMiniAbove = not(isMiniBullish) and MiniFillAlt ? MiniFillCenter : colorAboveMini
- fillMiniBelow = isMiniBullish and MiniFillAlt ? MiniFillCenter : colorBelowMini
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // ?PLOT?
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦???¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- //plotshape( enableBuyandSell == true ? hold_me : na , title="Breakout Up", style=shape.arrowup, location=location.belowbar, size=size.auto, text="HOLD!", color=purple, transp=0)
- plot(enableScalpGuides ? Price : na , title='Median',join=false, transp=0, color=MiniFillCenter )
- plot(enableScalpGuides ? chup : na , title='Up' ,join=false, transp=0, color=colorAboveMini )
- plot(enableScalpGuides ? chdw : na , title='Dw' ,join=false, transp=0, color=fillMiniBelow )
- plot(enableScalpGuides ? chup+(crng*multx) : na , title='Up' ,join=false, transp=0, color=colorAboveMini )
- plot(enableScalpGuides ? chdw-(crng*multx) : na , title='Dw' ,join=false, transp=0, color=colorBelowMini)
- plot(enableScalpGuides ? chup[multx]+((crng+zone)*multx) : na , title='Up' ,join=false, transp=0, color=colorAboveMini )
- plot(enableScalpGuides ? chdw[multx]-((crng+zone)*multx) : na , title='Dw' ,join=false, transp=0, color=colorBelowMini )
- //plot(enableScalpGuides ? MinMd : na , title='Dw' ,join=false, transp=0, color=red )
- // Means
- mainLongMean = plot(enableLong ? longMean : na, title="------ MEAN (LONG) -------", linewidth=1, style=circles, join=false, transp=0, color=grey80)
- mainShortMean =plot(enableShort ? shortMean : na, title="------ MEAN (SHORT) ------", linewidth=1, style=circles , join=false, join=false, transp=0, color=grey80)
- // Long Deviation Lines
- longAbove1 = plot( enableLong ? longDevLineAbove1 : na, title="[1??] Standard Deviation (SELL?)", style=circles, join=false, transp=0 , color = grey50 )
- longAbove2 = plot( enableLong ? longDevLineAbove2 : na, title="[2??] Golden Dev. Above ", style=circles, join=false, transp=0 , color = colorAboveLong )
- longAbove3 = plot( enableLong ? longDevLineAbove3 : na, title="[3??] Silver Dev. Above ", style=circles, join=false, transp=0 , color = colorAboveLong )
- longAbove4 = plot( enableLong ? longDevLineAbove4 : na, title="[4??] Bronze Dev. Above ", style=circles, join=false, transp=0 , color = colorAboveLong )
- longBelow1 = plot( enableLong ? longDevLineBelow1 : na, title="[1??] Standard Deviation (BUY?)", style=circles, join=false, transp=0 , color = grey50 )
- longBelow2 = plot( enableLong ? longDevLineBelow2 : na, title="[2??] Golden Dev. Below ", style=circles, join=false, transp=0 , color = colorBelowLong )
- longBelow3 = plot( enableLong ? longDevLineBelow3 : na, title="[3??] Silver Dev. Below ", style=circles, join=false, transp=0 , color = colorBelowLong )
- longBelow4 = plot( enableLong ? longDevLineBelow4 : na, title="[4??] Bronze Dev. Below ", style=circles, join=false, transp=0 , color = colorBelowLong )
- //longAbove5 = plot( enableLong ? longDevLineAbove5 : na, title="[5??] Copper Dev. Above ", style=circles, join=false, transp=100, color=green )
- //longBelow5 = plot( enableLong ? longDevLineBelow5 : na, title="[5??] Copper Dev. Below ", style=circles, join=false, transp=100, color=colorBelowLong )
- // Short Deviation Lines
- shortAbove1 = plot( enableShort? shortDevLineAbove1 : na, title="[1??] Standard Deviation (SELL?)", style=circles, join=false, transp=0, color=grey50 )
- shortAbove2 = plot( enableShort? shortDevLineAbove2 : na, title="[2??] Golden Dev. Above ", style=circles, join=false, transp=0, color=colorAboveShort )
- shortAbove3 = plot( enableShort? shortDevLineAbove3 : na, title="[3??] Silver Dev. Above ", style=circles, join=false, transp=0, color=colorAboveShort )
- shortAbove4 = plot( enableShort? shortDevLineAbove4 : na, title="[4??] Bronze Dev. Above ", style=circles, join=false, transp=0, color=colorAboveShort )
- shortBelow1 = plot( enableShort? shortDevLineBelow1 : na, title="[1??] Standard Deviation (BUY?)", style=circles, join=false, transp=0, color=grey50 )
- shortBelow2 = plot( enableShort? shortDevLineBelow2 : na, title="[2??] Golden Dev. Below ", style=circles, join=false, transp=0, color=colorBelowShort )
- shortBelow3 = plot( enableShort? shortDevLineBelow3 : na, title="[3??] Silver Dev. Below ", style=circles, join=false, transp=0, color=colorBelowShort )
- shortBelow4 = plot( enableShort? shortDevLineBelow4 : na, title="[4??] Bronze Dev. Below ", style=circles, join=false, transp=0, color=colorBelowShort )
- //shortAbove5 = plot( enableShort? shortDevLineAbove5 : na, title="[5??] Copper Dev. Above ", style=circles, join=false, transp=0, color=purple )
- //shortBelow5 = plot( enableShort? shortDevLineBelow5 : na, title="[5??] Copper Dev. Below ", style=circles, join=false, transp=0, color=colorBelowShort )
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // FILL PLOT
- //
- //¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦¦
- // Long Bands Fill
- fill ( longBelow1, longAbove1, transp=90, color=longFillCenter , title="------ Fill: 1 SD Band around Long Mean ------")
- fill ( longAbove1, longAbove4, transp=80, color=fillLongAbove , title="------ Fill: 1 SD Band around Long Mean ------")
- fill ( longBelow1, longBelow4, transp=80, color=fillLongBelow, title="[2??] Long Oversold (Golden Band)" )
- //fill ( longAbove1, longAbove2, transp=80, color=fillLongAbove, title="[2??] Long Overbought (Golden Band)" )
- //fill ( longAbove2, longAbove3, transp=80, color=fillLongAbove, title="[3??] Long Overbought (Silver Band)" )
- //fill ( longAbove3, longAbove4, transp=80, color=fillLongAbove, title="[4??] Long Overbought (Bronze Band)" )
- //fill ( longAbove4, longAbove5, transp=80, color=fillLongAbove, title="[5??] Long Overbought (Copper Band)" )
- //fill ( longBelow2, longBelow3, transp=80, color=fillLongBelow, title="[3??] Long Oversold (Silver Band)" )
- //fill ( longBelow3, longBelow4, transp=80, color=fillLongBelow, title="[4??] Long Oversold (Bronze Band)" )
- //fill ( longBelow4, longBelow5, transp=80, color=fillLongBelow, title="[5??] Long Oversold (Copper Band)" )
- // Short Bands fill
- fill ( shortBelow1, shortAbove1, transp=90, color=shortFillCenter , title="------ Fill 1 SD Band around Short Mean ------")
- fill ( shortAbove1, shortAbove4, transp=80, color=fillShortAbove, title="------ Fill 1 SD Band around Short Mean ------")
- fill ( shortBelow1, shortBelow4, transp=80, color=fillShortBelow, title="[2??] Short Oversold (Golden Band)" )
- //fill ( shortAbove1, shortAbove2, transp=80, color=fillShortAbove, title="[2??] Short Overbought (Golden Band)" )
- //fill ( shortAbove2, shortAbove3, transp=80, color=fillShortAbove, title="[3??] Short Overbought (Silver Band)" )
- //fill ( shortAbove3, shortAbove4, transp=80, color=fillShortAbove, title="[4??] Short Overbought (Bronze Band)" )
- //fill ( shortAbove4, shortAbove5, transp=80, color=fillShortAbove, title="[5??] Short Overbought (Copper Band)" )
- //fill ( shortBelow2, shortBelow3, transp=80, color=fillShortBelow, title="[3??] Short Oversold (Silver Band)" )
- //fill ( shortBelow3, shortBelow4, transp=80, color=fillShortBelow, title="[4??] Short Oversold (Bronze Band)" )
- //fill ( shortBelow4, shortBelow5, transp=80, color=fillShortBelow, title="[5??] Short Oversold (Copper Band)" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement