Page 1 of 1

Help with my script

Posted: Fri Nov 06, 2020 7:00 am
by Margnilien
Hi.

I have written a basic script to be able to quickly draw my horizontal lines for (support/ resistance) on a chart. Is there a way to make a script be stock symbol specific. I don’t want say $fb horizontal lines showing on the $sq chart?

Thanks

Re: Help with my script

Posted: Thu Nov 12, 2020 1:47 am
by Matthew
Hi Margnilien!

There are a few ways to achieve that. The easiest way I can think of would be to hard-code a check, something like this:

Code: Select all

horizontalLine = XXX
if syminfo.tickerid != "FB"
    horizontalLine := na

plot(horizontalLine)
That would change your horizontalLine value to "na" and plot nothing to the chart if the current market symbol is not "FB". Hope that helps :)