Add BarIndex to backtest report

How might I be able to add BarIndex, as a new column, to the backtest report?

Have you looked into manual and read about custom metrics?
https://www.amibroker.com/guide/a_custommetrics.html

Have you searched in KB and read on how to add custom metric?
https://www.amibroker.com/kb/2014/11/20/how-to-show-indicator-values-in-backtest-trade-list/

BarIndex array function
https://www.amibroker.com/guide/afl/barindex.html

Where is your try? Where are you stuck?

1 Like

Where is your try? Where are you stuck?

Yep, I get it. I should not have posted. My apologies!

Also keep in mind that BarIndex will likely change in different contexts. For example, the date/time associated with Bar 100 during Phase 1 will be different than the date/time associated with Bar 100 during Phase 2 of a backtest, and those are both likely different than the BarIndex you'll see in a chart.

1 Like