Examples Index
Runnable strategy examples mapped to engine features.
These examples should map to real files in the repository. Use this page to choose a runnable starting point.
Source
strategies/LayerRunnable examples
ModeWeights and orders
Inputexample strategy files
Outputworking strategy patterns
Primary API
./strategy.sh <strategy>Main caveatDocs should reference real filenames, not illustrative names that do not exist.
Weight-Mode Examples
| File | Pattern | Read first if... |
|---|---|---|
strategies/sma_crossover.py | Signals -> equal/capped weights | You want the standard portfolio example. |
strategies/sma_rebalance_daily.py | Daily rebalance | You want baseline weight-mode behavior. |
strategies/sma_rebalance_weekly.py | Weekly rebalance | You want lower turnover. |
strategies/sma_rebalance_monthly.py | Monthly rebalance | You want EOD portfolio research. |
strategies/sma_rebalance_monthly_drift.py | Monthly + drift trigger | You want conditional rebalancing. |
strategies/sma_rebalance_monthly_dd.py | Drawdown circuit breaker | You want risk-managed rebalance behavior. |
strategies/rebalance_comparison.py | Multi-policy comparison | You want to compare turnover and performance across policies. |
Order-Mode Examples
| File | Pattern | Read first if... |
|---|---|---|
strategies/market_orders.py | Market entry/exit | You are learning order mode. |
strategies/limit_orders.py | Limit entry and TP | You want passive entries or take-profit exits. |
strategies/stop_orders.py | Protective SL | You want explicit stop-loss state management. |
strategies/trailing_stop_orders.py | Standalone trailing stop | You want a dynamic protective exit. |
strategies/bracket_orders.py | Entry + TP + SL | You want the cleanest fixed risk/reward example. |
strategies/oco_orders.py | One-cancels-other | You need competing entry or exit orders. |
Suggested Learning Path
- Start with
sma_crossover.py. - Compare daily, weekly and monthly rebalancing.
- Read
market_orders.py. - Move to
bracket_orders.pyfor TP/SL. - Use
stop_orders.pyonly when you need explicit state management. - Use
oco_orders.pyafter understanding bracket orders.