[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Conditionally changing the Foreign Symbol to be plotted.



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "marketmonk777" <RedEyes777@xxx> 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
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/