Build An Automated Trading Strategy With Tradestation Strategy Builder

Posted in: Advanced Trading Strategies, Trading Article

READ LATER - DOWNLOAD THIS POST AS A PDF >> CLICK HERE <<

You don’t have to be a programmer to build your own automated trading strategy. If you use TradeStation you can create a custom strategy using a slew of built in strategies and trading indicators that you can mix and match.

In this article we’ll show you how to put together a simple system using these Tradestation tools.

 

Adding Automated Trading Strategy Elements

This image shows how to add the strategy elements to a chart.  In this case we’re using a daily chart of Apple Computer stock (AAPL) for our testing.

Adding Automated Trading Strategy Elements
Adding Automated Trading Strategy Elements

To begin the process insert a strategy as highlighted in A above. This opens the Insert Strategies window, shown in B. Every line in this window represents a different strategy element, either an entry strategy or an exit strategy, for either longs or shorts.

The columns indicate the type of strategy element: buy for a long entry, sell for a long exit, short for a short entry, and cover for a short exit. You can sort on these columns to help in your search.

We’ll start out by adding the _Stops & Targets strategy to our chart. This strategy issues sell and cover orders to exit trades. Highlight C shows the inputs for this strategy. If the first input is set to 1 then all the subsequent inputs apply to a single share or contract, and in the defaults it tells TradeStation to exit trades when either $5 per share in profit or $1 per share in loss is reached.

Note that this strategy element is very flexible as it also allows you to use break-even and simple trailing stops.

 

Decide On Trade Entry Criteria For Your Trading System

Having selected the basic exit strategy, we next focus on the entries. There are many options here also:

  • Breakout entries
  • Fading entries (mostly oscillator based)
  • Volume
  • Volatility

You can learn more about each by pressing the Definition button in the Insert Strategies window, which will open the TradeStation Help description of how the strategy works and what all the inputs represent.

Trade Entry Criteria For Your Trading System
Trade Entry Criteria For Your Trading System

Here we select the Moving Cross entry strategies. Note that we select two separate strategies here, one for entering longs (buy), and one for entering shorts (sell).

You don’t have to use the same type of strategy for both long and short, you could combine the Moving Cross LE (long entry) with a Moving 2Line Cross SE (short entry) for example. But we’ll keep it simple by choosing the same trade entry method for both longs and shorts.

Highlighted in C you see the Format Strategies window which now contains our single strategy to exit long and short trades and one strategy each for entering longs and shorts.

You can now view the Strategy Performance Report from the View menu and see how your strategy performs. Odds are that it won’t be perfect because not every strategy will work the same way on every instrument and time frame. Some tweaking will be required.

Fortunately TradeStation gives us powerful tools to do this. It allows us to essentially optimize every input in every strategy element.

 

Using Tradestation To Optimize Your Trading Strategy

This graphic makes it easy to see how easy it is to optimize a strategy.

Using Tradestation To Optimize Your Trading Strategy
Using Tradestation To Optimize Your Trading Strategy

We open up the Format Strategies window and select the _Stops & Targets strategy. Press Format to get to the strategy inputs. In this example we highlight the input ProfitTargetAmt and press Optimize. This opens the Optimize window for that input. Simply give it a Start and Stop value and an increment, and TradeStation will calculate the system’s profitability for each step.

In this case we’ll test profit target amounts of $10, $20, $30, etc. all the way to $200. You can repeat this process for every input in every strategy, but just be careful not to over optimize. It’s best to stick with default indicator values as much as possible, although I do recommend optimizing the profit and stop loss amount for each symbol and time frame tested as their normal movement range can vary greatly.

4

 

Crunch The Numbers For Your Trading Strategy

Once TradeStation completes its optimization you can look at the results in the Optimization Report, which you access from the View menu. In our example you can see that all profit amounts tested yielded positive overall trading results, which indicates that the system is fairly robust on the daily AAPL chart.

Crunch The Numbers For Your Trading Strategy
Crunch The Numbers For Your Trading Strategy

You should always be careful if the best result is a big green number surrounded by much smaller green values or even red results. This is a clear sign of curve fitting or over optimization.

Fortunately that’s not the case here.

In our example we only optimized the profit amount and the stop loss amount. We did not optimize any of the entry strategies’ inputs. The results turned out to be quite strong, as you can see in the graphic above.

The Strategy Performance Report is also accessed through the View menu, and we show two pages from the report, the Performance Summary and the Equity Curve Line. The figures in the report are based on trading 100 shares of AAPL over a two year period.

The overall profit is over $42,000, not counting slippage and commissions, and although the win percentage is only 44%, the size of the winners is more than twice the size of the losers, giving us an average net profit per trade of almost $600 per 100 shares traded, more than enough to cover normal commissions and slippage.

If you apply the same system to a different instrument the results can be very different however, so be sure to at least rerun the optimization for the profit and stop loss amounts.

 

Be Independent And Design Your Own Automated Trading Strategy

This approach obviously is not perfect.

While it works well on daily charts its application to intraday charts is hampered by the fact that we cannot set a start and stop time for day trading, so trades are taken around the clock. Nor does this approach allow for any power of quitting rules, such as stopping trading if the first trade of the day is a winner or if we’ve booked a total of $100 or more for the session.

It’s also impossible to apply filters, for example only entering long trades if the 50 period EMA is above the 200 period EMA.

The approach does however give us an excellent starting point for testing different strategies that we can later enhance through additional programming.

If you use TradeStation try building your own system with these tools. There are a wide variety of entry and exit strategies, experiment with them and try your own creative combinations. Your ticket to trading income independence is waiting to be discovered.

The following two tabs change content below.

NetPicks

× Comments are closed.