How make a sequence number in the column in exproler Thanks very much
i = 0;
// Put this before all AddColumn() function
// In all the AddColumn() or all other similar functions from the category
AddColumn( C, "Close " + NumToStr( ++i, 1.0, False) , 1.2);
Put same code of NumToStr()
in the 2nd argument which is the Column Header Text and this will append a numeric value sequence to it.
You can arrange that part to be prepended if you need numbers first or customize conveniently.
You picture shows Row numbers, not column numbers.
Take a snapshot, edit in MS paint etc and post what you exactly want.
That can be done with StaticVarAdd("SomeFlag", 1)
and SetSortColumns()
.
Your Filtering condition should be known so that Add occurs only when Filter is true.
Another way that can work is by using Status("stocknum") + 1
and SetSortColumns() if required but in this case you shouldn't be filtering
For a working code, you can post your AFL or the filter part or provide more details.
You can try it out yourself with the above two methods.
Both will extra add load to the code.
Thanks very much., this my afl colom
SetOption( "NoDefaultColumns" , True ) ;
// I want make No / Number here. Thanks
AddColumn(DateTime(), "Date",formatDateTime );
AddTextColumn(Name(), "Ticker");
I'm asking for Filter
condition.
Use AddRankColumn()
https://www.amibroker.com/guide/afl/addrankcolumn.html
You might also check:
https://www.amibroker.com/guide/afl/addsummaryrows.html
https://www.amibroker.com/guide/afl/setsortcolumns.html
Thanks @Milosz didn't seem to recall that one. Right solution.
Got carried away by first part of adding Numbers to Headers columns.
@Batupermata A general advice. If you are looking for a specific function (or solution), I always recommend starting from Categorized list of functions in AFL Function Reference - https://www.amibroker.com/guide/a_catfunref.html
In this case, if you had scrolled to Exploration, you would have easily found all functions that you (might) need:
Some other materials:
https://www.amibroker.com/guide/h_newanalysis.html
https://www.amibroker.com/guide/h_exploration.html
Hello
Everybody helps you allready, do to what you asked . But now you ask something different again. .on your last query sounds like you need to use addrow or a watch list..
If a friend of you will ask you why you need to do this. Are you able to answer to him? So please answer the REASON why you need those numbers?
Milosz has already given him the answer. He just didn't want to apply it correctly.
AddRankColumn(); // Before first AddColumn() statement
// All the rest of the AddColumns()
// Last statement
SetSortColumns( 1 );
AFAIK, there is no way to do it directly in Amibroker if you resort different columns.
Simply export the report to Excel an use it to view progressive "row" numbers (it is not a report column but row headings).
202/5000
Thanks very much for very helpfull, I have tried it. It turns out that in afl, there is sortcolom. So the total is 2, equal to two: (-1, -12). So the sequence of numbers cannot be sequential. Thanks very much
I still don't understand what it is you're trying to achieve, or why. But you seem to have found the answer you were looking for.
In future, it'd be much appreciated if you would follow the recommendations in:
And here's an example of how to define what you want: