To understand the strategy builder it’s better to read first the introducion into the Active Trader coding. But it is possible to understand it basicly of without reading it.
Following example shows how to build a simple strategy in GBPUSD H1 chart. The same example strategy we provide as set file ATgbpusdStrat1. Maybe the strategy works in other currencies or timeframes too. Of course setting and testing like the following can be done with a demo version of Active Trader.
Of course you can build strategies in any period, currency pair or cfd with the Strategy Builder. Note that the parameters for the current day hhd and lld only have the right values in H1 chart.
The best base to build a strategy is deriving it from the chart. Let’s say you see an event in a chart like in the pics below. This might be a good entry point for a buy trade.
After a low, the low of the day until that moment, follows a strongly rising second or third candle.
To check this you first load the set file ‘ATStratBuildBasic’ into Active Trader. The file sets Active Trader to a basic configuration. Only usually used StopLoss, TakeProfit and Start/Stop hours are set. These setting can be adjusted later to your strategy.
The set file for the strategy below you can download here >>
To check a new strategy BuyActive must be set to 2 (or Sellactive=2 if you want to check a sell strategy). Then the own filters from the main strategy get a completely new function, they turn to own buy (or sell) triggers.
In the chart event the strong rising candle is our start of the buy trade. A strongly rising candle we define now simply as a candle that rises more than the average High-Low of the last 10 hours, what is ‘xx‘ in our active code.
The second condition is that the days low was recently, lets say within the last 3 hours. In our active code lld means lowest low of the day and ll3 lowest low of last 3 hours. So lld==ll3 means what we need: a days low within the last 3 hours.
So we set the buy trigger for r1>xx + lld==ll3.
To see if the set code is recognized correctly start a backtest in visual mode. In the upper left corner of the chart you can see if the code is correcty detected.
If we continue with the backtest in visual mode and one condition of the conditions chain is fullfilled the text changes. Instead of ‘Set’ before the condition appears ‘ok’ behind it. In live trading it is the same.
But watching the backtest in visual mode isn’t very interesting now, a test of the last 6 years would last a long time, so we disactivate visual mode and after the test we see the curve below. The result of our basic setup is positive but it needs some filtering, it has too many loss trades.
(Backtests for a new strategy should go over some years. We prefer starting Jan. 2013, before were really different market conditions. But it’s not bad if a strategy even shows a good backtest before 2013. DrawTrendlines and PanelButtonSize should be set to 0 to desactivate these functions. If not a backtest lasts much times longer.)
In the chart event we observed was our low below the low of the day before.
Expressed in active code: lld<lld1 . So we set this in OwnFilterB1c to check out if this improves the result. Now the backtest curve looks better.
Now we do some tests if there’s special hours where it’s better not to open a buy. After some backtests it shows that excluding 13 h improves the backtest a lot. With the new additional setting HoursNoTrB=13 the backtest curve looks like this:
Then tests with the setting VolaMinMaxB show that with a volatility below 120 most buys don’t have the power to reach TakeProfit. So we set next test VolaMinMaxB=120000 and get that curve:
Like this we can continue and find more conditions to improve our setup. In the members area we show how to continue.
Reverse the new strategy to a sell setup.
First we set Sellactive=2 and Buyactive=0 to test only the Sells.
For a buy trade we have r1>xx + lld==ll3
Now we want a candle falling more than average and the high must have happened during the last 3 hours.
f1>xx + hhd==hh3 is the active code here. Set this in OwnFilterS1a and …S1b it shows this backtest curve:
Before for the buy we added as third condition that the low of the day should be below the low of the day before: lld<lld1.
We turn this around for the sell setup. We add hhd>hhd1 in OwnFilterS1c – our days high should be above the high of the day before. Now the backtest curve looks better.
Now we do some tests to see if there’s special hours where it’s better not to open a sell. After some backtests it shows that excluding 11 h and 17 h improves the backtest o lot. With the new additional setting HoursNoTrS=1117 the backtest curve looks like this:
Like this we can continue and find more conditions to improve our setup.
Now we set again BuyActive=2, so buy and sell trades are triggered. Below the backtest curve. When sells don’t work well buys generate the profit and reverse.
The set file for this strategy you can download here >>
There is hundreds of strategies like this, some work in different currency pairs, mostly they must be adapted to the particularities of a currency. Then should be watched if the strategy and it’s filters must be adapted to changing market conditions. There’s no strategy that works for ever and ever without adapting it from time to time.
Don’t worry that the backtests are made in in ‘Control points’ model. This is not scalping where small things like slippage make a big difference. There are small differences to a tick backtest, but to find a new strategy Control points model is absolutely sufficient and much faster. The tests above are made with 24 points spread.
Colaboration, building new filters for our main strategy or developing complete new strategies is rewarded with free use of Active Trader. Read more >>