// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Phi-Deltalytics
//@version=4
study("COVID-19 Status by Country", overlay = false)
country = input(title = "Country", defval = "Japan", type = input.string, options = ["Japan"])
smaPeriod = input(title = "SMA Period", defval = 1)
symbolConfirmed = "COVID19:CONFIRMED_JP"
covidConfirmed = security(symbolConfirmed, "D", close, lookahead = barmerge.lookahead_on)
dailyConfirmed = security(symbolConfirmed, "D", close - close[1], lookahead = barmerge.lookahead_on)
covidConfirmedSma = security(symbolConfirmed, "D", sma(close - close[1],smaPeriod), lookahead = barmerge.lookahead_on)
lastBar = time_close[1] < timenow and time_close > timenow
charPlot1 = "J"
charPlot2 = "P"
//plot(dailyConfirmed, "Daily COVID19 Confirmed (Country Selected)", style=plot.style_histogram, linewidth = 3, transp = 50)
plot(covidConfirmedSma, "Daily COVID19 Confirmed SMA (Country Selected)", linewidth = 2, color = color.navy, transp = 30)
plotchar(lastBar, title = "Country/Area Initial", char = charPlot1, location = location.top, size = size.normal, color = color.gray, transp = 70)
plotchar(lastBar, title = "Country/Area Initial", char = charPlot2, location = location.bottom, size = size.normal, color = color.gray, transp = 70)
Created
March 20, 2021 05:09
-
-
Save nrm176/fa259370df8d2909ee1569cfd95e8a37 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment