You can use the string function StrFind to determine which market the
symbol is part of. Just search for the prefix in the ATC symbol name.
You can then use a series of "if" statements to plot the second chart
(I don't think you can use strings in Case statements with Switch):
sname = Name();
if (StrFind(sname, "~NDX") > 0)
<plot NDX chart>
else
{
if (StrFind(sname, "~SP5") > 0)
<plot SP500 chart>
else
{
if (etc...)
}
}
Regards,
GP
--- In [email protected], "marketmonk777" <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I create a number of ATCs for the general market, the Nasdaq, S&P 500,
> and the Russell.
>
> In my window I have two charts. The top chart is a line plot of my ATC
> that I have selected. The bottom chart is a foreign plot of either
> SP500, RUT, NDX, INDU or whatever I select in the parameters window.
>
> What I would like to do is have some code to recognize which type of
> ATC I have selected and plot the appropriate market for it in the
> bottom pane.
>
> For example all of my NDX ATCs start with ~NDX. And all of my SP500
> ATCs start with ~SP5.
>
> Is there a way I can extract the first 3 or 4 characters of the
> selected symbol and run it through a CASE or IF - THEN branch?
>
> Regards,
>
> MM
>