Strategy Examples
Execution pattern examples — order types, bracket exits, trailing stops, RSI filters, and parameterized strategy templates.
Order Type Examples#
These patterns assume you already understand mapped execution fields and the separation between signal building and trade mapping.
| Example | What it teaches | Download |
|---|---|---|
pynescript_strategy_starter.py | Baseline MARKET mapped entry flow. | Download |
pynescript_limit_entry_strategy.py | LIMIT entries with mapped_entry_limit_price. | Download |
pynescript_stop_market_entry_strategy.py | STOP_MARKET entries with mapped_entry_trigger_price. | Download |
pynescript_stop_limit_entry_strategy.py | STOP_LIMIT entries with trigger and limit fields kept explicit. | Download |
pynescript_reduce_only_exit_strategy.py | mapped_reduce_only plus IOC exit-management intent. | Download |
pynescript_strategy_alert_template_strategy.py | strategy_alert_message(...) plus alert-friendly mapped tags. | Download |
pynescript_slippage_strategy.py | Declaration-level slippage modeling. | Download |
pynescript_commission_strategy.py | Fee modeling with commission_type and commission_value. | Download |
pynescript_margin_strategy.py | Margin and percent-of-equity sizing assumptions. | Download |
pynescript_pyramiding_strategy.py | pyramiding add-on entry flow. | Download |
pynescript_limit_fill_assumption_strategy.py | backtest_fill_limits_assumption with explicit limit-entry design. | Download |
Pattern Variations#
Each file adds one idea. Bracket exits, trailing stops, RSI filters, and shared-core reuse are all easier to learn as separate variations.
| File | What it demonstrates | Best use | Download |
|---|---|---|---|
pynescript_sma_crossover_strategy.py | SMA crossover mapped strategy. | Simple crossover template. | Download |
pynescript_bracket_strategy.py | Bracket exits with mapped_sl and mapped_tp. | Risk-managed entries. | Download |
pynescript_trailing_stop_strategy.py | Trailing stop with mapped_trail_offset. | Trailing exit pattern. | Download |
pynescript_rsi_filter_strategy.py | RSI gating around a crossover entry system. | Multi-signal filter pattern. | Download |
pynescript_utbot_strategy.py | UTBOT strategy using shared core helpers. | Core reuse pattern. | Download |
pynescript_utbot_strategy_full.py | UTBOT strategy with explicit trade quantity input. | Parameterized strategy template. | Download |