The Strategy Tester enables you to easily test entry and exit strategies over any period of time.
You can access the Strategy Tester by clicking on the Strategy Tester button (#1) located in the right-side of the top menu bar.
The Strategy Tester will appear below the primary price chart. Use the Maximize toggle on the far-right to make the Strategy Tester larger.
Start by specifying the Chart Type, Timeframe, and Data Depth, as well as the Trade by Next and Short/Long settings. The Trade by Next enables you to select the most realistic entry criteria for your trades. For example, the Close setting means that trades are placed after the next candle's close rather than its open.
Next, you can specify multiple Entry Conditions and Exit Conditions. Click Add Parameter Here to create a new script and then select a condition or load an existing script template. Exit conditions include both conditions and Take Profit, Trailing Stop, and # Candles Passed capabilities. You can also add a Stop Loss as a static percentage. You can also add negative conditions (e.g. "none of the following") to identify cases where certain candlestick patterns haven't evolved over time when other conditions are true.
Defining Entry Conditions
The first step is defining an Entry Condition — or “when to buy” (#2). You can define these entry conditions using the same visual editor that powers TrendSpider’s multi-factor alerts. For example, you might create an entry condition where the SMA 20 is above SMA 50 and the “4 Green Candles” pattern forms.
Defining Exit Conditions
After you’ve added an Entry Condition, you need to decide when to exit the positions — or “when to sell” — by setting Exit Conditions (#3).
The Strategy Explorer offers a few options:
- The most obvious option is adding another “Script” (e.g. the same kind of multi-line conditions as the Entry Condition).
- “X Candles Passed” exits the position after given period of time (e.g. “5 candles”). This is not very useful for real trading conditions, but we’ve added it for research purpose only (e.g. when you’re willing to focus on exploring Entry Condition only).
- “Take Profit” exits when your position gains more than X%. The logic uses a "Limit Order" to provide a realistic price.
- “Stop Loss” exits when your position loses more than X%. The logic uses a "Stop Market" order to provide a realistic price.
- "Trailing Stop Loss" exits when your position loses more than X% on a given day. Note: This exit condition can be imprecise for very long candles, but closely matches reality in most situations.
You can use any combination of these conditions.
For example, you may exit the position when the SMA 20 crosses down through SMA 50 and implement a 2% stop-loss.
When you're ready to run the test, simply click the Test button (#4).