Adam B
Adam B

Reputation: 113

pinescript indicator to show in chart and in a seperate window

I have a long indicator which gives me buy sell signals and lines in a separate window below the chart. I would like to see the lines in that window, but would like the buy/sell signals to show up in the chart. Do I need to run this indicator twice once with overlay=true and once with overlay=false, or is there a parameter in the plot function to tell it to display that plot only on the chart?

Thanks in advance Adam

Upvotes: 0

Views: 3386

Answers (2)

Sunil
Sunil

Reputation: 3424

You have to use @version=5

Your main indicator will be in the separate window. For the shape that you want to plot on the main chart you have to use force_overlay = true parameter in plotshape function.

Check below example:

plotshape(up, 
          "", 
          shape.triangleup,
          location.bottom,
          color_up,
          0,
          "Long",
          chart.fg_color,
          true,
          size.tiny,
          force_overlay = true)

Upvotes: 0

bbnm
bbnm

Reputation: 1094

Yes you'll have to use two indicators for this. Pine Script at the moment, doesn't support sub-window and overlay indicators combined together.

Upvotes: 1

Related Questions