Skip to main content
ATK Pine Script®

Execution Realism

Execution realism properties — slippage, commission, margin, pyramiding, and backtest_fill_limits_assumption in strategy declarations.

Execution Realism Properties Belong in the Teaching Surface#

The current example suite now has dedicated strategies for slippage, commission, margin, pyramiding, and limit-fill assumptions. That means these properties are no longer just internal runtime knobs. They are part of the authoring contract users should actually learn.

PropertyWhy you would set itExample file
slippageModel less optimistic fills in backtest and replay.pynescript_slippage_strategy.py
commission_type, commission_valueExpress cash-per-order or similar fee assumptions directly in the declaration.pynescript_commission_strategy.py
default_qty_type, default_qty_value, margin_long, margin_shortControl percent sizing and margin assumptions without hiding them in comments.pynescript_margin_strategy.py
pyramidingAllow staged add-on entries in the same direction.pynescript_pyramiding_strategy.py
backtest_fill_limits_assumptionTeach stricter backtest handling for limit orders.pynescript_limit_fill_assumption_strategy.py
strategy(
    "Limit Fill Assumption Strategy",
    overlay=True,
    backtest_fill_limits_assumption=1,
    slippage=2,
    commission_type="cash_per_order",
    commission_value=5,
    pyramiding=1,
    process_orders_on_close=True,
)