Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // INPUTS
- //PUELL
- top = input.float(0.3, step=0.01, title = "Puell Top")
- bottom = input.float(2.13, step=0.01, title = "Puell Bottom")
- miningRevenue = request.security('QUANDL:BCHAIN/MIREV', 'D', close[1], barmerge.gaps_off, barmerge.lookahead_on)
- ma365 = request.security('QUANDL:BCHAIN/MIREV', 'D', ta.sma(close, 365)[1], barmerge.gaps_off, barmerge.lookahead_on)
- puellMultiple = miningRevenue / ma365
- puellTop = puellMultiple < top
- puellBottom = puellMultiple > bottom
- //SUPERTREND BASIC TV
- atrPeriod = input(6, "ATR Length")
- factor = input.float(1.25, "Factor", step = 0.01)
- [supertrend, direction] = ta.supertrend(factor, atrPeriod)
- supertrendLong = direction < 0
- supertrendShort = direction > 0
- //AROON
- length = input.int(14, minval=1)
- upper = 100 * (ta.highestbars(high, 14) + 14)/14
- lower = 100 * (ta.lowestbars(low, 14) + 14)/14
- aroonLong = upper >= lower
- aroonShort = upper <= lower
- //DMI
- lensig = input.int(4, title="ADX Smoothing", minval=1, maxval=50)
- len2 = input.int(8, minval=1, title="DI Length")
- [plus, minus, adx]=ta.dmi(len2, lensig)
- dmiLong = plus > minus
- dmiShort = plus < minus
- //FSVZO
- src0 = input.source (hlcc4 , 'Source')
- malen = input.int (21 , 'MA Length' , minval=1)
- len = 1
- 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))
- fsrc = vzo
- MaxH = ta.highest (fsrc , 6)
- MinL = ta.lowest (fsrc , 6)
- 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])
- fsvzoLong = f1 > f2
- fsvzoShort = not fsvzoLong
- src= input.source(hl2, group= 'rsi')
- rsiLength= input.int(11, group= 'rsi')
- rsi = ta.rsi(src, rsiLength)
- ysell= input.int(51)
- ybuy= input.int(61)
- longRSI = rsi > ybuy
- shortRSI = rsi < ysell
- //conditions
- buy_signal = longRSI and aroonLong and dmiLong and not puellTop and fsvzoLong
- sell_signal = shortRSI and aroonShort and dmiShort and not puellBottom and fsvzoShort
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement