Search code examples
pine-scriptpine-script-v5tradingview-apipine-script-v4

How to draw a freehand line using pine script?


I want to draw resistance and support lines by hand, import them to pine script, and calculate the distance(percentage) of the current value of the price and the drawn line(support or resistance).

I couldn't find the solution on the internet. Anyone helps?

Thanks in advance


Solution

  • This is not possible in pinescript. User drawn objects are not accessible.

    As a workaround, you can have a user input where you can enter your support/resistance level manually.