Plot SL/TP on main price chart in tradingview using Pine Script V5 - plot

I have my own Pine script strategy that plots some indicators in separate window (not on the main price chart).
However, I want to draw a line for the SL/TP to be plotted on the main price chart.
I'm trying to use it with the below code, but it gets plotted on the separate window not the main price chart :(
any idea how to plot only this one on the main price chart?
p1= plot(strategy.position_size > 0? long_stop_level : na , "SL_Long", color=color.red,style=plot.style_linebr)
I have my own Pine script strategy that plots some indicators in separate window (not on the main price chart).
However, I want to draw a line for the SL/TP to be plotted on the main price chart.
I'm trying to use it with the below code, but it gets plotted on the separate window not the main price chart :(
any idea how to plot only this one on the main price chart?
p1= plot(strategy.position_size > 0? long_stop_level : na , "SL_Long", color=color.red,style=plot.style_linebr)

copy the same script into a new indicator. Hide everything else and set overlay=true to the part you want to plot

Related

I want to plot an indicator into the price chart and another one into a separate "box" (like the rsi), but I want it in the same script

I made a simple script (I am a beginer) with 10 SMA + an RSI, all in the same script, when a run it, the 10 SMA are shown perfectly but the RSI I made plots in the price chart with the SMAs, not in the box bellow the chart.
I searched in the official documentation and in forums but I couldnĀ“t find anything

Adding bar in plot for GrADS?

Have a nice day everyone,
I'm trying to add a bar for my plot in GrADS software. However, run cbar or set gxout bar kind of commands does not work. How can I possibly add a bar into my plot in GrADS.
Below is attached my plot created using GrADS.
Thanks in advance
Edit: The bar is on right side and shows the range of meteorological data.

Plot same plot again (or choose which plot to draw)

I have a complex layout of plots, say for example
layout(matrix(1:2,nrow=1), widths=c(1,7))
I have drawn earlier plots, and am now working on a particular plot (e.g. working on the code on the plot). I redraw the plot often to see impacts of changing e.g. margins.
How can I avoid that each time I redraw the plot it moves on to the next plot in the layout?
e.g. each time I have to start from the beginning, call dev.off, call layout, plot the earlier plots, and then start again with my plot.
Can I just select which plot in the layout I want to plot? Can I move the "counter" that selects which plot is being plotted next?

ASP.NET charts trend line

I have basic bar charts showing some value (1 value per chart) on each day. The charts are rendered using standard MS ASP.NET charts.
Now I would like to add a trend line. Has somebody done such thing and would be so kind to give me some hints how to approach this task? I know how to add a line to the chart, just would like to know whether someone already did such thing.
If I have understood the question correctly, you want to show a line graph using the same values that each bar is drawn.
You can do this by adding one more series with chart type as line to the same chart area.
Make the Y-axis for the series as secondary and keep X-axis as primary (to keep same X-axis values for both Bar & line graph). Or you can also make X-Axis of this new series as Secondary (this will show labels on top of chart area) .

Show all series' values in stacked bars mouseover (ASP.NET CHART)

I'm using the asp.net Chart control to present a stacked bars chart.
I can create a mouseover custom tooltip using this code:
series.MapAreaAttributes = "onmouseover=\"showTooltip('#VALY');\"";
... which works fine. But I can't seem to find a way to show the rest of the values for the other series in that column.
Example:
I have 2 series (Paid and Unpaid) making up a single column in the chart. When I mouseover any of the series, I want to show both the value of the moused-over series, but also the other series contained in that particular stacked column.
Can anyone point me in the right direction?
We're also using stacked bar charts - we have click through functionality, for users to drill into the data making up each point in each series : we use something like this on each data point.
series.Points[index].MapAreaAttributes = "onclick=\"window.opener.location=this.href;window.opener.focus();return false;\"";

Resources