Last active
February 28, 2021 20:26
-
-
Save jamesray1/9efc99f386c5b4fde2e26323ed8378c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//@version=4 | |
// | |
// @author jcray | |
// HOT/Holo Top, Mid and Bottom Cap Bands. Modified originally from Bitcoin Top/Average Cap scripts by aamonkey, and then from the ETH Cap Band script. | |
// | |
study("Holo Top, Mid and Bottom Cap Bands [jcray]",shorttitle="HOT Cap Bands [jcr]", overlay=true) | |
//input | |
mulTop = input(12.5, title = "Top Multiplier") | |
mulBottom = input(0.5, title = "Average Multiplier") | |
mulMid = avg(mulTop,mulBottom) | |
// https://etherscan.io/token/0x6c6ee5e31d828de241282b9606c8e98ea48526e2#tokenInfo | |
launchYear = input(2018, title = "Launch Year") | |
launchMonth = input(03, title = "Launch Month") | |
launchDay = input(29, 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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment