AFL and Pine organize calculations differently
AFL is an array-processing language: a price variable can represent a series of values processed by a formula. Pine executes across chart bars and maintains series history; its behavior also depends on whether a bar is historical or still updating. Both can express a moving-average rule, but array operations, prior-bar references, persistent state, and realtime recalculation need deliberate translation.
| Research task | AmiBroker | TradingView |
|---|---|---|
| Custom logic | AFL formulas support charts, exploration, and backtesting. | Pine indicators and strategies run in the TradingView environment. |
| Find symbols | Exploration applies a filter and produces custom columns over the selected symbols and analysis range. | Pine Screener applies an indicator to a selected watchlist or index. |
| Allocate capital | Portfolio backtesting uses shared equity, position limits, and candidate ranking. | A chart strategy simulates orders for its chart symbol. Requesting another symbol does not allocate a separate position in that instrument. |
| Move an existing system | Document the formula, analysis settings, database, and portfolio rules. | Reimplement the supported rules and compare intermediate values. Pasting AFL is not a migration. |