Header with formula when export CSV File on Batch

Hi, i have a problem when i make a batch file containing some Actions and use Export to File to export the explore List to a CSV File. I always get a CSV file with the Formula at the header, so is not a true CSV file and some programs have interpretation problems when loading it.
I didn't see any option to avoid this header. I have unchecked "Include Formula in the Report" at the Backtester Settings, Summary Tab, but seems it's only for summary purposes as is not working when using export file.
My Ami Version is Proffesional 6.20.1. Seems like in newer versions this CSV header is not present anymore, as some friends told me.
Any solution please?


Hello guys, anything to do with this?

No, header is always included as it contains crucial information.

Is same in newer AMI Versions? No option for disabling the Header?

I use version 6.30 and the csv file contains just the table header and the rows as robx wants. It must be a setting in Amibroker not to export the Formula to the csv files.

Tomasz, are you sure about not being able to avoid outputting the formula ? I output the exploration results from a batch file and have never had a problem. Could this be a version issue ?

1 Like

Thank you Dan, that's exactly what i need.
Can you confirm this Tomasz? If it's just a 6.20 Issue let me know it for upgrading my license.
I appreciate your help.


Formula is NOT included. I was talking about HEADER.

In my reply I wrote:

No, HEADER is always included as it contains crucial information.

Header (names of columns) and formula are two different things.

Verify if you really have this turned OFF.


and this (it is available from "Old backtester >>>" button)


Hi Tomasz,

Sorry if i didn't explained properly. I was always refering to the Formula data at the start of the CSV File in the header on te text file.
I have unchecked the settings you metion as i said on my first post. And now have also uncheck ALL the settings for the Old Bactester Tab, although I am not using it. BUT still the formula appears on the file as you can see here:

Formula used:,"// MACD Buy Signals Example using NEXT DAY Market or MOC Buy orders and NEXT DAY Market or MOC sell orders for SIG AmiBroker + Alera Course // ================================ BACKTEST FUNCTIONALITY ====================================================// NORGATE NDU FUNCTIONALITY// https://norgatedata.com/amibroker-faq.php#exitpriortodelisting// Making use of NDU (Norgate Data Updater) functions -- for historical index constituents#include_once "Formulas\Norgate Data\Norgate Data Functions.afl"// SIG GenSignals function script for outputting signals #include_once "Formulas\Custom\1SIG\GenSignals.afl"// Exit prior to a stock being de-listed  https://norgatedata.com/amibroker-faq.php#exitpriortodelistingOnSecondLastBarOfDelistedSecurity = !IsNull(GetFnData("DelistingDate")) AND (BarIndex() == (LastValue(BarIndex()) -1) OR DateTime() >= GetFnData("DelistingDate") ) ;OnLastTwoBarsOfDelistedSecurity = !IsNull(GetFnData("DelistingDate")) AND (BarIndex() >= (LastValue(BarIndex()) -1) OR DateTime() >= GetFnData("DelistingDate") );RoundLotSize = 1; // defines round lot sizes used by backtester - in this case, do not allow fractional shares of stocks to be purchased, minimum division is 1 sharetradeDelays = 1; // trade next day for backtesting purposesSetTradeDelays( tradeDelays, tradeDelays , tradeDelays, tradeDelays ); // buy signals will trade next day as a result of method of coding below even though trade delay set to 0 - Sells set to 1 day delay (i.e. next day)// Equal percentage allocationmaxpos = Param("Maximum Number of Positions", 20, 1, 1500, 1); // set initial equity = 100KSetOption( "MaxOpenPositions", maxpos );SetPositionSize( 100 / maxpos, spsPercentOfEquity );// Set Ranking / Signal priority Algorithm// PositionScore = ROC(Close,60); // Rate of change over 60 daysPositionScore = mtRandom(); // Randomly generated order of trade signals// Buy SignalBuyCondition = Cross( MACD(12,26), Signal(12,26,9) ) ; // MACD Impulse Signal - generate signal once or only on crossing// BuyCondition = MACD() > Signal() ; // MACD State Signal - generate signal as long as condition is true// Buy on next barBuy = BuyCondition	  AND NorgateIndexConstituentTimeSeries("S&P 1500")   // Use the Norgate S&P 1500 Current & Past watchlist	  AND NOT OnLastTwoBarsOfDelistedSecurity ;           // Exit de-listed stocks just before the de-listing date for back testing purposes// Set the price price to the close priceBuyPrice = Close ; // buy using MOC orders placed after the close for next day - to ensure proper fills and no slippage based on posted closing price - real world prices should line up with back test results// Sell conditionsSellCondition = Cross( Signal(12,26,9), MACD(12,26) ) ; // MACD Impulse Signal - generate signal once or only on crossing// SellCondition = Signal(12,26,9) < MACD(12,26); // MACD State Signal - generate signal as long as condition is true	  Sell = SellCondition	   OR OnSecondLastBarOfDelistedSecurity ; // exit de-listed stocks before the de-listing date for back testing purposes	   SellPrice = Close ; // sell next day using MOC orders to ensure proper fills and no slippage based on the posted closing price - real world should line up perfectly with back test results// ================================ SIGNAL GENERATION IN EXPLORATION ====================================================// Exploration Signal Generation - will run when using Exploration with '1 recent bar' selected//  The sell signals will be in a separate script, however the sell logic is contained in this script for back testing/verification/quantification purposesFilter = Buy;GenSignals(    rankFilter = PositionScore, // Ranking - use and sort signal priority by PositionScore algo, in this instance rank by random order of signals    actionFilter = actionBTO, // Buy To Open    qtyFilter = Null, // Quantity will be handled by Alera    unitsFilter = Null, // MOC order sent after the market close that generated the signal, and before 3:45PM EST on the next day of execution    limitFilter = Null, // No limit set since we will be using MOC orders    tifFilter = tifDay, // Time in Force = Day    idFilter = Null // not needed for this order type);"


So, Dan told us in AMI 6.30 the export is correct as he has just the Rows from ""Results". So,maybe it's just a 6.20 issue?


Formula will only be included if you have it enabled in the settings. Please note that if you are using BATCH, then settings are PART OF .APX file (Analysis project). Therefore you must open the .APX (Analysis project) file that is used by Batch, THEN change the settings and THEN Save the project (.APX).

Yes, that;s exactly how it's done. All the APX i work on were edited to reflect the changes we make before, and then used on the Batch, but at this case the Formula still is there.:


Can you try this on your 6.20.1, if this also occurs to you, please?

Version has nothing to do with that because this is very old code. As I wrote - somewhere in the project file you have to have that option turned ON. There is no other way / no other reason.

Hi Tomasz,

Maybe something more has changed on the Backtester Report with the newer versions. I've just upgraded to 6.35 and the Header Formula is not there anymore. This is the CSV file using the same Batch i showed before: