0

I want to plot a shape (any shape) on a specific value on a specific time. For example, I want to plot a shape on EURUSD with value 1.02903 on 30 Nov 2022 12:00. How do I do that from pine script? Thanks

I was trying to use plotshape and label but not getting what i want.

kash
  • 1
  • Welcome to SO. "I was trying to use plotshape and label but not getting what i want." - If you may provide more information on how you were doing this? code snippet, etc? it'll help others to help you faster. – BhaveshDiwan Nov 30 '22 at 22:37

1 Answers1

0

You can use timestamp() for your specific time and plot your shape with location=location.absolute if you want to place the shape at a specific price.

//@version=5
indicator("My script", overlay=true)

t = timestamp(2022, 11, 30, 12, 00, 00)
tim = time == t
val = 1.02903

plotshape(tim ? val : na, location=location.absolute, size=size.huge)

enter image description here

vitruvius
  • 15,740
  • 3
  • 16
  • 26