From the instrument side of things, and the lack of ability to change or identify the instrument.
At one point I was drawing a number of sup/res lines on the DAX, wall street, and bitcoin.
I used the ‘subRoutine’ technique for my sup/res lines, edit +/- the lines and used some logic to determine which instrument I was on.
With the fact that the normal range of these instruments were far apart from each other, that was one test.
A second one was, having a constant of a closed value for each instrument with a date/ time reference .
Chances of both appearing on two different instruments are very remote.
Maybe more possible over a larger number of instrument, but then use more than 1 reference value.
It worked quite well, when I change the chart to another instrument, the correct lines were drawn.
If I went on a random instrument I got a warning message, plus no lines.
Same message if no reference match, if it fell beyond historical bars loaded.
Also depending on, which candle you picked, could determine if lines drawn on different timeframes 5m,15m,30, 1h, 4h candle.
I don’t think I implemented all the these idea’s, because I moved onto other stuff, but it did the job at the time.