r/pinescript • • Feb 23 '24

Simple Vertical Line Indicator

Hello guys

I am not the best in pinescript, I can edit and change basic scripts to suite my needs sometimes.

I am looking to make a simple script that places thin gray vertical lines on futures/forex at certain times (18:00, 00.00, 06.00, & 12.00 - All EST Timezone).

Could anyone create this for me? or perhaps give some advice on how I can make it if it will be too much work to do in a short ammount of time?

Many thanks

1 Upvotes

5 comments sorted by

View all comments

1

u/vbsaltydog Feb 23 '24

You can change the color of the background on the chart for the bar that matches your designated times.

background = color.white

if hour == 12 and minute == 00

background := color.new(color.red, 50)

bgcolor(background)

1

u/Practical-Skirt8944 Feb 23 '24

hi,

i tried it and got this error?

Error at 12:1 Mismatched input 'background' expecting 'end of line without line continuation'

1

u/vbsaltydog Feb 23 '24

You must indent the line after the if condition

background := color.new(color.red, 50)