---
title: "Stock Strategy Rule Builder"
description: "Turn a trading idea into a complete, auditable rule specification before backtesting. Define universe, signals, entry, exits, sizing, and constraints."
canonical: https://www.getswoopr.com/tools/stock-strategy-rule-builder/
source: "Swoopr Investment: https://www.getswoopr.com"
---

**Direct answer:** The Stock Strategy Rule Builder is a browser-based tool that guides you through specifying a rule-based trading strategy before you backtest it, capturing the nine required components (entry rules, exit rules, position sizing, universe, timeframe, risk limits, and more) into a versioned, exportable document. No data is sent to any server; all processing runs locally.





      

# Stock Strategy Rule Builder



Turn a trading idea into a complete, auditable rule specification, universe, signals, entry, exits, sizing, and portfolio constraints, before you run a single backtest. Export as JSON or copy for your trading notes.






## Why Specify Before You Backtest



Most backtesting failures happen before the first line of code: the strategy idea was never precisely stated. Without a written rule specification. It is impossible to know whether a backtest result reflects the idea you had in mind, an artifact of how you coded it, or a data-snooping accident discovered during "optimization."



This tool walks you through the nine components every rule-based strategy requires. Each section collects the decisions you would otherwise make implicitly, and implicitly re-make differently each time you revisit the idea. The output is a versioned, exportable document you can hand to a backtest engine, share with a collaborator, or attach to a trading journal entry.



All processing runs locally in your browser. Rule text and symbol names are never sent to analytics or any external service.








## Strategy Rule Builder



This tool produces a specification document only. It does not validate logic, guarantee backtest accuracy, or constitute investment advice. All rule text remains in your browser.








          



1. Universe & Exclusions




Eligible Universe
*





Define which stocks are eligible for entry. Specifying the index as of signal date (not current constituents) avoids survivorship bias.








Exclusions
(optional)





List any sub-sets of the universe you will never trade, by sector, price, liquidity threshold, or instrument type.






          



2. Timing




Observation Timeframe
*





-- Select timeframe --


1-minute bars


5-minute bars


15-minute bars


Daily bars (EOD)


Weekly bars




The bar resolution used when computing signal values. Mismatching signal and bar resolution is a common source of look-ahead bias.








Decision Timestamp
(optional)





When in the bar/session is the signal evaluated and the order decision made? Defining this prevents implicit lookahead from using within-bar prices to trigger on the same bar.






          



3. Entry Signal




Signal Rule
*





State the entry condition precisely enough that two people reading it would compute the same set of qualifying stocks on the same date. Include indicator period, price reference (close/open/hl2), and all logical operators.








Threshold Values & Parameters
(optional)





List any numeric thresholds or indicator parameters separately. This makes parameter sensitivity testing easier to document.






          



4. Entry & Order




Order Type
*





-- Select order type --


Market order


Limit order


Stop-limit order




Specifying the order type determines what fill price assumptions are realistic. Market orders assume immediate fill at the ask; limit orders may not fill at all.








Fill Assumption
(optional)





Describe what price and conditions the backtest uses as the entry fill. Unrealistic fill assumptions are one of the most common causes of backtest-to-live divergence.






          



5. Exits




Stop Rule
*





The loss-limiting exit. Required, a strategy without a defined stop has undefined maximum loss per position.








Profit Target / Exit Rule
(optional)





The gain-taking exit trigger, if any. Can be price-based, indicator-based, or a fixed return target.






Time Exit / Maximum Holding Period
(optional)





A time-based exit prevents indefinite position holds when neither stop nor target triggers. Particularly important for mean-reversion strategies.






          



6. Position Sizing




Sizing Method
*





-- Select method --


Fixed dollar amount per trade


Fixed R (risk amount per trade)


Percent of account equity


Other (describe in parameters)




Position sizing determines how many shares to buy. Fixed-R ties size to the stop distance so risk per trade is constant regardless of stock price or volatility.








Sizing Parameters
(optional)





State the specific numeric values used (account risk %, dollar amounts, R size). Include any per-position cap.






          



7. Portfolio Constraints




Maximum Open Positions
(optional)





Without a position cap, a concentrated signal date can force an unrealistically large number of simultaneous entries in a backtest.






Maximum Correlated Exposure
(optional)





Limits exposure to a common risk factor, sector, market cap, or single name. Prevents a sector event from causing simultaneous stops across the whole book.






          



8. Event Policy




Policy Around Scheduled Events
(optional)





-- Not specified --


Hold through scheduled events


Close position before event


Allow existing positions, no new entries before event




