New Warning 508 Amibroker 6.30 RC

I just upgraded to AB 6.30 RC. My code now display a new warning 508

  1. AFL: New warning 508 is displayed if same category type is used multiple times in the Filter settings window and formula calls GetOption(“FilterInclude*”) or GetOption(“FilterExclude*). Code using such statements is incorrect for such filters.

in the line:

m1 = GetOption( "FilterIncludeWatchlist" );

With the warning I cannot run the code nor plot the charts. It was running fine in the AB 6.20

I try to modify the filter settings, it is using just one category and only one watchlist.

Could anyone be kind enough to guide me how to fix it.

Best,

P.

Can you post a snap of the Filter Settings window (selecting the include tab)

I have a feeling it has something to do with this:

"FilterIncludeIndex", "FilterIncludeFavorite", "FilterIncludeMarket", "FilterIncludeGroup", "FilterIncludeSector", "FilterIncludeIndustry", "FilterIncludeWatchlist" - return "Include" filter settings -1 - means NOT selected (not included), >= 0 index of included category

I don't use it but when a Filter Category is not included, and I check it, say Industry, it returns -1 which is correct.
If I have one watchlist, I get 0 which is the index of the watchlist.

After adding 3 markets in Filters on 6.20 I get 1 which is the index of 1st Market Name, in this case Market 2 and 3 wont be accounted for
but no errors/warnings like on 6.30 so maybe it has been streamlined.
Can you post a snap of the Filter window ?

Since GetOption() it returns a number, and that's the index of that Category, having more than one of the same is what the Error is saying which will not return accurate index.

1 Like

image

First and foremost, warning does not prevent the code from running, see: Basics: Error, warning, notice

Everything is documented in README / ChangeLog: http://www.amibroker.com/devlog/wp-content/uploads/2018/11/readme6300.html that describes

CHANGES FOR VERSION 6.28.0 (as compared to 6.27.1)
[...]
AFL: New warning 508 is displayed if same category type is used multiple times in the Filter settings window and formula calls GetOption("FilterInclude*") or GetOption("FilterExclude*). Code using such statements is incorrect for such filters.

1 Like

Yes, the code is running, but not plotting the chart. I saw the README about the warning, yet I couldn't figure it out in how to solve it to plot the chart.

Dear Tomasz, could be kind to guide me on how to solve it? If I understood correctly I'm not using the same category (wishlist) multiple times (see the printscreen above).

Best,

P.

You ought to post atleast a functional part of the code, not just one line else there is really no point.
How can one help in the dark ?

You maybe using it in different ways that aren't obvious to you.
You maybe running your code ignoring other warnings.

@paul that warning was added to AmiBroker as the result of this discussion a few months ago. As far as I can tell it is not going to help you solve your problem, but perhaps try putting the default positions back in your analysis set up (with Watch List in the 5th spot) and see if it makes any difference. I know it should not make a difference.

3 Likes

Larry thanks for the link :+1: It seems, that the reason for this warning was described in that whole thread in details.

I think this should help :slight_smile:

1 Like

@Milosz I'm not sure it will help because Tomasz did write

"FilterIncludeWatchList would give you FIRST one, NOT last one. FilterIncludeWatchlist ALWAYS refers to FIRST setting, which by default is 5th slot. " So he does not say that it MUST remain in the default 5th slot, just that the it is the FIRST time Watch List is referred to that will be accepted. In @Paul 's screen capture he does have it only one time. I just think perhaps he can experiment and try it back in the default position to see if that makes any difference (but I don't think it should).

2 Likes

It seems to have solved the problem. No more warning. Thank you!

The warning is in place EXACTLY to prevent people from doing mistake described in this thread: MarketCap Rank Filter

And warning says it super-clearly:

Warning 508. The same category is used multiple times in the Filter settings window. GetOption() can only return very first one.

1 Like

Thank you, Tomasz. Reading the thread it became clear. That said, I was using only one category one time. The only thing I did was to move the watch list to the 5th position.
image

2 Likes