Skip to content

Instantly share code, notes, and snippets.

@itsfreddyrb
Created March 12, 2018 02:03
Show Gist options
  • Save itsfreddyrb/77d07b9e90f4dc6ace7cc0341544062f to your computer and use it in GitHub Desktop.
Save itsfreddyrb/77d07b9e90f4dc6ace7cc0341544062f to your computer and use it in GitHub Desktop.
levels
//@version=2
study("Levels", overlay = true)
showDay = input(true, "Previous Day")
showWeek = input(true, "Previous Week")
showMonth = input(true, "Previous Month")
plot(showDay ? security(tickerid, "D", close[1]) : na, title = "Previous Day Close", color = #00FFFF, linewidth = 1, style = circles)
plot(showDay ? security(tickerid, "D", high[1]) : na, title = "Previous Day High", color = #FF00FF, linewidth = 1, style = circles)
plot(showDay ? security(tickerid, "D", low[1]) : na, title = "Previous Day Low", color = #0033FF, linewidth = 1, style = circles)
plot(showWeek ? security(tickerid, "W", close[1]) : na, title = "Previous Week Close", color = #00FFFF, linewidth = 2, style = circles)
plot(showWeek ? security(tickerid, "W", high[1]) : na, title = "Previous Week High", color = #FF00FF, linewidth = 2, style = circles)
plot(showWeek ? security(tickerid, "W", low[1]) : na, title = "Previous Week Low", color = #0033FF, linewidth = 2, style = circles)
plot(showMonth ? security(tickerid, "M", close[1]) : na, title = "Previous Month Close", color = #00FFFF, linewidth = 3, style = circles)
plot(showMonth ? security(tickerid, "M", high[1]) : na, title = "Previous Month High", color = #FF00FF, linewidth = 3, style = circles)
plot(showMonth ? security(tickerid, "M", low[1]) : na, title = "Previous Month Low", color = #0033FF, linewidth = 3, style = circles)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment