Introduction
Introduction
Welcome
Welcome to AlgoWizard (AW). AW is a tool that helps you to create algorithmic trading strategies in a simple way without any programming. It allows you to backtest them right away and then export the strategy code to your favorite trading platform and trade it on demo or live account.
Quick orientation
This is how main screen of AlgoWizard looks like:
Editor tab is the core of AlgoWizard. Here you can create, modify and backtest your strategies. Let's look at the screen in more details:
- Editor area - this is where you edit your trading conditions. You can see on the screenshot that it is quite simple - just add conditions when to buy / sell and potential Stop Loss and Profit targets. Profitable strategies don't need to be overly complicated.
- Additional settings area - there are several additional things that can be configured for trading in addition to strategy rules. For example variables, Money management, other trading options.
- Testing toolbar - here you can run your quick or full backtests and configure all the backtest parameters.
- Results mini panel - it shows you the metrics and equity of your most recent backtest. You can click on it to go to the full results panel.
- Main toolbar - Icons and menus for standard things like working with files, showing results, sharing and the actual amount of your SQCoins (backtest credits).
Main concepts
There are few main concepts you should familiarize with when working with AlgoWizard:
- Strategy trading strategy is simply a set of trading rules - when to enter, when to exit, possibly when to move your protection stop etc. AlgoWizard allows you to define these rules in a simple way, you only have to construct it from the predefined blocks - conditions, values, comparisons, actions.
- Backtest is a result of strategy test on historical data. The exact backtest configuration can be done in backtest setting (point 3 in the image above). There you can configure symbol, timeframe, date range, spread and many other things.
- Backtest credits - SQCoins Because backests run on our cloud servers, we introduced SQCoins "currency" that is used to measure the processing utilization a backtest requires. The utilization amount and number fo SQCoins spent in one backtest depend on the number of ticks simulated, so it depends the length of history data used and on backtest precision. It is not that much dependent on timeframe you use. As AW user you have certain amount of SQCoins per month that you can spend according to your AW plan. When you spend all your coins you will be not able to make any more backtests for the rest of the month, or you can purchase additional SQCoins. Example estimates: Quick backtest on one year data EURUSD/H1 with lowest precision: 1-3 SQCoins Full backtest on whole EURUSD /H1 data (17 years) with lowest precision (only Pro version): 50 SQCoins Full backtest on whole EURUSD /H1 data (17 years) with minute precision (only Pro version): 3000 SQCoins
-
Backtest precision there are two possible precisions:
- Selected Timeframe, which means the backtest is simulated on the candles of your timeframe. So if you have H1 (hourly) bars, bacttest engine will simulate 4 ticks per every hourly bar.
- 1 Minute, which means backtest engine simulates 4 tick every minute, so it looks for movements also inside the one hour bar.
It is not always necessary to use the highest precision to test your strategies. To spend less conis it is usually sufficient to use Selected Timeframe precision to get a quick assessment of the results, and use higher precision only for final tests. * Full / Quick backtest there are also two backtest types: * Quick backtest makes a very quick backtest on last year of data with Selected Timeframe precision. It uses low resources and it can be turned on automatically - which means it will be performed every time you modify the strategy. * Full backtest is a backtest on the defined history range, which could be 17 or more years for forex data. You can also configure it to use the higher 1 Minute precision. * Simple / Full Wizard AlgoWizard has two editors in one application. * Simple Wizard - can be used for strategies that don't require complicated internal logic. * Full Wizard is little bit more complex, it gives you the possibility to specify unlimited number of rules that are evaluated on each bar.In each of these rules you can open or close your position, or perform some other checks and computations. This way you can create strategies with very complex internal logic. Full Wizard is explained more in its own section of this help.
Simple Wizard
Layout
Simple Wizard editor is as simple as it gets. There are only two sections - one for configuring Buy (Long) orders, and the other for Sell (Short) orders.
- Order type - the first thing you can configure is order type. You can use Market, Stop or Limit orders. For Stop/Limit orders you will also have to specify its stop/limit price level.
- When condition(s) - here is where youu can specify conditions that have to be valid to open the Buy trade. The condition can be simple, for example "CCI(20) crosses above 0" or it can be more complex.
- Exit types (optional) - you can optionally use any of the predefined exit types - Stop Loss, Profit Targer or exit after given number of bars.
- Exit when conditions (optional) - you can additionally enter another set of conditions that have to be valid to close the trade, for example "CCI(20) crosses below 0".
- Sell short section - Sell section is identical to Buy section, with one additional possibility - you can configure Short rules to be symmetrical to Long. If enabled, Short section will be not editable and instead of that AlgoWizard automatically creates all its conditions to be symmetrical with the Buy conditions and exits. So for example, if your Buy condition is "CCI(20) crosses above 0" then your symmetrical Short condition will be "CCI(20) crosses below 0". AlgoWizard saves a lot of duplicate work of specifying the Short conditions yourself, and you should use it (it is turned on by default) if you don't have some special strategy that uses Sell orders that are not symmetrical to Buy orders.
Working with conditions
To add some condition click on "Add new entry condition" button.
This will open dialog where you can choose or construct your condition from the predefined existing building blocks:
On the right side there is a tag cloud of most recently used conditions and blocks. On the left side there is a search field and a number of list boxes, each with a different category of building blocks. Just as an example, let's try to construct simple condition EMA(20) crosses above EMA(50). The easiest thing to do is to use the search field on the top, just go there and start typing "EMA" ...
Now select EMA indicator from the list. It will be selected and on the right side you can see all the parameters of this block. EMA has several parameters, we want to use EMA with period 20, so we'll edit the Period field and type 20 there. Then we can click on Confirm to confirm adding this block to the strategy.
The new condition with EMA was added to the strategy:
Note two things:
- Symmetric condition for Short rule was also automatically created!
- It is still not the final condition. We wanted to create condition EMA(20) crosses above EMA(50) but we have EMA(20) > 0 instead. It is because so far we only chose EMA indicator. AlgoWizard added some default comparison and right side, and we can change it now.
Simply click on the comparison to edit it:
A dialog for editation of condition will be opened. There select Crosses Above instead of Is Greater and click on Confirm:
Our condition was updated. Note that also condition in the Sell order is updated after a while. The remaining thing is to modify the right part of the comparison. So in the same way just click on the right side:
And as same as before search for EMA, select it and change its Period parameter. When it is done the result will be the conditions we wanted in both Buy and Sell short orders:
Full Wizard
Layout
Full Wizard editor is a fully featured editor that allows you to create very complex strategies. You can switch between Full and Simple editors when creating a new strategy or using the buttons on the top right panel:
Note - you can always switch from Simple to Full, but once you'll do something more advanced in Full editor it will be not possible to switch back to Simple Wizard. In Full Editor you are able to create unlimited number of Rules. These rules are then evaluated one by one on each bar / tick and they contain logic to open / close position or do something else. These are several types of rules, the most common one is IF-THEN like in the example below.
IF-THEN rule
Simply put, the rule checks if the conditions are valid and if yes it will run the action(s).
- Rule tabs - this is where you create one or more rules, and switch between them.
- IF CONDITION(s) - here's where you define the conditions that have to be valid in order to run the action(s).
- THEN ACTION(s) - here is where you define the action(s) that should happen once the conditions are true - it can be opening or closing a position, computing some internal variable and so on.
SIGNAL rule
is a special type of rule that allows you to create multiple "signals" and store their results into the internal variables. It will be better explained in the example later.
You can see that in this example there are four signals (only first two of them are used), an dthe first two are the conditions to enter long or short trade. You can also note that every signal is saved into its own internal boolean (true/false) variable. You can customize all this.
Concept - using rules for trading
As written before, in Full Wizard you edit the rules that are evaluated on every bar. If rule's condition is true, it will perform the rule action. So let's say we want to create a simple EMA Cross strategy that buys when faster EMA crosses above the slower EMA, and sells when faster EMA crosses below the slower EMA. It is the type of example we created in the Simple Wizard section. EMA Cross strategy rules can be defined like this:
IF EMA(20) crosses above EMA(50) THEN Buy at Market;
IF EMA(20) crosses below EMA(50) THEN Sell at Market;
and this is exactly how we can create this strategy in Full Wizard. We'll create two IF-THEN rules, first one for long entry and second one for Short entry: Long entry rule:
IF EMA(20) crosses above EMA(50) THEN Buy at Market;
Short entry rule:
IF EMA(20) crosses below EMA(50) THEN Sell at Market;
Alternatively, we can create the same strategy in a slightly different way - using a SIGNAL rule and two IF-THEN rules like this:
Signal rule:
LongEntrySignal = EMA(20) crosses above EMA(50)
ShortEntrySignal = EMA(20) crosses below EMA(50)
Long entry rule:
IF LongEntrySignal THEN Buy at Market;
Short entry rule:
IF ShortEntrySignal THEN Sell at Market;
What's the difference from previous example? It got little bit more complicated, but there are few advantages of using SIGNAL rules:
- it clearly separates trading signals (entry/exit conditions) from the rest of the trading logic.
- we can see conditions for Buy and Sell all in one place - in Signal rule.
- this example is too simple, but you can have also signals for Long and Short Exit. You can then define your trading rules so that you'll buy only if ( LongEntrySignal=true AND LongExitSignal=false )
In the end it is up to you - AlgoWizard doesn't force you to use this style, you can define your trading conditions in any way you like.
Features
Backtesting
AlgoWizard allows you to use StrategyQuant backtesting engine with build-in high quality historical data from various providers. You can configure the backtests extensively using the Backtests toolbar settings. You can even turn on automatic backtests that will run quick backtest of your strategy upon every modification.
Backtest settings:
Note that some options might be enabled only in higher plans There are few main backtesting concepts:
- Backtest is a result of strategy test on historical data. The exact backtest configuration can be done in backtest setting (image above). There you can configure symbol, timeframe, date range, spread and many other things.
- Backtest credits - SQCoins Because backests run on our cloud servers, we introduced SQCoins "currency" that is used to measure the processing utilization a backtest requires. The utilization amount and number fo SQCoins spent in one backtest depend on the number of ticks simulated, so it depends the length of history data used and on backtest precision (not timeframe). Every user has a certain amount of SQCoins per month that he can spend. When you spend all your coins you will be not able to make any more backtests for the rest of the month, or you can purchase additional SQCoins. Example estimates: Quick backtest on one year data EURUSD/H1 with lowest precision: 1-3 SQCoins Full backtest on whole EURUSD /H1 data (17 years) with lowest precision (only Pro version): 50 SQCoins Full backtest on whole EURUSD /H1 data (17 years) with minute precision (only Pro version): 3000 SQCoins
- Backtest precision there are two possible precisions:
- Selected Timeframe, which means the backtest is simulated on the candles of your timeframe. So if you have H1 (hourly) bars, bacttest engine will simulate 4 ticks per every hourly bar.
- 1 Minute, which means backtest engine simulates 4 tick every minute, so it looks for movements also inside the one hour bar. It is not always necessary to use the highest precision to test your strategies.
- Full / Quick backtest there are also two backtest types:
- Quick backtest makes a very quick backtest on last year of data with Selected Timeframe precision. It uses low resources and it can be turned on automatically - which means it will be performed every time you modify the strategy.
- Full backtest is a backtest on the defined history, which could be 17 or more years for forex data. You can also configure it to use the higher 1 Minute precision.
Backtest results
Backtest results are previewed on the ain editor screen on the bottom right section:
By clicking on it you can switch to full Results view with more detailed analysis of strategy performance:
The very last tab Source code contains full source code of the strategy for each of the supported trading platforms.
You can Copy & Paste or save it to a file and retest or trade the strategy in your own trading platform.
Sharing
You can share your strategy with others, AlgoWizard allows you to create a shared snippet that you can post on your website, blog or forum. You can also choose to share only strategy results, or also its pseudo code revealing its inner rules, or even allow others to clone your strategy. Note that you can share only backtest. So the strategy has to be backtested before it can be shared and you'll be sharing this particular backtest result. You can find a link to share strategy on the top menu or above the backtest preview window:
When you'll click on it you'll see a dialog where you can configure what everyhting will be shared.
You can fill out name of shared startegy and skin (light / dark) of the snippet. The next two settings are important:
- Share strategy Pseudo code - if enabled, all the others will see also the pseudo code of the strategy, which can allow them to reconstruct it by themselves.
- Allow cloning - if enabled, shared strategy snippet will include a Clone button that will allow anybody to create a clone of this strategy, edit and use this clone any way he likes. Your original strategy will remain untouched.
Be aware that if you'll publish the strategy with Pseudo code or Cloning enabled then you are essntially giving it away to everybody for a free use. After you generated the shared strategy you'll be able to choose the look of shared snippet - full performance report, or small / tiny equity chart.
The dialog will show you the HTML code that you have to copy and paste it to your target page where you want the shared snippet to be shown. Example of full snippet:
Example of small snippet:
Example of tiny snippet:
Source code
AlgoWizard can generate full source code of your strategy for these platforms:
- MetaTrader4 (MQL4)
- MetaTrader5 (MQL5)
- Tradestation / MultiCharts (EasyLanguage)
It also generates Pseudo code that shows the strategy rules in human readable format. The quickest way to get the source code is by clicking on Source code icon on the main toolbar:
This will get you to Results screen and there to the very last tab Source code that contains full source code of the strategy for each of the supported trading platforms.
You can Copy & Paste or save it to a file and retest or trade the strategy in your own trading platform. You can switch the platform type using the list on the top.
Money management
AlgoWizard comes with predefined Money management (position sizing) methods. Their usage is optional, you can also set the position size using a fixed value or compute it yourself and usi it from variable. Money management configuration can be found on the top right panel:
By clicking on it it will open configuration dialog where you can choose between different Money management methods. Each method has its own parameters that can be configured.
Selected method is then used in strategy backtests and in the generated source code. However, you can choose to use a different management method when exporting the source code:
Strategy charts
Strategy trades on the chart on which it is attached. Most of trading platforms allow strategy to access multiple charts / symbols, so for example strategy might be running on EURUSD/H1 chart but some of its indicators might be computed from different timeframe or even different symbol. AlgoWizard supprts this. Note that it supports accessing other subcharts to get price data and compute indicators, but it will trade only on the main chart. You can configure the charts that will be available to the strategy on the top right panel:
There you can add multiple subbcharts that can be used in your conditions and indicators:
To set indicator to use subchart instead of main chart all you onlu need to configure its Chart parameter, telling it that this particular indicator should be computed from subchart #1, and not from the main chart (on which the strategy is attached).
Trading options
Trading options are additional options that are not directly a part of strategy rules, but they affect trading. An example might be limiting strategy to 1 trade per day, or automatically closing all trades at the end of Friday. Configuration of trading options are accessible from the top right panel:
By clicking on it it will open dialog where you can choose which of the available trading options should be active and their parameters.
Variables
Trading strategy often has multiple parameters. Almost every indicator allows you to configure its period, you can configure for example Stop Loss or Profit Target size. It would be inconvenient to put these values there as fixed numbers, it makes it difficult to find them later when you want to change them. AlgoWizard allows you to create an unlimited number of variables - they can be used either internally in the strategy, or they can be external and be configurable as the strategy parameters. Configuration of variables is accessible from the top right panel:
By clicking on it it will open a dialog where you can manage all the variables the strategy uses. There already might be some variables created when you created new strategy from template. You can configure name, type and default value for every parameter.
An important option is the check on the first column - if turned on, it means this variable becomes a strategy parameter, which means it will be configurable in the trading platform - usually when you add the strategy to the chart. When unchecked, this variable is used only internally without need for configuration. The usage of the variables in your conditions is simple - see below:
Simply click on the [...] icon next to the parameter and there you'll see all the variables of that type that can be used. If you select the variable it will be assigned to this indicator parameter instead of number value that was there before:
To stop using this variabe for this indicator parameter you can again click on [...] and choose Back to normal value
Sessions
Sessions are necessary when backtesting with Tradestation and Multicharts engine. They define market trading intervals for each day of a week. All trading will be done only in these predefined intervals. You can set up custom sessions to match the real sessions in your target Tradestation/Multicharts platform. By doing this, you will be able to get reliable backtest results matching with real trading. You can use sessions by selecting one in Session option in Editor's Trading Options. Please note that the Session option is available for Tradestation and Multicharts backtest engines only. It will be hidden and not used for the other types of engines. There are two default Session options - Forex_245 and Forex_247. These can not be modified or deleted. You can define your own session by clicking Add session button. This will create a blank session template. Another option is to select an existing session and clicking on Clone session button. This will show a name input dialog where you can fill the name of the new session. After submitting, a copy of the original session will be made. You can modify it afterwards. You can modify existing sessions by double clicking them. In Edit session template dialog you can see a list of session times.
These can be modified or deleted by clicking on the x link next to them. To modify a session time, double click it. An Edit session time dialog will show up where you can alter days and times.
For time inputs, please use a fixed format HH:MM and fill in the hours using 24h scheme. The checkbox on bottom indicated if the end time is also the end of the trading day. Tip: When modifying session times, you can use an Add Mon-Fri button feature. When you create monday session time and click it, it will automatically create the same session times for the rest of the week.
Custom indicators
Custom indicators section allows you to add custom indicators into the final source code of the strategy. If you can't find your favorite indicator in editor's options, this section will help you develop customized strategies that will use any indicators you want. Please note that custom indicators only serve to add custom code into the final source code of the strategy. A strategy using custom indicators therefore can't be backtested, because we are missing the indicator's real implementation during backtest. You can add a new custom indicator by clicking the Add new button. In Add new Custom indicator popup, you define the name of the indicator, it's parameters and outputs.
Start with filling in the name of the indicator file without extension. For example, if you have an indicator file called CustomIndicator.ex4 in your MetaTrader4 platform, just type in CustomIndicator. Then there is a short and long name. The short name is a name that you will see when using this indicator in editor. The long name is a name that this indicator will be accessible by in editor's Add new block dialog.
Next to Parameters section, there is also an Outputs section where you define output buffers and source code calls of the indicator.
You can add as much outputs as the indicator contains. It is up to you if you define all or just some of them. First fill in the name of the output. Then define individual source codes you want to use on the right side. You can refer your predefined parameters by surrounding their names with hashtags (#). You can also refer shift by using #Shift#. This is just a demonstration of the use of this feature, you may want to write the code differently depending on the individual indicator you are adding. After saving the custom indicator, it will be saved in your account and become accessible in the Editor. You can modify existing custom indicators by double clicking them. For more information, please visit StrategyQuant documentation