I have a TOS indicator (I made) I would like someone to take a look at that paints a horizonal line next to the prior time frame candle which gives the 50% mark of that candle. This indicator only gives what ever time period the current chart is in (if time is changed the line will update to what ever time frame is selected). What I wish is that this indicator allowed for time frames to be locked in so if I am on a 30m chart and I change it to a 15m chart it still shows the 30m line plus the new 15m line). I have uploaded two images which highlight what I am looking for. The TOS image shows what my indicator shows and the Tradingview image shows their indicators which I have set up to give the results I am seeking on TOS. On the TV setup I have three of the same indicators loaded but set to the different timeframes I desire. That's exactly what I wish for with TOS. The script for my indicator is also posted below. Thank you for any help.
Here's the code:
addlabel(1,round(low[1]),color.red);
addlabel(1,round(hl2[1]),color.white);
addlabel(1,round(high[1]),color.light_green);
plot line = if !isnan(close) and isnan(close[-2000]) then HL2[1] else double.nan;
line.setpaintingstrategy(paintingstrategy.horizontal);
line.setlineweight(2);
line.setdefaultcolor(color.red);
Alert(close crosses line, "HL2 Cross", alert.bar, sound.ding);
Here's the code:
addlabel(1,round(low[1]),color.red);
addlabel(1,round(hl2[1]),color.white);
addlabel(1,round(high[1]),color.light_green);
plot line = if !isnan(close) and isnan(close[-2000]) then HL2[1] else double.nan;
line.setpaintingstrategy(paintingstrategy.horizontal);
line.setlineweight(2);
line.setdefaultcolor(color.red);
Alert(close crosses line, "HL2 Cross", alert.bar, sound.ding);