|
|
|
Log In | Sign Up | ||
How to Backtest a Stock Screening Strategy, Step by StepA screen tells you which stocks match your rules today. A backtest tells you what would have happened if you had bought every match in the past and sold it by your exit rules. It’s the quickest way to find out whether an idea is worth your money before you risk any. Here’s how to set one up in MarketInOut’s strategy backtester, step by step, and how to read the results. Step 1: Write the entry ruleOpen the Strategy Backtest page, name the strategy and choose Long or Short. Then set the criteria for opening a position, in one of three ways:
For example, buy S&P 500 members when the price crosses above its 200-day average: index(sp500) and price ca sma(200) If you’d rather not write formulas, describe the idea to the AI screener, then copy the formula it writes into the backtester. Step 2: Choose the stocks to test onThe backtester has no separate field for the stock list: the universe is part of the entry formula, just as in the screener. Some options: index(sp500) and ... /* S&P 500 members */ exch(tsx) and type(stock) and ... /* stocks on the TSX */ ticker(aapl, meta, msft) and ... /* a few tickers */ [my long ideas] and ... /* a watchlist or portfolio, by name */ For a long list, create a watchlist and put its name in square brackets. If a saved screen runs on a watchlist, extracting the criteria from it brings the watchlist along. Forex and crypto strategies have their own Crypto Backtest tool. Step 3: Decide how positions closeA position can close in three ways, and you can combine them:
How stops behave in a backtest is not obvious; our guide to stop loss, take profit and trailing stops explains it with examples. Step 4: Set the money rules
How capital, portfolio size and position size work together is explained in how the backtester simulates trades. Step 5: Run it and read the resultsClick Backtest. The strategy is saved automatically, and the results page opens when the test finishes, which can take a few minutes. Look at these first:
Delisted stocks stay in the data, and prices, fundamentals and index membership are stored as of each date, so the test can only buy what was really there at the time. If the backtest is slowTest time grows with the size of the universe, the length of the period and the complexity of the entry rule. Start with a shorter period or a smaller universe, such as one index, and widen it once the strategy looks promising. Common mistakes
FAQCan I backtest for free?The free version and the 7-day free trial run backtests on the current year, and the free version can’t save them. A Pro membership tests the full history, which goes back to 2000. Can one strategy go long and short?No. Long and short positions can’t be combined in one strategy. Create two strategies, one long and one short. Where can I read more?The help pages cover setting up a strategy and backtesting a custom list of stocks. |
Disclaimer - Privacy Policy - Terms of Service - Cookies - FAQ - Affiliates - Blog |