PureBytes Links
Trading Reference Links
|
>> MSymbol = WriteIf( MidSym="GM", "^GSPC", "^NDX");
>> I get an error here .....................^
>> something about incorrect type
You need "==" to compare values or strings. "=" is assignment.
GP
--- In amibroker@xxxxxxxxxxxxxxx, "marketmonk777" <RedEyes777@xxx> wrote:
>
> Okay, I am making some good progress.
>
> I use the following line to extract a portion of the ATC name
>
> MidSym = StrMid(Symbol, 1, 2);
> I have it offset by 1 character to remove the ~ (tilde?).
>
> Now I am stumped in that I can't figure out how to use the WriteIf
> function:
>
> MSymbol = WriteIf( MidSym="GM", "^GSPC", "^NDX");
> I get an error here .....................^
> something about incorrect type
>
> MSymbol will be a variable that contains my market index symbol based
> on which ATC code I have currently selected.
>
> if ATC name is ~NDX005MA
> my MidSym returns ND
> and I want MSymbol to be assigned ^NDX so it will plot the Nasdaq 100
> Index.
>
> Likewise if MidSym is GM then plot ^GSPC (SP500)
> and if MidSym is RU then plot ^RUT (Russell 2000)
> etc.
>
> So if some kind soul can give me a hint as how to perform string
> comparison and an if-then coding I would be grateful.
>
> 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/
|