Color Specific Tickers in an Explore List

This may not be possible based on what I have read, but with the experts on this board I thought I would ask. I have an AFL that I run as an explore to generate a list of tickers based on the criteria in the code.

From that list, I then go and add specific tickers to my portfolio (I am simplifying things for this post, but that is the high level of what I am doing).

What I would like to do is color code (or flag in some other way depending on what might work) the tickers that I have manually added to my brokerage account. So, when I run the explore, those tickers that I own are colored green so I can quickly see which tickers I currently own that continue to show up in an explore window.

Is there a way to do this via AFL? Sorry I don't have any code to actually start with, as I can't seem to figure out what might work.

The AddColumn() function allows you to specify both the text color and the background color. I don't believe you can change the color of the default Ticker column that AmiBroker produces, but you can color code any of the columns that you add yourself, and if you like you can suppress the built-in columns.

How are you keeping track of the symbols that are part of your brokerage account? Are they in a watchlist, a text file, defined as a string in your code, other?

Thanks for the response. I have them in a portfolio tracking sheet I keep outside of Amibroker. One thing I was thinking of was could I put those tickers in a watchlist and then somehow call that watchlist and then flag those symbols when they show up in the explore. I'll have to research that a bit, but if you have any thoughts on that let me know :wink:

How do those two parts fit together?
What I mean is you could have added the one you have already to first post since you ask for AFL solution.


Anyway just put or import those tickers that you own to a watchlist and via InWatchlist(wlnum) in if statement you check for membership in that watchlist and if true you set different color than default one.

wlnum = 3;// insert the number of the watchlist of "brokerage account" symbols

if ( InWatchlist(wlnum) ) {
	colorFont = colorLightGrey;
	colorCell = colorDarkGreen;
} else {
	colorFont = colorCell = colorDefault;
}

Filter = Status( "lastbarinrange" ); 

SetOption( "NoDefaultColumns", True );

AddTextColumn( Name(), "Ticker", 1, colorFont, colorCell );
AddColumn( DateTime(), "Date/Time", formatDateTime );
// ... further explore output
2 Likes

@fxshrat Thank you very much that worked well. You are right, I meant I didn't have any code that was even close to working for highlighting specific explore cells.

I have saved this code in a file of code snippets that I am sure I will draw on again!

Thanks once again for your help.