Canonical shared libraries extracted from the ORB strategy. New strategies
should #include these with absolute paths (AmiBroker resolves relative
includes against its Formulas folder, not the including file).
SharedAFL/
lib/ AFL_Lib_*.afl plumbing modules
Strategy_Template.afl thin harness — copy, rename StrategyCode, replace SIGNAL
docs/ contracts and usage notes
README.md
| File | Role |
|---|---|
AFL_Lib_SessionTime.afl |
RTH session math, day boundaries, time filters |
AFL_Lib_VwapBands.afl |
RTH VWAP + SD bands, prior-day references |
AFL_Lib_DailyContext.afl |
daily EMAs, Average Daily RTH Volume |
AFL_Lib_UniverseRank.afl |
daily Top-N cross-sectional gate (adapter inputs) |
AFL_Lib_PositionSizing.afl |
SizingRiskQty() / SizingFinalQty() (scalar) |
AFL_Lib_RealizedPL.afl |
static-var realized P/L tracking |
AFL_Lib_ChartOverlays.afl |
band plots, markers, GFX info box, IbLogEvt() |
AFL_Lib_IBEngine.afl |
live IB execution behind a documented signal contract |
#include "g:\OneDrive\01_TRADING\AFL_DEV\SharedAFL\lib\AFL_Lib_SessionTime.afl"
Optional: junction AmiBroker\Formulas\Include\SharedAFL → this lib\ folder
so formulas appear in AmiBroker's browser while Git still owns the source.
- Copy
..\AFL_DEV\_StrategyScaffoldto a new folder underAFL_DEVand rename it (e.g.MyIdea). Rungit initin the copy. - Set a unique
StrategyCodeinStrategy.afl(namespaces static vars). - Satisfy each lib's
REQUIRES/ signal contract before the#include. - Replace only the SIGNAL section.
- Generate and run backtests via the scaffold's
tools/harness (see_StrategyScaffold\README.md). - Before accepting any SharedAFL change, re-run the ORB regression gate
(
RESULT: IDENTICAL) from the ORB repo.
ORB\lib\ORB_Lib_*.afl are thin redirects into this tree so old absolute
paths keep working. Prefer AFL_Lib_* in new code.
Treat SharedAFL like a product: small changes, header contracts intact, and the ORB golden trade-list regression still green before merging.