brokey for amibroker

Amibroker - Brokey For

This is the heart of Brokey. Go to Analysis > Settings > Backtester > Custom Backtester. Write or paste a script that loops through all trades and flags delisted positions.

Sample CBI logic:

// JavaScript for AmiBroker Custom Backtester
for each trade in Backtest.Trades 
   if (trade.Symbol.IsDelisted && trade.ExitDateTime >= trade.Symbol.DelistDate) 
       trade.ExitPrice = trade.Symbol.DelistPrice; // e.g., 0.01
       trade.ExitReason = "Brokey - Delisted";
       trade.RealizedPnL = -trade.EntryValue; // Total loss

This overrides AmiBroker’s default assumption that you can always sell at the close on the final bar.

In AmiBroker, create a new watchlist called _Brokey_Dead. Import all delisted tickers and their historical quotes. Yes, you must have price history from their first day to their last. brokey for amibroker

For intraday traders, Brokey can automatically shade pre-market, regular trading hours, and after-hours sessions directly on the chart. This visual context is crucial for gap strategies and volume profiling.

You need to source a history of dead tickers. Brokey methodologies often rely on data from:

The core requirement: Every stock that existed on January 1, 2010, must be in your Jan 1, 2010, backtest. Brokey scripts automate the inclusion of these “ghost tickers.” This is the heart of Brokey

Step 1: Download the Latest Release

Step 2: Copy DLL to Plugins Folder

Step 3: Install AFL Scripts

Step 4: Load a Brokey Chart Template

Once you have the basic Brokey setup, you can move to pro-level techniques.

When traders search for “brokey for amibroker”, they are typically looking for these specific capabilities: This overrides AmiBroker’s default assumption that you can