youngPadawan
Pine Script Rookie
Pine Script Rookie
Posts: 1
Joined: May 26th, 2021

How to draw a vertical line on a specific date

I'm trying to draw two vertical lines two specific dates to produce a range and then fill in the bicolor or fill with a specific color. Any help would be appreciated.

processingclouds
Pine Script Master
Pine Script Master
Posts: 115
Joined: January 30th, 2022

Re: How to draw a vertical line on a specific date

Hey,

You can follow this to create vertical line at specific date/time.

Code: Select all

// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © processingclouds

//@version=5
indicator("My Vertical line", overlay=true, scale=scale.none)
tempTime = timestamp(2022,01,31,02,20)
plotTime = input.time(defval=timestamp("31 Jan 2022 02:20 +0000"), title="Time")
plot((time == plotTime) ? 10e20 : na, color = color.red, linewidth = 10, title = "MyLine", style = plot.style_histogram)

Return to “Request Scripts”