Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //@version=4
- //
- // @author jcray
- // ETH Top, Mid and Bottom Cap Bands. Modified from Bitcoin Top/Average Cap scripts by aamonkey
- //
- study("ETH Top, Mid and Bottom Cap Bands [jcray]",shorttitle="ETH Cap Bands [jcr]", overlay=true)
- //input
- mulTop = input(12.9, title = "Top Multiplier")
- mulBottom = input(0.5, title = "Average Multiplier")
- mulMid = avg(mulTop,mulBottom)
- launchYear = input(2015, title = "Launch Year")
- launchMonth = input(07, title = "Launch Month")
- launchDay = input(30, title = "Launch Day")
- //Getting start of chart
- date = valuewhen(bar_index==0, time, 0)
- //Converting start of chart
- secondsRaw = floor(date/ 1000)
- minutesRaw = floor(secondsRaw / 60)
- hoursRaw = floor(minutesRaw / 60)
- daysRaw = floor(hoursRaw / 24)
- //Launch timestamp of the ticker's network (ETH, BTC, etc.)
- launchTimestampTicker = timestamp(launchYear,launchMonth,launchDay,00,00)
- secondsRawB = floor(launchTimestampTicker / 1000)
- minutesRawB = floor(secondsRawB / 60)
- hoursRawB = floor(minutesRawB / 60)
- daysRawB = floor(hoursRawB / 24)
- //Calculation
- difference = daysRaw - daysRawB
- bottom = cum(close)/(difference+bar_index+1)
- mod_bottom = mulBottom*bottom
- mid = mulMid*bottom
- top = mulTop*bottom
- //Plot
- plot(mod_bottom, title="Bottom Cap", color = color.blue, linewidth = 3)
- plot(mid, title="Mid Cap", color = color.yellow, linewidth = 3)
- plot(top, title="Top Cap", color = color.red, linewidth = 3)
Add Comment
Please, Sign In to add comment