Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=5
- strategy("the list of all indicators for strats", overlay=true, pyramiding = 0, slippage = 1, initial_capital = 100, default_qty_type = strategy.percent_of_equity, default_qty_value = 100)
- //////////////////////////////////////////////////////////////////////////Main indicators////////////////////////////////////////////////////////////////////////
- //STC
- timeframe=input.timeframe(defval ='1D')
- EEEEEE = input.int(defval = 13, step = 1, title = "STC Length", group = "STC")
- BBBB = input.int(defval = 31, step = 1, title = "STC Fast Length", group = "STC")
- BBBBB = input.int(defval = 70, step = 1, title = "STC Slow Length", group = "STC")
- AAAA(BBB, BBBB, BBBBB) =>
- fastMA = ta.ema(BBB, BBBB)
- slowMA = ta.ema(BBB, BBBBB)
- AAAA = fastMA - slowMA
- AAAA
- AAAAA(EEEEEE, BBBB, BBBBB) =>
- AAA = 0.5
- var CCCCC = 0.0
- var DDD = 0.0
- var DDDDDD = 0.0
- var EEEEE = 0.0
- BBBBBB = AAAA(close, BBBB, BBBBB)
- CCC = ta.lowest(BBBBBB, EEEEEE)
- CCCC = ta.highest(BBBBBB, EEEEEE) - CCC
- CCCCC := CCCC > 0 ? (BBBBBB - CCC) / CCCC * 100 : nz(CCCCC[1])
- DDD := na(DDD[1]) ? CCCCC : DDD[1] + AAA * (CCCCC - DDD[1])
- DDDD = ta.lowest(DDD, EEEEEE)
- DDDDD = ta.highest(DDD, EEEEEE) - DDDD
- DDDDDD := DDDDD > 0 ? (DDD - DDDD) / DDDDD * 100 : nz(DDDDDD[1])
- EEEEE := na(EEEEE[1]) ? DDDDDD : EEEEE[1] + AAA * (DDDDDD - EEEEE[1])
- EEEEE
- mAAAAA = AAAAA(EEEEEE, BBBB, BBBBB)
- STClong = mAAAAA > mAAAAA[1]
- STCshort = mAAAAA < mAAAAA[1]
- STCLONG = request.security(syminfo.tickerid,timeframe , STClong)
- STCSHORT = request.security(syminfo.tickerid,timeframe,STCshort)
- // DMI
- LengthDMI = input.int(defval = 16, title = "DMI Length", group = 'DMI')
- LengthDMI_2 = input.int(defval = 16, title = "DMI Length_2", group = 'DMI')
- smoothing_lengthDMI = input.int(defval = 12, title = "DMI ADX Smoothing", group = 'DMI')
- [diplus, diminus, adx] = ta.dmi(LengthDMI, smoothing_lengthDMI)
- [diplus_2, diminus_2, adx_2] = ta.dmi(LengthDMI_2, smoothing_lengthDMI)
- DMIlong = diplus > diminus and adx > adx[1]
- DMIshort = diminus > diplus
- // DMIlong = ta.crossover(diplus, diminus) and ta.crossover(adx, adx[1])
- // DMIshort = ta.crossunder(diplus, diminus)
- DMIlong_2 = diplus_2 > diminus_2 and adx_2 > adx_2[1]
- DMIshort_2 = diminus_2 > diplus_2
- //////////////////////////////////////////////////////////////////////////filters////////////////////////////////////////////////////////////////////////
- // RTI
- trend_data_count = input.int(113, step=4, minval=10, title="Trend Length", inline = "RT", group="RTI")
- trend_sensitivity_percentage = input.int(95, step=1,minval=50, maxval=98,title='Sensitivity', inline = "RT1", group="RTI")
- upper_trend = close + ta.stdev(close, 2)
- lower_trend = close - ta.stdev(close, 2)
- upper_array = array.new<float>(0)
- lower_array = array.new<float>(0)
- for i = 0 to trend_data_count - 1
- upper_array.push(upper_trend[i])
- lower_array.push(lower_trend[i])
- upper_array.sort()
- lower_array.sort()
- upper_index = math.round(trend_sensitivity_percentage / 100 * trend_data_count) - 1
- lower_index = math.round((100 - trend_sensitivity_percentage) / 100 * trend_data_count) - 1
- UpperTrend = upper_array.get(upper_index)
- LowerTrend = lower_array.get(lower_index)
- RelativeTrendIndex = ((close - LowerTrend) / (UpperTrend - LowerTrend))*100
- RTIlong = RelativeTrendIndex > 50
- RTIshort = RelativeTrendIndex < 50
- // RTIlong = ta.crossover(RelativeTrendIndex, 50)
- // RTIshort = ta.crossunder(RelativeTrendIndex, 50)
- // Supertrend
- atrSupertrend = input.int(10, "ATR", group="Supertrend")
- factor = input.float(3, "Factor", step=0.05,group="Supertrend")
- [a, direction] = ta.supertrend(factor, atrSupertrend)
- // supertrend_Long = direction < 0
- // supertrend_Short = direction > 0
- supertrend_Long = ta.crossunder(direction, 0)
- supertrend_Short = ta.crossover(direction, 0)
- // rsi
- rsiLengthInput = input.int(14, minval=1, title="RSI Length", group="RSI Settings")
- rsiSourceInput = input.source(close, group="RSI Settings")
- uprsi = ta.rma(math.max(ta.change(rsiSourceInput), 0), rsiLengthInput)
- downrsi = ta.rma(-math.min(ta.change(rsiSourceInput), 0), rsiLengthInput)
- rsi = downrsi == 0 ? 100 : uprsi == 0 ? 0 : 100 - (100 / (1 + uprsi / downrsi))
- lengthrsiema = input.int(14, group="RSI Settings")
- RSIEMA = ta.ema(rsi,lengthrsiema)
- // RSIema_long = RSIEMA > 50
- RSIema_short = RSIEMA < 50
- RSIema_long = ta.crossover(RSIEMA, 50)
- // RSIema_short = ta.crossunder(RSIEMA, 50)
- rsi2 = ta.rsi(close, 21)
- RSI_long = rsi2 > 50
- RSI_short = rsi2 < 50
- //Aroon
- aroonlength = input.int(27, "Aroon UP", group = "Aroon")
- lowerlength = input.int(28,"Aroon Down", group = "Aroon")
- upper = 100 * (ta.highestbars(high, aroonlength+1) + aroonlength)/aroonlength
- lower = 100 * (ta.lowestbars(low, lowerlength+1) + lowerlength)/lowerlength
- oscillator1 = upper - lower
- smoothing1 = input.int(14, "Aroon Smoothing", group = "Aroon")
- oscillator = ta.ema(oscillator1, smoothing1)
- aroonup = input.int(7, "AroonUP lvl", group = "Aroon")
- aroondn = input.int(14,"AroonDN lvl", group = "Aroon")
- aroon_long = upper > aroonup
- aroon_short = lower > aroondn and oscillator < 75
- // Loxx supertrend
- RMA(x, t) =>
- EMA1 = x
- EMA1 := na(EMA1[1]) ? x : (x - nz(EMA1[1])) * (1/t) + nz(EMA1[1])
- EMA1
- fdip(float srcloxx, int per, int speedin)=>
- float fmax = ta.highest(srcloxx, per)
- float fmin = ta.lowest(srcloxx, per)
- float lengthloxx = 0
- float diff = 0
- for i = 1 to per - 1
- diff := (nz(srcloxx[i]) - fmin) / (fmax - fmin)
- if i > 0
- lengthloxx += math.sqrt( math.pow(nz(diff[i]) - nz(diff[i + 1]), 2) + (1 / math.pow(per, 2)))
- float fdi = 1 + (math.log(lengthloxx) + math.log(2)) / math.log(2 * per)
- float traildim = 1 / (2 - fdi)
- float alpha = traildim / 2
- int speed = math.round(speedin * alpha)
- speed
- pine_supertrend(float srcloxx, float factor, int atrPeriod) =>
- float atr = RMA(ta.tr(true), atrPeriod)
- float upperBand = srcloxx + factor * atr
- float lowerBand = srcloxx - factor * atr
- float prevLowerBand = nz(lowerBand[1])
- float prevUpperBand = nz(upperBand[1])
- lowerBand := lowerBand > prevLowerBand or close[1] < prevLowerBand ? lowerBand : prevLowerBand
- upperBand := upperBand < prevUpperBand or close[1] > prevUpperBand ? upperBand : prevUpperBand
- int directionloxx = na
- float superTrend = na
- float prevSuperTrend = superTrend[1]
- if na(atr[1])
- directionloxx := 1
- else if prevSuperTrend == prevUpperBand
- directionloxx := close > upperBand ? -1 : 1
- else
- directionloxx := close < lowerBand ? 1 : -1
- superTrend := directionloxx == -1 ? lowerBand : upperBand
- [superTrend, directionloxx]
- srcloxx = input.source(hl2, group = "Loxx")
- per = input.int(30, "Fractal Period Ingest", group = "Loxx")
- speed = input.int(20, "Speed", group = "Loxx")
- //Loxx input
- multloxx5 = input.float(5 , "1st Multiplier", group = "Loxx", step=0.1) //~using the same step as supertrend and *2 to test the robustness = 0.05*2 = 0.1
- multloxx2 = input.float(2 , "2nd Multiplier", group = "Loxx", step=0.1) //~
- multloxx3 = input.float(3 , "3rd Multiplier", group = "Loxx", step=0.1) //~
- multloxx1825 = input.float(1.825, "4th Multiplier", group = "Loxx", step=0.1) //~
- adaptloxx = input.bool(true)
- masterdom = fdip(srcloxx, per, speed)
- int lenloxx = math.floor(masterdom) < 1 ? 1 : math.floor(masterdom)
- lenloxx := nz(lenloxx, 1)
- [supertrendloxx5, directionloxx] = pine_supertrend(srcloxx, multloxx5, adaptloxx ? lenloxx : per)
- [supertrendloxx3, directionloxx3] = pine_supertrend(srcloxx, multloxx3, adaptloxx ? lenloxx : per)
- [supertrendloxx2, directionloxx2] = pine_supertrend(srcloxx, multloxx2, adaptloxx ? lenloxx : per)
- [supertrendloxx1825, directionloxx1825] = pine_supertrend(srcloxx, multloxx1825, adaptloxx ? lenloxx : per)
- // loxx_long = directionloxx == -1 and directionloxx[1] == 1
- // loxx_short = directionloxx == 1 and directionloxx[1] == -1
- loxx_long = close > supertrendloxx5
- loxx_short = close < supertrendloxx5
- loxx_long_2 = directionloxx2 == -1 and directionloxx2[1] == 1
- loxx_short_2 = directionloxx == 1 and directionloxx[1] == -1
- loxx_long_3 = directionloxx3 == -1 and directionloxx3[1] == 1
- loxx_short_3 = close < supertrendloxx3
- loxx_long_1_825 = close > supertrendloxx1825
- loxx_short_1_825 = close < supertrendloxx1825
- //adx
- adxlen = input(7, title="ADX Smoothing", group = "ADX")
- dilen = input(6, title="ADX_DI Length", group = "ADX")
- adx_crit = input(27, title="ADX Crit", group = "ADX")
- dirmov(len) =>
- up = ta.change(high)
- down = -ta.change(low)
- plusDM = na(up) ? na : (up > down and up > 0 ? up : 0)
- minusDM = na(down) ? na : (down > up and down > 0 ? down : 0)
- truerange = ta.rma(ta.tr, len)
- plus = fixnan(100 * ta.rma(plusDM, len) / truerange)
- minus = fixnan(100 * ta.rma(minusDM, len) / truerange)
- [plus, minus]
- adx(dilen, adxlen) =>
- [plus, minus] = dirmov(dilen)
- sum = plus + minus
- //adx = 100 * ta.rma(math.abs(plus - minus) / (sum == 0 ? 1 : sum), adxlen)
- sig = adx(dilen, adxlen)
- adx_up = sig > adx_crit
- adx_down = sig > adx_crit
- //longCondition =
- // STClong and ((DMIlong and DMIlong_2) or ((loxx_long_2 or loxx_long_3) and supertrend_Long and trend_up))
- // and (RSIema_long or RTIlong or roughlong or loxx_long or loxx_long_2 )
- //
- //shortCondition =
- // STCshort and (DMIshort and DMIshort_2) and (loxx_short_1_825 or loxx_short_3)
- // and (RSIema_short or RTIshort or roughshort or loxx_short or loxx_short_2 or (trend_down2 and trend_down2_2))
- //psar
- start = input(0.02)
- increment = input(0.02)
- maximum = input(0.2)
- psar = ta.sar(start, increment, maximum)
- // Signals
- psar_long = high[1] < psar[2] and high > psar[1]
- psar_short = low[1] > psar[2] and low < psar[1]
- // GET INPUTS FVZSO //----------------------------------------------------------------------------------
- src0 = input.source (close , 'Source', group = "VZO" )
- len = input.int (45 , 'VZO Length', group = "VZO" , minval=1)
- malen = input.int (7 , 'MA Length', group = "VZO" , minval=1)
- flen = input.int (7 , 'Fisher Length', group = "VZO", minval=1)
- col_1 = input.color(#22ab94,'Color 1')
- col_2 = input.color(#f7525f,'Color 2')
- // CALC VZO //------------------------------------------------------------------------------------
- zone(_src, _len) =>
- vol = volume
- src = ta.wma(2 * ta.wma(_src, malen / 2) - ta.wma(_src, malen), math.round(math.sqrt(malen)))
- vp = src > src[1] ? vol : src < src[1] ? -vol : src == src[1] ? 0 : 0
- z = 100 * (ta.ema(vp, _len) / ta.ema(vol, _len))
- vzo = request.security(syminfo.tickerid,"",zone(src0, len))
- // CALC FISHER //---------------------------------------------------------------------------------
- fsrc = vzo
- MaxH = ta.highest (fsrc , flen)
- MinL = ta.lowest (fsrc , flen)
- var nValue1 = 0.0
- var nFish = 0.0
- nValue1 := 0.33 * 2 * ((fsrc - MinL) / (MaxH - MinL) - 0.5) + 0.67 * nz(nValue1[1])
- nValue2 = (nValue1 > 0.99 ? 0.999 : (nValue1 < -0.99 ? -0.999: nValue1))
- nFish := 0.5 * math.log((1 + nValue2) / (1 - nValue2)) + 0.5 * nz(nFish[1])
- f1 = nFish
- f2 = nz(nFish[1])
- // PLOT //----------------------------------------------------------------------------------------
- col = f1 > f2 ? col_1 : col_2
- fzvzo_up = f1 > f2
- plot(f1 , color=col , title="Fisher" )
- plot(f2 , color=col , title="Trigger" )
- //DMI
- //lensig2 = input.int(34, title="ADX Smoothing", minval=1, maxval=50, group="DMI - Confluence 1")
- lensig2 = 34
- len2 = input.int(15, minval=1, title="DI Length", group="DMI - Confluence 1")
- up2 = ta.change(high)
- down2 = -ta.change(low)
- plusDM2 = na(up2) ? na : (up2 > down2 and up2 > 0 ? up2 : 0)
- minusDM2 = na(down2) ? na : (down2 > up2 and down2 > 0 ? down2 : 0)
- trur2 = ta.rma(ta.tr, len2)
- plus2 = fixnan(100 * ta.rma(plusDM2, len2) / trur2)
- minus2 = fixnan(100 * ta.rma(minusDM2, len2) / trur2)
- sum2 = plus2 + minus2
- adx2 = 100 * ta.rma(math.abs(plus2 - minus2) / (sum2 == 0 ? 1 : sum2), lensig2)
- dmi_long = ((plus2 > adx2) and (adx2 > 20) and (plus2 > 20)) or (((adx2 > adx2[1]) and (adx2[1] > adx2[2])) and (plus2 > adx2) and (adx2 >20)) or ((ta.crossover(plus2, minus2) and adx2 > 40)) or ((adx2 > 30) and (minus2 < plus2) and (plus2 > 25))
- dmi_up = ((plus2[0] > plus2[1]) and (plus2[0] > plus2[2]) and (plus2[0] > plus2[3])) and ((adx2 > adx2[1]) and (adx2[1] > adx2[2]) and (adx2[2] > adx2[3]))
- dmi_cross_up = ta.crossover(plus2, minus2)
- dmi_bottom = (adx2 > 55) and (minus2 > 40) and (plus2 <15)
- //or ((minus2 < 20) and (plus2 <20) and (adx2 < 35))
- dmi_short = ((ta.crossover(minus2, plus2) and adx2 > 20)) or ((adx2 > 32) and (minus2 > plus2)) or ((minus2 > adx2) and (adx2 > 40) and (minus2 > 25)) or (((adx2 > adx2[1]) and (adx2[1] > adx2[2])) and (minus2 > adx2) and (adx2 > 25)) or ((minus2 > plus2) and (adx2 >30))
- dmi_down = ((minus2[0] > minus2[1]) and (minus2[0] > minus2[2]) and (minus2[0] > minus2[3])) and ((adx2 > adx2[1]) and (adx2[1] > adx2[2]) and (adx2[2] > adx2[3]))
- dmi_cross_down = ta.crossover(minus2, plus2)
- dmi_top = (adx2 > 55) and (plus2 > 40) and (minus2 <15)
- //Bolinger Bands
- source = hlc3
- BB_Length = input.int(13, minval=1, group="BBANDS - Confluence 2")
- mult = input.float(2.3, title="BB Mult",minval=0.001, maxval=50, group="BBANDS - Confluence 2")
- basis = ta.sma(source, BB_Length)
- dev = mult * ta.stdev(source, BB_Length)
- upper = basis + dev
- lower = basis - dev
- bblong = source < upper
- bbshort = source > lower
- //AROON
- AROON_Length = input.int(5, minval=1, group="AROON")
- AROONupper = 100 * (ta.highestbars(high, AROON_Length+1) + AROON_Length)/AROON_Length
- AROONlower = 100 * (ta.lowestbars(low, AROON_Length+1) + AROON_Length)/AROON_Length
- aroon_bull = ta.crossover(AROONupper, AROONlower)
- aroon_bear = ta.crossunder(AROONupper, AROONlower)
- //aroon_long = AROONlower > AROONupper
- //aroon_short = AROONlower < AROONupper
- //STC
- //EEEEEE = input(14, 'LengthSTC', group="STC")
- ///BBBB = input(25, 'FastLengthSTC', group="STC")
- //BBBBB = input(60, 'SlowLengthSTC', group="STC")
- ///AAAA(BBB, BBBB, BBBBB) =>
- /// fastMA = ta.ema(BBB, BBBB)
- // slowMA = ta.ema(BBB, BBBBB)
- // AAAA = fastMA - slowMA
- /// AAAA
- //AAAAA(EEEEEE, BBBB, BBBBB) =>
- AAA = input(1.5, title="STC Factor", group="STC")
- var CCCCC = 0.0
- var DDD = 0.0
- var DDDDDD = 0.0
- var EEEEE = 0.0
- BBBBBB = AAAA(close, BBBB, BBBBB)
- CCC = ta.lowest(BBBBBB, EEEEEE)
- CCCC = ta.highest(BBBBBB, EEEEEE) - CCC
- CCCCC := CCCC > 0 ? (BBBBBB - CCC) / CCCC * 100 : nz(CCCCC[1])
- DDD := na(DDD[1]) ? CCCCC : DDD[1] + AAA * (CCCCC - DDD[1])
- DDDD = ta.lowest(DDD, EEEEEE)
- DDDDD = ta.highest(DDD, EEEEEE) - DDDD
- DDDDDD := DDDDD > 0 ? (DDD - DDDD) / DDDDD * 100 : nz(DDDDDD[1])
- EEEEE := na(EEEEE[1]) ? DDDDDD : EEEEE[1] + AAA * (DDDDDD - EEEEE[1])
- EEEEE
- //mAAAAA = AAAAA(EEEEEE, BBBB, BBBBB)
- stc_short = (mAAAAA[3] <= mAAAAA[2]) and (mAAAAA[2] >= mAAAAA[1]) and (mAAAAA > 40)
- stc_long = (mAAAAA[3] >= mAAAAA[2]) and (mAAAAA[2] <= mAAAAA[1]) and (mAAAAA < 60)
- stc_low = mAAAAA < 25
- stc_high = mAAAAA > 75
- //MACD
- MACD_Fast_Length = input(15, group="MACD")
- MACD_Slow_Length = input(200, group="MACD")
- MACD_Length = input(25, group="MACD")
- MACD = ta.ema(close, MACD_Fast_Length) - ta.ema(close, MACD_Slow_Length)
- aMACD = ta.ema(MACD, MACD_Length)
- delta = MACD - aMACD
- macd_long = MACD > aMACD
- macd_short = MACD < aMACD
- //Momentum
- length4 = input.int(10, title="Momentum Length", minval=1, group="Momentum Indicator")
- price = close
- momentum(seria, length4) =>
- mom = seria - seria[length4]
- mom
- mom0 = momentum(price, length4)
- mom1 = momentum( mom0, 1)
- mom_long = (mom0 > 0 and mom1 > 0)
- mom_short = (mom0 < 0 and mom1 < 0)
- //trend
- atrPeriod = input(200, "Trendline Length", group="Trendline Indicator")
- factor = input.float(2, "Trendline Factor", step = 0.01, group="Trendline Indicator")
- [_, direction] = ta.supertrend(factor, atrPeriod)
- trendlong = ta.change(direction) < 0
- trendshort = ta.change(direction) > 0
- //RSI
- //RSI_Length = input.int(14, minval=1, group="RSI - Confluence 3")
- rsi = ta.rsi(close, 14)
- rsi_over_sold = rsi < 37
- rsi_over_bought = rsi > 60
- rsi_high = rsi > 50
- rsi_low = rsi < 50
- //EMA
- fastEMA = ta.ema(close, 26)
- slowEMA = ta.ema(hlc3, 200)
- ema_long = fastEMA > slowEMA
- ema_short = fastEMA < slowEMA
- slow_ema_long = slowEMA > src
- slow_ema_short = slowEMA < src
- //VWAP
- vwap = ta.vwap(close)
- vwap_long = vwap > src
- vwap_short = vwap < src
- ///////////INDICATORS BEGIN - ONE AT A TIME, OPTIMISED FOR THE ASSET, BTC IN THIS CASE
- //HULL
- src = close
- modeSwitch = input.string("Thma", title="Hull Variation", options=["Thma"])
- length = input(178, title="Length(180-200 for floating S/R , 55 for swing entry)")
- lengthMult = input.float(1.0, title="Length multiplier (Used to view higher timeframes with straight band)")
- useHtf = input(false, title="Show Hull MA from X timeframe? (good for scalping)")
- htf = input("240", title="Higher timeframe")
- switchColor = input(false, "Color Hull according to trend?")
- candleCol = input(false, title="Color candles based on Hull's Trend?")
- visualSwitch = input(false, title="Show as a Band?")
- thicknesSwitch = input(1, title="Line Thickness")
- transpSwitch = input.int(40, title="Band Transparency", step=5)
- //FUNCTIONS
- //THMA
- THMA(_src, _length) => ta.wma(ta.wma(_src,_length / 3) * 3 - ta.wma(_src, _length / 2) - ta.wma(_src, _length), _length)
- //SWITCH
- Mode(modeSwitch, src, len) =>
- modeSwitch == "Thma" ? THMA(src, len/2) : na
- //OUT
- _hull = Mode(modeSwitch, src, int(length * lengthMult))
- HULL = useHtf ? request.security(syminfo.ticker, htf, _hull) : _hull
- MHULL = HULL[0]
- SHULL = HULL[2]
- ///////ANOTHER ONE
- //EMAs
- EMA_Length_1 = input.int(title="EMA 1 Length", group="EMA", defval=10)
- EMA_Length_2 = input.int(title="EMA 2 Length", group="EMA", defval=69)
- EMA_Length_3 = input.int(title="EMA 3 Length", group="EMA", defval=115)
- EMA1 = ta.ema(close, EMA_Length_1)
- EMA2 = ta.ema(close, EMA_Length_2)
- EMA3 = ta.ema(close, EMA_Length_3)
- ///////ANOTHER ONE
- // VR
- volatilityLower = input.float(title = "Lower Range", defval= -39, group = "VRG")
- volatilityHigher = input.float(title = "Higher Range", defval= 9)
- volatilityLength = 58
- volatilityRange = ta.sma(close - open, volatilityLength)
- ////////ANOTHER ONE
- //MACD
- FastLength = input(title="MACD Fast Length", group="MACD", defval=47)
- Slowlength = input(title="MACD Slow Length", group="MACD", defval=79)
- MACDLength = input(title="MACD Signal Length", group="MACD", defval=30)
- MACD = ta.ema(close, FastLength) - ta.ema(close, Slowlength)
- aMACD = ta.ema(MACD, MACDLength)
- delta = MACD - aMACD
- ////////YOU CAN PUT THESE STRAT PARAMETERS WITH THE INDICATOR THEMSELVES OR SEPARATE - I DID IT SEPARATE SO I COULD SEE THAT AND THE ENTRY CONDITIONS AT THE SAME TIME
- //STRATEGY PARAMETERS
- LongEMA = ta.crossover(EMA1, EMA2) or ta.crossover(EMA1, EMA3) or ta.crossover(EMA2, EMA3)
- ShortEMA = ta.crossunder(EMA1, EMA2) or ta.crossunder(EMA1, EMA3) or ta.crossunder(EMA2, EMA3)
- LongMACD = ta.crossover(delta, 0)
- ShortMACD = ta.crossunder(delta, 0)
- VRL = volatilityRange > volatilityLower
- VRS = volatilityRange < volatilityHigher
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- //STRATEGY
- //////////EACH BIT HAS A DEFINITION - START TIME FOR CONDITION AND EITHER LONG OR SHORT.
- start= timestamp(2012,1,1,0,0)
- timeCond = time > start
- Longoption1 = ta.crossover(MHULL, SHULL)
- Longoption2 = LongMACD
- Longoption3 = LongEMA
- Longoption4 = VRL
- Shortoption1 = ta.crossover(SHULL, MHULL)
- Shortoption2 = ShortMACD
- Shortoption3 = ShortEMA
- Shortoption4 = VRS
Advertisement
Comments
-
- download all types of premium tradingview indicators codes available on telegram - https://t.me/tradingview_premium_indicator
Add Comment
Please, Sign In to add comment
Advertisement