Creating and Training a New Strategy
This tutorial explains how to create and train a new strategy.
From the top navigation menu on the right hand side, click the icon and select the Chart page. When the chart is displayed, select any symbol of choice from the symbols dropdown. We’ll use Google (Goog) for this example.
Once the chart loads, choose a suitable time period and set the date range by clicking the calendar icon on the toolbar. This example will use Google daily chart (D1).
To train a strategy there needs to be at least one indicator. We’ll use four standard (built in) indicators for the purpose of this example. To add an indicator to the chart, click the indicators drop down and select Linear Regression from the drop down list. Repeat this to add a second Linear Regression indicator.
After adding the second indicator, click the cogs icon on the top toolbar. This will display the indicator settings panel. Change the line style and width on one of the indicators from the defaults so that the second indicator will be easily identified from the other.
Now click the parameters tab, and set the regression period for this indicator to 30. This will give us one fast indicator of 30 bars, and one slow of 100 bars.
Repeat the above steps and add an additional two indicators. We’ll add an RSI and a MACD and keep the settings at the defaults. With the four indicators, the chart should now look something like the one below.
Switch on training mode by clicking the hat icon from the toolbar. Click to close the panel. Training mode allows us to teach the strategy how we’d like it to work by showing it some example trades. In this example, we’ll just train some simple cases that buy dips and sell peaks.
To mark training points first make sure training mode is switched on. The hat icon should be red as in the screen below. Then pick an area of the chart, and zoom in if necessary. A training point should mark an ideal trade. That is, the entry and exit points that will define either a buy or a sell order.
To mark the first training point, click on the center point of any bar to mark the open. Then do the same on another bar to mark the close. Once the open and close are set the markers will change and will identify if the trade is a buy side or sell side.
After creating your training set, click the hat icon again to display the training panel. If you’ve made a mistake you can delete any of the points individually in the training set by clicking the cross on any point. Click on any row to display the open and close times on the chart. To start again and clear all of the training points, click the Clear button from the bottom menu. Note: Only do this if you want to start afresh and retrain the strategy with new training points.
Once you’re happy with the training set, click on the Train button. If all is well, you should see a message after a few moments, to notify you that the training is complete and the strategy can now be back tested.
Go back to the Strategy page by clicking from the top navigation menu. The new strategy should be at the top of the list. Click on the test icon (glasses) from the toolbar on the right.
The tester will run the strategy against your chosen symbol and time frame. The screenshot below shows the result of the back test. The upper chart shows the profit and loss over the set period. The lower chart shows the net holdings, long or short against a chart of the underlying symbol, in this case GOOG. The summary panel on the right shows the performance statistics, such as the number of buys and sells, the holding time, the win ratio and risk measures. If you’re viewing on a small screen, to view the right panel click the expand icon (arrows symbol) from the toolbar.
From the summary panel, clicking the Trades button will display a list of trades, and how they performed in back testing. You can export this list to CSV file from the export link on the top right of the menu.
Lastly we can optimize the strategy. To run the optimizer, go back to the Strategies page and click the Optimize icon for the strategy. In this example, we’ve run a deep scan and optimized against all parameters except for the holding size. After saving the optimized settings, go back to the strategies page and run the back tester again.
This shows the performance of the optimized strategy.