Skip to content

Instantly share code, notes, and snippets.

@guyb7
Created April 10, 2023 12:31
Show Gist options
  • Select an option

  • Save guyb7/a01644a5dd2ed5f243393234ec4ea500 to your computer and use it in GitHub Desktop.

Select an option

Save guyb7/a01644a5dd2ed5f243393234ec4ea500 to your computer and use it in GitHub Desktop.
Pine Script Buys/Sells
//@version=5
indicator("", "", true)
var string[] buys = array.from("2021-12-13","2021-12-03","2021-12-02","2021-11-22","2021-11-15","2021-11-08","2021-11-08","2021-02-26","2021-01-25","2021-01-22","2020-10-30","2020-10-29","2020-10-26","2020-09-25","2020-08-18")
var string[] sells = array.from("2022-10-05","2021-10-25","2021-08-31","2021-01-13")
bar_date = str.format_time(time, "yyyy-MM-dd", syminfo.timezone)
plotchar(array.includes(buys, bar_date), "Buy", "B", location.belowbar, color = color.green, size = size.small)
plotchar(array.includes(sells, bar_date), "Sell", "S", location.belowbar, color = color.red, size = size.small)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment