MarketInOut Stock Screener Log In | Sign Up
 

Backtest Builder

Test a trading strategy on historical data before you risk real money. Set the entry and exit rules with the criteria builder, a formula or a saved stock screen, choose long or short positions, and add a stop loss, trailing stop, take profit or time-based exit. Define the capital, position size, portfolio size, commissions and spreads, pick any year since 2000, and compare the results with a benchmark. Learn more.

Strategy Name **
Type of Positions **
 Position Opening 
Criteria for Opening a Position **

 
 
 
Prioritize Stocks by [?]
Order Execution Model **
%
Limit Market Entry to
 
 Position Closing 
Criteria for Closing a Position

 
 
 
Order Execution Model
Limit Market Exit to
 
 Position Maintenance
Unit
Stop Loss,
Trailing Stop Loss,
Take Profit,
Close position after
trading days/bars
Close position at the end of
 Backtest Parameters 
Initial Capital, $ **
Capital at Risk, per Trade **
Portfolio Max Size **
Commission, per Trade **
Avg Bid-Ask Spread, % **
Backtesting Time Period **
    
  -  
Benchmark
 
Assign icon        [clear] [?]

 ** - mandatory fields

How does backtesting work?

When you create a trading strategy that contains all necessary criteria and the selected historical year for comparison, backtesting applies this information and simulates trades for every matched stock based on each day of the selected year. Any matching stocks will be put into your virtual portfolio, and any that are not will be ignored. Even if some stocks, however, do match the criteria, they will still be ignored if there are no vacant positions in the portfolio. Traders typically do not add a large number of stocks to their portfolio because the purpose is to control risks (20-30 stocks generally suffice). Portfolio size can be specified along with other parameters during strategy creation.

Also, if some stocks in the virtual portfolio conform to exit criteria, stop loss, or take profit condition, the corresponding position will be closed. Users can specify the criteria for closing positions. In this case, stocks that were purchased earlier are sold and will be reflected in simulated trades. The position is then closed, which allows for vacancies in the portfolio. The trading simulator takes several seconds to perform the analysis. Testing results and a list of executed virtual trades are displayed on the backtesting report page.


Stock Backtesting FAQ


What is backtesting?

Backtesting runs a trading strategy on historical data to show how it would have performed. The Backtester simulates every trade your rules would have made, with your capital, position size, stop loss and trading costs, and reports the profit, the drawdown and the full list of trades.

How do I set the entry and exit rules?

Build the entry and exit rules with the criteria builder, write them as a formula or pick a saved stock screen, and choose long or short positions. Positions can also close on a stop loss, trailing stop or take profit, after a set number of bars, or at the end of each day, week, month, quarter or year.

How far back can I backtest stocks?

Price history goes back to 2000, so you can test any year since 2000 or a custom date range. During the 7-day free trial, backtests run on the current year only.

How are commissions, spreads and order execution modeled?

Set the commission per trade as a fixed amount or a percentage, and the average bid-ask spread. Orders are filled at the close, at the next day open, or on the next day only if the price meets a condition, such as a gap up or a move above the previous high.

Is the backtest free of survivorship bias?

Yes. Delisted stocks stay in the data, and fundamentals and index membership are stored as of each date, so the results are free of survivorship and look-ahead bias. Prices are adjusted for splits and dividends.

What results does the backtest show?

The equity curve compared with a benchmark such as the S&P 500, the maximum drawdown, the market impact of your trades and the Overall Viability Score, which rates how ready the strategy is for live trading. Every simulated trade is listed, and you can export the list to CSV.

Can I optimize the stop loss and take profit?

Yes. The Position Maintenance optimizer tests a range of stop loss, trailing stop and take profit values, for example from 10 to 20 percent in steps of 2, and shows the results side by side. You can also find the stocks on which your strategy performed best.




Disclaimer - Privacy Policy - Terms of Service - Cookies - FAQ - Affiliates - Blog