AFL scanning problem

I’m facing a typical problem with afl. When I select scan the afl working good for some symbols and on some symbols AFL scanning table showing blank, no scanning results. Actually the AFL scanning should show according to the symbol results. But not…?

If the AFL is having problem or my software I don’t know. Can any body correct the problem?

Thanks for the help.

PER_II = Sum((2*Close-High-Low)/(High-Low)*Volume,21)/Sum(Volume,21);

Buy = PER_II > 0;
Sell = PER_II < 0;

Buy = ExRem(Buy, Sell);
Sell = ExRem(Sell, Buy);

I am not sure what problem you are having because it seems to work fine for me.

Add a couple of lines and run an Exploration to debug your code. You are using "ExRem" so you understand that removes excessive signals.

Maybe your are confused as to what that does?

https://www.amibroker.com/guide/afl/exrem.html

Running your code on the 30 stocks in the DJIA, produces this exploration result.

PER_II = Sum((2*Close-High-Low)/(High-Low)*Volume,21)/Sum(Volume,21);

Buy = PER_II > 0; 
Sell = PER_II < 0;

Buy = ExRem(Buy, Sell); 
Sell = ExRem(Sell, Buy);

Filter= Buy OR Sell;
AddColumn(PER_II, "PER_II", 1.3);
AddColumn(Buy, "Buy", 1.0, iif(Buy,colorWhite, colorDefault), IIf(Buy,colorGreen, colorDefault));
AddColumn(Sell, "Sell", 1.0, iif(Sell,colorWhite, colorDefault), IIf(Sell,colorRed, colorDefault));

Where are the "symbol results" for the other 27 stocks in the Index? They don't have a new cross over or cross under zero. So no new signal that day.

If we change the Exploration to see all stocks,

Filter=1; // Buy OR Sell;
AddColumn(PER_II, "PER_II", 1.3);
AddColumn(Buy, "Buy", 1.0, iif(Buy,colorWhite, colorDefault), IIf(Buy,colorGreen, colorDefault));
AddColumn(Sell, "Sell", 1.0, iif(Sell,colorWhite, colorDefault), IIf(Sell,colorRed, colorDefault));

We see the output below and all stocks from the watch list appear, even those with a zero as the result.

Hope that helps. Also check your data as that might cause you to lose results too.

4 Likes

Thanks portfoliobuilder.

My problem not solved. Some symbols showing scanning results perfectly and some symbols not showing scanning results only blank columns showing, even I have selected Range > all quotes option. But the AFL is working perfectly at your end. Where is the problem I am unable to figure out. Whether it is software and data base? Is reinstall will solve my problem? I will give a try?

Check for division by 0. Id Sum(Volume,21) == 0, you have a problem

2 Likes

Thanks for the suggestion.

Finally, I trace out the problem with EOD data base. When I run the scan on IEOD Database then I’m getting all the scanning results for all symbols, even the symbols showing blank in EOD data base. So, my problem shifted to EOD data base. :confused:

Does these symbols have at least 21 EOD bars ?

Yes. Symbols contain years of data with volume.

Do you have ‘Pad non-trading days’ turned on? You may get division by zero if (High - Low) or Volume equals zero on padded days.

Hi @dragon, Did you manage to solve your issue ?

I am facing similar issues with my amibroker. All my EOD data is updated and a simple query like

Addcolumn(Close, "Closing Price", 1.2);  

Shows no results, a blank page.

This was working fine till last week. Would really appreciate if you could guide me to the right solution.

Thanks,
G

@gautamlaungani you might want to try using the AmiBroker debugger so that you can see what's in your Close array.

2 Likes

hey @mradtke,

Thanks for your prompt reply. I did try the debugger but see no error msgs pop up or the scan work.

I am gonna reinstall my Amibroker now. Hopefully that will resolve the issue.

Thanks again for your time. will keep you posted if it works.

cheers

But did you see data in the Close array?

Just adding AddColumn alone is too simple!

You have to add Filter to exploration, such as:

Filter = 1;
Addcolumn(Close, "Closing Price", 1.2);  

or

Filter = Status( "LastBarInRange" );
Addcolumn(Close, "Closing Price", 1.2);  

etc.... any other Filter returning true.

No Filter -> no results.

If you do not add FIlter variable then it is equal to adding "Filter = False" or "Filter = 0".

Also read here for further help:
http://www.amibroker.com/guide/h_exploration.html


And if you want to know whether your symbol has quotes just open Quote Editor via Symbol - Quote editor from menu bar. Or check chart.

2 Likes

hi @fxshrat, I do have all quotes all right.

the filter = 1; code was missing in my code, must have deleted it by mistake.

Thanks for helping out, i can see the results now. appreciate your help.

cheers.
G