Search code examples
pine-scriptpine-script-v5

How do you create a drop down of line style options using PineScript on TradingView?


On TradingView some of their default indicators have dropdown menus where the menu options offer ability to change line style, or line thickness Picture of the Fib Retracement Indicator menu

Looking through the docs I can see you can use input to make a dropdown of integers or strings, but I don't understand how to include pictures like dotted/dashed lines or lines with different thickness options


Solution

  • Fib Retracement is a drawing tool and not an indicator

    You cannot visually display the line thickness in a drop-down menu. Just use an int for that and a string for the style.

    in_line_sty = input.string("───", "Line Style", ["───", "-----", "....."], inline="line")
    in_line_w = input.int(1, "Width", inline="line")
    

    enter image description here