Earnings, FOMC decisions, and CPI releases cause volatility spikes that may trigger stops intraday. An explicit policy prevents ad hoc decisions during live trading.






Scheduled Events to Avoid / Monitor
(optional)





List the specific event types this policy applies to.






          



9. Execution Costs




Estimated Spread Cost (bps)
(optional)





Half-spread cost in basis points. For liquid large-caps this is typically 1-5 bps. Enter 0 to assume no spread cost in the backtest (optimistic).






Commission ($ per share)
(optional)





Per-share commission. Many retail brokers charge $0 commissions but route through payment-for-order-flow venues that widen the effective spread.









Build Specification


Clear All






        



### Specification Output









Optional fields left blank:












Export as JSON


Copy to Clipboard



          




#### Research Checklist, Items This Specification Does Not Verify



1. **Data source verified.** Confirm the price data is not adjusted-close-only when using intraday signals. Adjusted data can introduce look-ahead when dividends or splits alter historical prices.
2. **Out-of-sample test defined.** Reserve a hold-out date range before looking at any results. Define it now, before touching the data, or the spec is not genuinely out-of-sample.
3. **Fill assumptions match broker capabilities.** Verify that the fill price and timing assumed here are achievable with your actual broker and account type, market-on-open fills require specific order submission windows.
4. **Borrow availability confirmed for short strategies.** HTB (hard-to-borrow) stocks may be unavailable or carry high locate fees that eliminate edge. Confirm locate costs for the target universe if the strategy sells short.
5. **Regulatory review completed.** Check how your broker applies FINRA day trading and intraday margin requirements (FINRA Rule 4210 was amended effective June 4, 2026, and the former $25,000 pattern day trader minimum equity requirement no longer appears in the rule text), along with other margin requirements and any exchange rules affecting the instruments or order types in this strategy.
6. **Tax impact estimated.** Short-term vs long-term capital gains treatment depends on holding period. Frequent turnover strategies may carry substantial tax drag. Consult a qualified tax adviser.
7. **Drawdown tolerance defined and tested.** Confirm the strategy's maximum historical drawdown is within the account's psychological and financial tolerance before committing real capital.
8. **Review schedule specified.** State how often you will evaluate whether the strategy's edge remains intact, market regimes change and a profitable specification becomes unprofitable without periodic review.












## References



- [Investor.gov: Pattern Day Trader](https://www.investor.gov/introduction-investing/investing-basics/glossary/pattern-day-trader): the day trading margin rules referenced in the research checklist's regulatory-review item.
- [CFA Institute Research and Policy Center](https://rpc.cfainstitute.org/): general backtesting and out-of-sample testing methodology background for the checklist items above.



This tool produces a documentation artifact only, it does not validate a strategy's logic, verify data availability, or evaluate expected value.








## Intended Use and Limitations



The Stock Strategy Rule Builder produces a documentation artifact. It does not validate the logical correctness of your rules, verify that the described signals can be computed from available data, or evaluate whether your strategy has positive expected value. A complete rule specification is a necessary precondition for a credible backtest. It is not a substitute for one.



Nothing produced by this tool constitutes investment advice, a trading recommendation, or a guarantee of future performance. The purpose of the research checklist is to surface the most common gaps between a written specification and a production-ready strategy. It is not exhaustive. All trading involves risk of loss.






## Related Reading

- [Trading Strategies: overview of strategy categories and approaches](https://www.getswoopr.com/stocks/trading-strategies/)
- [Backtesting: how to test a strategy specification with historical data](https://www.getswoopr.com/stocks/backtesting/)
- [Position Sizing & Risk Per Trade: depth on sizing methods](https://www.getswoopr.com/learn/position-sizing-risk-per-trade/)
- [Execution Cost Calculator: model spread and slippage assumptions for the Execution Costs section](https://www.getswoopr.com/tools/execution-cost-calculator/)
- [Free Stock & Crypto Trading Tools](https://www.getswoopr.com/tools/) the section this guide belongs to
- [APY / Effective Yield Calculator](https://www.getswoopr.com/tools/apy-effective-yield-calculator/) a companion guide in this cluster
- [Balance Transfer Calculator: The Fee Against the Interest It Buys Out](https://www.getswoopr.com/tools/balance-transfer-calculator/) a companion guide in this cluster
- [CD Ladder Builder](https://www.getswoopr.com/tools/cd-ladder-builder/) a companion guide in this cluster
- [Company Metric Comparison Dashboard](https://www.getswoopr.com/tools/company-fundamentals-comparison/) a companion guide in this cluster
- [Compound Growth & Contribution Calculator](https://www.getswoopr.com/tools/compound-growth-calculator/) a companion guide in this cluster
