Imagine you are testing a momentum strategy on the NASDAQ 100. You have data from 2000 to 2025. Your code includes $AAPL (1980) and $NVDA (1999), but also $META (2012) and $TSLA (2010). In native AmiBroker, if you include $TSLA in your watchlist from 2000, the backtest will see a price of zero or a stale value, leading to false buy signals. Brokey uses a "Valid From" and "Valid To" system, ensuring $TSLA is only tradeable after its IPO date.
You will see live candles forming tick-by-tick inside Amibroker.
// Score high momentum, but penalize if correlated to existing holdings RawScore = ROC(C, 20); CorrPenalty = 1 - bk_GetPortfolioCorrelation( Name(), "SPY" ); PositionScore = RawScore * CorrPenalty; brokey for amibroker
// 1. Include Brokey headers (if applicable) // 2. Define parameters Lookback = 20; MaxPositions = 5; CorrThreshold = 0.70;
Briefly describe what your system or indicator does (e.g., "This system uses a Moving Average crossover to identify trend reversals"). Imagine you are testing a momentum strategy on
Because it is a DLL (Dynamic Link Library), you generally shouldn't interact with it directly. However, traders often encounter it in these scenarios: Installation Errors:
Enter .
| Feature | Broker.Y Native | Amibroker | | :--- | :--- | :--- | | | Basic | Advanced (Portfolio-level) | | Custom AFL Scripts | No | Unlimited | | Scanning 1000+ Scrips | Slow | Blazing fast (< 1 sec) | | Alerts & Triggers | Limited | Fully customizable | | Cost | Free | One-time $299 (lifetime) |
// 6. Buy/Sell Rules Buy = Ref( FinalScore, -1 ) < FinalScore; // Momentum acceleration Sell = FinalScore < 0; // Momentum turns negative In native AmiBroker, if you include $TSLA in