How do I Change the Width of Default 2 Columns of Exploration

How to define the width of the 2 Columns that appear by default while doing explore ie Symbol name and Date ?

May be you are referring to “SCAN” where default columns can not be customised.
But in “EXPLORE” which is actually a CUSTOMIZABLE SCAN , you can customize anything ,including the width of column/s, using function,

Pay attention to the 6th arguement in the above function which is extensively explained in the Link below.
https://www.amibroker.com/guide/afl/addcolumn.html

3 Likes

First you need to get rid of those 2 default columns (Ticker and Date/Time) using:

Then you can create any fully customisable column (also those with Name or Full Name and Date/Time) using:

http://amibroker.com/guide/afl/addcolumn.html
http://amibroker.com/guide/afl/addtextcolumn.html
http://amibroker.com/guide/afl/addmultitextcolumn.html
http://amibroker.com/guide/afl/addrow.html

Hope this helps :slight_smile:

4 Likes

@Milosz advice is of course good one, but there is also some less-known feature.

You can have default and all other columns auto-sized to content, so everything fits without truncation.

The same effect (i.e. auto-fit to content) can be achieved in any of AmiBroker lists simply by pressing CTRL and + (PLUS) key on the NUMERIC keypad.

13 Likes

Thank you Tomasz. I was going to additionally write about this new useful feature (implemented in AmiBroker 6.06 ), but you were faster :wink:

I probably didn’t mention it in my first post, because @vikasjain2 asked “How to define the width of the 2 Columns that appear by default while doing explore?

Auto-size columns to fit content is a very good solution for most users. The most demanding ones, can use the solution which I wrote about, because it gives them full control of the width of each column and the highest possible precision. It also allows to get rid of those 2 default columns if they are not needed. Additionally if someone uses Auto-size columns to fit content, he/she should know that (a quote from AmiBroker 6.06 ReadMe ) :

New Analysis: Added an option “Auto-size columns to fit content” - OFF by default. When turned on, column widths are adjusted to fit the content after analysis is complete. Note that this means that any widths specified in width parameter in AddColumn width will be ignored when this is turned ON.

3 Likes

... a follow-up to my previous posts:

If you use SetOption("NoDefaultColumns", True); in your code, you get rid of the two default columns (Ticker and Date/Time). The problem is, that if you do so, you won't be able to sync a chart with the selected symbol in the Analysis results list, without taking some additional measures.

In general, to make syncing possible, Sync chart on select option in Analysis window settings menu must be selected:

Additional information you can find in Tomasz's article: How to sync a chart with the Analysis window

To make synchronization possible, there must be a column with Name() present. What should we do if for example we want only the column with FullName() to be displayed and still be able to sync charts? The solution is simple. We should also add a column with Name() with the "width" parameter set to 1 or 0. For example:

SetOption( "NoDefaultColumns", True );
AddTextColumn( Name(), "Ticker", 1, colorDefault, colorDefault, 1 );
AddTextColumn( FullName(), "Full Name", 1, colorDefault, colorDefault, 90 );

As a result, this column is present, but it's not visible. Such invisible columns can be also used for other purposes - for example we can perform some complex sorting using this column or such columns.

Now, what's the difference between the width parameter set to 0 and 1. In both cases such columns are invisible, but when we set the width to 1, we can retrieve this column (and make it visible) using our mouse. This solution might be helpful if we want to use many columns and have only limited screen space available. In the example below, this technique is used to visualize some parameters on n-consecutive bars:

10 Likes