TSCI.pngTutorial 1: End of Day Trading (TradeStation)


For this first tutorial we will explore the functionality of the Tradescape platform for TradeStation using EOD (end-of-day) data. We will learn the basics of the platform while we explore actively trading an entity for a longer term investment as opposed to retaining it within a buy and hold. We will also cover the basics of signaling for the ordered movements within prices.

There is a separate Tutorial 1 for the Standalone version of the platform.

At the time of this writing, AAPL was under considerable pressure. We will thus explore the benefits of actively trading AAPL with daily data, and we will see what might be realistically expected from some basic trading system signalers implemented in conjunction with the Tradescape technology.

This tutorial will only lightly cover the basic Tradescape features. Most of our attention will be focused on exploring four classes of signalers for trading AAPL with daily data.

End of Data Trading and the Tradescape Paradigm

For a security traded during exchange hours, there will be about 250 closing end of day values in a year's data. For a decade of history, if it even exists, there will be about 2500 points. In this tutorial where we target the broad sweet spot for trading AAPL on an EOD basis, we will see about twenty round-trip trades in that decade's time. If we reserve a year's history for a blind walkforward, we should expect only a couple of round trips in that year's time.

In this tutorial we employ the principle of performing the signal design in a ten-year analysis period, and a blind walkforward in the latest year which we reserve for this purpose. We do so to illustrate several important points and because it is somewhat expected in terms of modern signal design. In the tradescape signal design paradigm, this separate reserved period is not necessary.

Note that we plot the 1-year walk-forwards as a tradescape. You could readily argue that only a fool would attempt to map a trading landscape with its sweet spot generating just two trades. When you see the 1-year tradescapes in the tutorial below, note the measure of robustness and continuity in the trading landscape. By contrast, you may want to imagine what you would see in an algorithmic optimization that used just 250 bars and consisted of two trades near the performance peaks.

When we speak of the tradescape's time horizon shifting in the 1-year walkforwards, please bear in mind that we are discussing just two round trip trades that occur in this year's time. When we do the 4-panel progressive tradescape, we see 2.5 years in each panel, but for the time horizon of interest that is still only about five trades each. It can be especially useful to see the variation across time within an entity's optimal time horizon, but it is also important to keep in mind how few trades are actually represented in these tradescapes. When there are so few trades, you should expect a good deal of shifting about within these trading landscapes since the dynamic of every entry and every exit will be unique.

Step 1: Generate a 10 year Basic AAPL Tradescape

•    In TradeStation, create a a daily chart of AAPL that dates back to 1-1-1997. To have everything synch up, use 02/27/2013 as the Last Date:

tutorial1A.png

This is the last portion of the data imported:

tutorial1A2.png

For the signal analysis within this tutorial, we will design signals using tradescapes based on ten years of history, from Feb 2002 through Feb 2012. We will blindly walkforward each signaler from Feb 2012 through Feb 2013. We want a signaler to manage the two sharp downturns in the last year of data.

•    Choose the Insert Analysis Technique... option in the TradeStation right click menu in the chart, and select the TSTradescape technique. Check Prompt for Format. Click OK. If it is not selected, go to the Inputs tab. We will initially use the defaults which give us a 10-year (2520 days) history in the tradescape. Click OK.

tutorial1B.png

•    You will see a message in the TradeStation Events Log indicating that the TSTradescape call was successful. Close this Log window.

 In a separate window, the AAPL tradescape will be plotted. By default it is a 2D contour plot as opposed to a full 3D response surface:

tutorial1C.png

•    8011.png Click the Display as 3D Gradient Surface button:

 

tutorial1D.png

A tradescape is either a 2D contour or 3D surface plot that visualizes the tradable order in a time series.

The Tradescape Plot

The tradescape concept is based on the principle that one can build a universal ideal signaler that separates the ordered movements of prices from the chaos or disorderly movements. Such signals are deliberately those that cannot be be used for real-world trading. Instead, the signals are drawn from the EM (expectation modeling) science and are used to build a picture of the trading landscape one point at a time.

The Expectation Modeling white paper covers the evolution of our thinking in the design of tradescapes.

The Reward to Pain white paper covers in detail the Z-axis (or color contour gradient) and why we elected to use a robust RRt as the default performance metric.

The Tradescapes topic contains detailed information that includes a breakout optimization that is mapped onto the tradescape coordinate system.

A tradescape plot is constructed using the variables we feel are the most important when seeking to trade the order or trending in a time series.

What Is Important in Terms of Signal Properties?

We have identified the following as the most important factors in a trading landscape:

(1) The information content or time horizon - as fitting fractal science, this is the amount of past and current information used to estimate the chaos-free central channel. There are certain time horizons which will be favorable and others less so.

(2) The responsiveness of the signaler - if one is trading order, there is lag in the signal's turns. This is also obvious: the greater the latency in signaling, the poorer the performance.

(3) The accuracy of the signal - also straightforward, if a signal misses a favorable entry or exit, or generates the small cycling known as 'whipsaws' in trading circles, the performance seriously degrades.

We consider only secondarily factors such as the asymmetry of the signaling algorithm, sentiment-augmented signaling, and referential signaling.

What Is Important in Terms of Trading Performance?

Here again we have identified the following as key factors:

(1) A robust estimate of the trend that represents the return or reward from the signaling. This must be as insensitive as possible to starting and ending dates, and be comparable across all time horizons. We prefer trading all equity with every trade and estimating a robust CAGR by a regression procedure that uses every data point in the equity curve.

(2) The pain of the trading - for any trend following signaling procedure, the drawdowns must be accommodated in a meaningful measure of pain. We prefer the average Retracement, Rt, a continuous metric that encompasses all drawdown pain and is probably the most useful metric in signal design modeling tools.

An Accurate Trading Landscape

One the issues with any real-world optimization, such as the two lengths used in an MA crossover, or the two window lengths used for upside and downside breakouts, is that only a modest portion of the trading landscape can ever be represented by these real-world algorithms. That portion that is represented will have variable accuracy at each set of parameters. There is no true picture of what is possible for each time horizon (how fast will I trade?) and for each lag (how good is my signaler?) because the real-world algorithm can map only a limited portion of the overall trading landscape and each point in that map will have a different measure of inaccuracy impacting the performance.

A tradescape seeks to furnish a fully viable and legitimate map of what is possible when trading the ordered or trending movements within a financial time series. The only way to do this with any validity and utility is to generate that landscape with as close to 100% accuracy as possible at every point, regardless of the lag.

We thus solve the issue of the three independent variables by designing an algorithm to be fully accurate. There must be no whipsaws, and this cannot be achieved using percentage, volatility, or error bands. That would be including chaotic movements in the otherwise ordered modeling. The EM algorithm must deliver this accuracy with just two variables. The first is a defined methodology for specifying the information content or time horizon of each window of data, and the other is an exact measure of introduced lag.

With an algorithm designed for full accuracy, or as close to such as can be crafted, there remains only the two variables in the tradescape, the time horizon and the lag fraction, expressed as the fraction of that time horizon.

The Tradescape Plot topic covers the different options for the x, y, and z (or contour) for a tradescape. We have included only those that we found consistently useful.

Step 2: Explore the Tradescape Plot

The 2D and 3D Rendering Options

Here are some useful items with which to become familiar:

•    8049.png Click on the Start/Stop 3D Animation to rotate the 3D surface in real-time. Click this button again to end the animation.

•    If you have a mouse with a center wheel, rotate it forward and back and you will see the XY view angle change.

•    8012_.png Click the Display as 3D Shaded Surface button to change to a shaded surface (light illumination) 3D plot.

•    8010.png Click on the Display as 2D Contour button to reset the default contour plot.

The Tradescape Plot's Z-variable Options

•    Select the Rģ-Trend:Retracement in the Z-axis Performance Metric dropdown to plot the surface instead of RRt.

•    Select the Sharpe-Trend:Volty in the Z-axis Performance Metric dropdown to plot the modified Sharpe surface.

•    Select the Trend % in the Z-axis Performance Metric dropdown to plot the robust trend surface.

•    Select the Trend rē in the Z-axis Performance Metric dropdown to plot the rē goodness of fit surface for the trend fit.

•    Select the Win % in the Z-axis Performance Metric dropdown to plot the win % surface.

•    Select the RRt-Trend:Retracement in the Z-axis Performance Metric dropdown to restore the RRt surface (default).

These are the six response surfaces that can be viewed in a tradescape plot.

The Tradescape Z-Axis Scaling Options

•    Select the Reward>0 (Win) in the Z-axis Lower Limit dropdown to scale the Z axis to a minimum of 0. All winning zones are now plotted.

•    Select the Reward>Underlying in the Z-axis Lower Limit dropdown to scale the Z axis to a minimum of the reward-pain in the buy-hold of the underlying. Only those zones where the trading improves on the reward-pain are plotted.

•    Select the Reward>Pain in the Z-axis Lower Limit dropdown to scale the Z axis to a minimum of 1. This is the default where only those zones where reward exceeds pain are plotted.

These Z-axis scaling options are important visualizations to display only profitable zones, only zones where the signaling improved upon the underlying, and only zones where the reward exceeds the pain as it is defined in the metric.

•    Check the Half Upper Limit box in the Z-axis options to halve the upper Z bound. This is especially useful for signal analyzes. Uncheck to restore the default upper bound.

The Tradescape X-Axis Time Horizon Scaling Options

•    Check the Avg Trade Length button in the X-axis Time Horizon option to change the X scaling to the computed average trade length.

•    Check the EM Model Length button in the X-axis Time Horizon option to change the X scaling back to the default EM (Expectation Model) length.

The Tradescape Y-Axis Lag-Fraction Scaling Options

•    Check the Expanded button in the Y-axis Lag Range option to change the default 0.7-1.2 lag fraction scaling to a wider 0.5-1.5 scale that accommodates both low lag and high lag signaling algorithms.

•    Check the Higher Lags button in the Y-axis Lag Range option to change the lag fraction scaling to 1.0 -1.25, the region where one might reasonably expect close to 100% signaling accuracy.

•    Check the Default button in the Y-axis Lag Range option to restore the default 0.7-1.2 lag fraction scaling.

Apart from customizations that are graph specific and accessed via the graph toolbar, these are the only adjustments to a tradescape once it has been created and displayed.

There is no need to close any tradescape before generating another. You can have as many tradescape plots active as you wish. They are generated independently of TradeStation; once the Event Log records a successful algorithm, all of the computation and graphing occurs in fully separate processes. Certain tradescape operations, especially Intraday Tradescapes, can be particularly computationally intensive. It is best these do not interfere with the TradeStation environment.

We will now work with Tradescapes to design an EOD signaler for AAPL.

Step 3: Estimate an Optimum EM Length (Time Horizon) Initial Target

•    Choose the Format Analysis Techniques... option in the TradeStation right click menu in the chart, select the TSTradescape technique, click on Status to turn it back On, and click on Format. On the Inputs tab, change the Reserved value to 252. Leave the WalkFwd value at 2520. Click OK.

tutorial1Z.png

We will reserve one year of data for a blind walkforward of the real-world signaling algorithm. The walkforward of the EM signal will be for ten years preceding this most recent year.

tutorial1F.png

While the proper modeling approach indicates we should not have included that most recent year's data in the original tradescape we created, it is useful here to compare the two. We will put them side by side here (you can do so by putting the two different applet windows side by side on your monitor):

tutorial1W.pngtutorial1X.png

A tradescape is a highly robust picture of the ordered trending in the price series. In general, adding or removing a smaller reserved zone isn't likely to alter the surface appreciably. That is important since this selection of a time horizon is the main item we carry to the signal design.

In a Tradescape signal design, there is no optimization of the real-world trading algorithm, only the choice as to where one wishes to "live" on a robust aggregate map of the trading landscape. That does require a matter of practical discovery as to which algorithms will offer this same time horizon at a respectable lag, and once that is found to answer the question as to how good the candidate signalers are in terms of accurately trading the order when delivering that target time horizon and that target lag.

There are subtle differences with and without the reserved period, but in general they would little impact our choice of a target EM length and lag fraction.

The default spectral gradient is useful in that one can look for an optimum in the different colors present. Our experience is such we would select an EM length of 20-25 as the time horizon target, and knowing the limitation of our signalers (these are very basic ones in this tutorial) we would target about a 0.9 lag fraction level of performance. We know that in order to get that performance, given the inaccuracies in these simple signalers, we will likely need to improve appreciably upon that 0.9 lag fraction.

As an explanation, the fastest zone (EM length 5) is narrow and the penalty for lag comes into play very swiftly as the lag fraction increases. This is an example of a time horizon better managed with intraday data sampling. It is not a good choice for trading daily data.

The upper zone apparent in the blue color is also narrower than the central zone, and it also begins to see its performance fall off swiftly with increasing lag.

The choice is really one of selecting the most robust region in the tradescape. We will thus initially target an EM length of 20-25 and a 0.9 lag. We understand that this choice is specific to AAPL daily data.

•    8056.png Click on the Select Color Gradient for Surface or Contour button in the graph toolbar. Select the 100 Cyan gradient. This generates a 100-color gradient using just the cyan color:

tutorial1Y.png

This produces a fuzzier picture of the RRt of the tradescape surface. Here we perhaps like that same 20-25 EM Length, but perhaps a bit less lag.

There are times when one is more interested in sharpening the differences in the visualization.

•    Select the 128 CGYR gradient. This generates a 128-color gradient using four specific colors:

tutorial1E.png
The distinct color gradients allow a ready assessment at different levels of the RRt space. Whether we use the green gradient or the more demanding yellow one, we still like the 20-25 EM Length.

•    Select the 128 Default gradient and click OK. This restores a 128-color spectral gradient with a grayscale gradient for reward-pain values less than 1 but greater than 0.

Before we explore a signal that functions at this 20-25 EM length and lag fraction 0.8-1.0, we will use two of the additional functions to explore signal asymmetry and constancy across time.

Step 4: Generate an Asymmetric Tradescape Panel

•    In TradeStation, insert a TSAsymTradescape Analysis technique with the following settings. We set Asymmetry to -2 to furnishes a faster (albeit smaller) matrix of asymmetries. Click OK.

tutorial1G.png

tutorial1H.png

There is a progress bar since nine different asymmetries are generated. The asymmetry is the ratio of the information content used for the upside transitions (turns to the upside) relative to the downside transitions (turns to the downside). A quick to enter but slow to exit long signaling system has an asymmetry less than 1. A slow to enter but fast to exit long signaling system has an asymmetry greater than 1. Typical signal asymmetries are between 0.25 and 4. The turtle HH=55 LL=20 breakout system is an example of an asymmetric signaler, one that for long trades is slow to enter and fast to exit, a signal asymmetry of 55/20=2.75.

It is common sense that any optimum asymmetry is a moving target. The sentiment of the markets has a profound effect on the asymmetry that works at any given time. The above plots range from an asymmetry of 0.25 in the first panel through 4.00 in the last panel. The symmetric case is in the middle. While it is clear that the slow to enter, fast to exit is not as favored in the extreme, overall the symmetric case, the center panel, looks to be the most robust. Since the symmetric case looks good, we will include moving average crossovers as real-world candidate signals.

Step 5: Generate a Progressive Tradescape Panel

•    Insert a TSProgTradescape Analysis technique with the following settings:

tutorial1I.png

We generate four different tradescapes that are sequential in time:

tutorial1J.png

These tradescapes would look even more distinct, one from another, were we to use even shorter time periods (here each panel reflects 2.5 years history). They would also shift depending on how the dates aligned with the decline of the financial crisis or any sustained surge. For the purposes of this tutorial, these four plots are sufficient. Clearly there are some strong periods and weaker ones. What we want to explore is whether the 20-25 EM length and 0.8-1.0 lag fraction is at least profitable in all time bands.

This speaks well of the challenge of building automated trading signalers. As we look at the zone we targeted for trading in each of the time segments, we see that selecting an optimum is now very difficult. It explains the fuzziness (the three distinct zones) in the integrated ten year tradescape. We are okay with the EM length choice of 20-25. In all four time segments, we see not only profit, but reward greater than the pain (as defined by robust trend and RRt) with the EM signaler. We make the leap we will find the same favor with the real-world signaler and its inaccuracies in terms of catching the turns. 2.5 year periods should show a good return.

•    Select the Trend % in the Z-axis Performance Metric dropdown to plot the robust trend surface.

tutorial1K.png

The AAPL robust trend across time is superb. Here the estimate of pain is absent. Only the fitted trend comprises the surface. In this instance, we see a 20-25 EM length as good in all four panels.

This is a good place to point out that the challenge is to design signalers that reflect the conditions present within each unique time segment. The ideal EM signal algorithm does not have this added intelligence. It should thus be possible to achieve a greater performance than these tradescapes if the subtle variations in each period are accounted, provided the algorithm can preserve accuracy. That last item is where we now begin. We aren't designing anything elaborate to trade the order. We will look only at two-pass moving averages, moving averages with epsilon signaling, HH-LL breakouts, and moving average crossovers. Each will teach us a good deal about trading order and illustrate the value of tradescapes for each class of signaler.

Step 6: Evaluate Real World MA Signals Against the AAPL Tradescape

To evaluate your real-world trading signals you will need to have some experience with TradeStation's EasyLanguage coding. You will need to modify the TSSigEval analysis technique to generate your specific trading signals. At present only binary signals are supported. You must code a 1 for in-market long, -1 for in market short, and 0 for out of market for each trading day. Example functions have been furnished for common MA, epsilon MA, breakouts, and MA crossovers.

If we look at trading order from the perspective of most closely matching the EM signals, it makes sense to begin with differenced moving averages. The signal is taken directly from the smoothed price in the MA. Typically, the slope of the moving average is used to generate binary entries and exits.

While directly signaling from the smooth curve hardly insures an attractive lag, it does generally imply a very low scatter (or standard deviation) in the lag that will be present at each of the signal turns.

The main problem with this type of moving average signaling is the 'whipsaws' that occur when the slope (the difference between the current and prior price) is near zero and the signs oscillate about zero generating a large number of short, usually meaningless trades, which are unlikely to be profitable in any significant way, and often generate losses. The most common way of dealing with this problem is to employ multiple passes of the moving average algorithm. Double and triple EMAs are frequently used, for example. In this tutorial, we will explore 2-pass EMA, SMA, WMA, and hybrids that smoothly transition from the WMA to the SMA. A two pass algorithm can eliminate most of these undesired oscillations, but at the added cost of the additional lag.

A two-pass SMA is often a good upper lag limit for tradescape work. Its lag is about as high as you would ever consider in a well-crafted signaling system and its accuracy is often close to complete. An SMA utilizes the information in its window to the maximum measure possible with absolutely zero intelligence.

A two-pass EMA is a good example of a moving average signaler that has a reasonably low lag, but suffers a good deal of inaccuracy, and this typically increases as the length of information processed in a window increases. We will use this two-pass EMA as the lower lag limit.

The two-pass WMA is usually slightly higher in lag than the EMA in practical signaling, but as many authors have pointed out, the properties of an IIR filter and an FIR filter are apples and oranges. Because the performance of an EMA degrades with increasing lengths, the WMA and EMAs often swap positions when a series of time horizons are represented in the test signals. The EMA will tend to fare better at lower time horizons since a lower length EMA was typically used to generate it.

We find it particularly useful to use a "raised" WMA that does not decay close to the minimum weight at the bound. Instead, an adjustable parameter is introduced to specify the height of the weights at the bounds. This creates a moving average that varies linearly between an SMA on one side to the WMA on the other. We do this to sacrifice some of the lag reduction arising from the WMA weighting, in favor of infusing the accuracy, however blind and lagged, of the SMA. In effect, we want an algorithm that can vertically march up and down the tradescape's lag-fraction dimension in order to find an algorithmic point where this fuzzy tradeoff between lag and accuracy results in the best performance.

We use a function we created for TradeStation, TSMA2Sig(Price,MAType,Length), to generate these two pass MA signals. It is written as it is for efficiency; we found more compact coding could increase the computation time by up to two orders of magnitude. This function uses a fast SMA for MAType=0, the EMA for MAType=1, the WMA for MAType=2, and a raised WMA function (TSRWMA) for MATypes 3, 4, and 5. In terms of the "distance" between a WMA and SMA, these are 75%, 50%, and 25% (MAType=3 is closest to the SMA, MAType=5 is closest to the WMA).

From our experience, we know that the 20-25 EM Length zone will typically be covered by 2-pass MAs in the 30-40 length region.

•    Use the View | Development Environment option in TradeStation and from the Development Environment, use File | Open, choose Indicator from the dropdown and select TSSigEval. Immediately use File | Save As and rename TSSigEval to TSSigEval_T1.

•    Change the line

   String SignalTitle("TSSigEval"), // signal title to be added to the Tradescape plot

      to:

   String SignalTitle("TSSigEval_T1"), // signal title to be added to the Tradescape plot

•    Delete all of the lines between these two markers:

   { ---------------------------------------------------------------------------------------------------------------
      Begin user-defined signal region of code, add up to 15 Signals
      --------------------------------------------------------------------------------------------------------------- }

 

   { ---------------------------------------------------------------------------------------------------------------
      End user-defined signal region of code
      --------------------------------------------------------------------------------------------------------------- }

•    Insert the following between these two markers:

   Signal[0] = 6.0; // signal count
   Signal[1] = TSMA2Sig(Price,0,30); // SMA
   Signal[2] = TSMA2Sig(Price,3,30); // 75% SMA, 25% WMA
   Signal[3] = TSMA2Sig(Price,4,31); // 50% SMA, 50% WMA
   Signal[4] = TSMA2Sig(Price,5,32); // 25% SMA, 75% WMA
   Signal[5] = TSMA2Sig(Price,2,38); // WMA
   Signal[6] = TSMA2Sig(Price,1,30); // EMA

•    Verify the technique and keep the development environment window open--we will revisit this process for the other types of signals.

•    Insert the modified TSSigEval_T1 analysis technique with the following settings and then click OK:

tutorial1T.png 

We will reserve the most recent year of data for a blind walkforward.

Please note that you must insure the TradeStation MaxBarsBack setting (the Maximum number of bars the study will reference in the General tab) is high enough to accommodate the signaling algorithms that will be called. TSSigEval is set to a user-defined value of 125. You will need to increase this if more bars than this are used in the computations.

•    Check the Expanded button in the Y-axis Lag Range option to change the default 0.7-1.2 lag fraction scaling to a wider 0.5-1.5 scale to accommodate the higher lag of 2-pass MA signaling algorithms.

tutorial1ZA.png

We've tweaked the lengths of the MA to get approximately the same time horizon from each, and to have each fall very close to the desired time horizon target of 20-25 EM Length. Each of the larger points with the numbers in them represent the 6 real-world trading signals. What should be immediately apparent is that the signal points 1-3 (each trading system point is colored by the RRt gradient of the tradescape) are close to matching the underlying tradescape. Signals 4-6 do not fare as well, despite having lower lag.

•    Check the Half Upper Limit box in the Z-axis options. This will make it easier to see the differences in the signals.

tutorial1ZB.png

•    Place the cursor on the point that is at 0 EM Length and 1 Lag Fraction:

tutorial1O.png

The fitted trend for these 10 years offers a 43% CAGR and an RRt of 2.34, superb for an underlying buy and hold.

We know the underlying RRt of 2.3 would plot as very light orange with this half-range color gradient, and here we see appreciably better performance than the underlying with all six systems. It is encouraging that systems 1-3, the SMA and the hybrid SMA-WMAs (75-25, 50-50), come close to matching the performance of the tradescape (the colors match).

•    Place the mouse cursor on signal 3:

tutorial1ZD.png

The lag is high, 26 bars, five weeks. As one would expect from this type of algorithm, the robust SD is just 2 bars (there is little scatter in the lag of the signals). We capture most of the order in the price movements, a 10.5% coverage error (the percent of instances where the real-world signal failed to match the tradescape's EM reference for this signal's estimated time horizon and lag).

That which should determine any final selection is the equity curve of the backtest and what occurs during the reserved data period.

•    Click the system 3 point, the 50-50 hybrid SMA-WMA (note that you can also see the equity curve for any of the tradescape EM signals by clicking on any tradescape point):

tutorial1ZE.png

This upper plot contains the equity curve for system 3 and for an EM signal representing exactly this same estimated EM length and lag fraction on the tradescape surface. The yellow equity curve is for the EM signal; the cyan equity curve is for signal 3. The analysis metrics are in the titles and can be customized to only show those of interest. This is the technology that goes into each tradescape point in the surface. For a standard tradescape, there are 700 in all. Here we see that system 3 is respectable, but it struggled somewhat near the end of this ten year period (as did the EM reference signal).

The EM signal (yellow) and the real-world hybrid MA signal (cyan) produce very close to the same equity curve. Here the real-world signal slightly exceeds the matching EM signal in terms of performance. The RRt of 3.18 is a nice improvement over the 2.34 of the underlying buy and hold. Also, the pain as defined by the average retracement drops to 10.6% as compared to 15.3% on the underlying. It is hardly spectacular, but it is very respectable for such a weak signaler.

•    Close the equity plot and place the mouse cursor on system 6, the 2-pass EMA:

tutorial1ZJ.png

The trend, Rģ. RSharpe, and RRt are all comparable, but the lag is sharply lower. Instead of 26ą2 bars, the lag here is 19ą5 bars. There are huge differences in the scatter of the lags for entries (ą3) versus that of exits (ą8). At 21.4%, the coverage error at the signal turns is much worse than the SMA, WMA, and the hybrids. This is typical of EMAs and their IIR (infinite impulse response) filter properties. They can sometimes perform very poorly because of their inefficiency at trading order in a consistent fashion. On the other hand, the much lower lag can make up for those deficiencies. Adaptive EMAs deliberately modify the one-parameter filter coefficient, often designated alpha, to attempt to map it to the speed of the movements in the prices.

•    Click on system 6:

tutorial1ZI.png

Here we have a higher count of trades and a shorter trade length (this signaler was shifted to the far left of the 20-25 target band).

The purpose of this segment of the tutorial was to illustrate the tradeoff between accuracy and lag in real-world signalers. A signal with higher lag can have a better aggregate performance simply because it can more accurately trade order. For this type of signaler, we trade mostly the order in the time series, albeit at a high lag. The progressive (sequential in time) tradescapes suggest we may not want to trade system 3, system 6, or any signal at this high a lag. if we did, however, we would likely choose the one offering the lowest lag, our reservations with EMA signalers notwithstanding.

In order to understand why electing the lowest lag often makes sense, let's see what the blind 1-year walkforward of these six signals looks like.

•    Choose the Format Analysis Techniques... option in the TradeStation right click menu in the chart, select the TSSigEval_T1 technique, click on Status to turn it back On, and click on Format. On the Inputs tab, change the Reserved value to 0. Set the WalkFwd value at 252. Click OK.

•    Once more, check the Half Upper Limit box in the Z-axis options.

tutorial1ZG.png

This is not the ideal. The blind year functions at a time horizon that is well away from the ten year historical average. This is the gamble anyone makes when signaling at higher lag fractions. That is why it is so important to be able to identify the amount of lag in one's signaling system. If you look back at the progressive tradescapes in step 5, you see that life becomes dramatically 'iffier' when you operate at higher lag fractions. We do so here simply because we are testing two-pass MA signalers. For this most recent year, AAPL's one-year tradescape suggests a time horizon that is significantly less than the 20-25 we targeted from the ten year aggregate. We were effectively in no man's land.

With just two trades to identify lag, the estimates can be inaccurate, although here systems 1-6 track in the expected order for the lag. In this instance, the lowest lag signal in the ten-year study, the two pass EMA, is also identified as the lowest lag signaler here in this one-year blind walk forward. This signaler is shown as far from the ideal time horizon for this time period, but the lower lag keeps us in a place where there is at least a positive return.

The grayscale gradient represents RRt values that vary from 1, light gray, to 0, dark gray. Note that all signals colored somewhere in this grayscale were profitable; there was simply more pain than reward.

•    Click on the point representing system 6.

tutorial1ZH.png

There are just two trades in the one year time. The system defended reasonably well. The buy-hold was hit hard in this period, -15.4%. The traded equity curve is up 13.9%.

Step 7: Evaluate Real World Epsilon MA Signals Against the AAPL Tradescape

With perhaps the exception of EMAs, whipsaws in trading signals are not typically dealt with by the additional smoothing of multiple algorithmic passes. One doubles the lag in the signal in a two pass procedure and that occurs mainly for the additional accuracy that comes from eliminating fast cycle whipsaws when the slope of the MA is close to zero. Experienced signal designers will sometimes use a single pass differenced MA with a epsilon or fractional threshold to confirm a turn before the signal changes sign. This adds some lag, but normally less than this doubling that occurs with a two-pass sequential algorithm. We will do that in the next step of the tutorial as our examples migrate further away from ordered signaling and start to process more of the 'chaos' in the price movements.

To do this, we will use a function for TradeStation TSMASigEps. This function incorporates a percentage based epsilon signaling that resets with each sign change in the differenced 1-pass MA.

We will begin by evaluating 12 different combinations of 1-pass moving average lengths and 2 different common epsilon values.

•    From the TradeStation Development Environment, select the TSSigEval_T1 tab (if it is not open, use File | Open, choose Indicator from the dropdown and select TSSigEval_T1). Immediately use File | Save As and rename TSSigEval_T1 to TSSigEval_T2.

•    Change the line

   String SignalTitle("TSSigEval_T1"), // signal title to be added to the Tradescape plot

      to:

   String SignalTitle("TSSigEval_T2"), // signal title to be added to the Tradescape plot

•    Delete all of the lines between these two markers:

   { ---------------------------------------------------------------------------------------------------------------
      Begin user-defined signal region of code, add up to 15 Signals
      --------------------------------------------------------------------------------------------------------------- }

 

   { ---------------------------------------------------------------------------------------------------------------
      End user-defined signal region of code
      --------------------------------------------------------------------------------------------------------------- }

•    Insert the following between these two markers:

   Signal[0] = 12; // signal count

   Signal[1] = TSMASigEps(Price,0,48,0.25);

   Signal[2] = TSMASigEps(Price,0,45,0.4);

   Signal[3] = TSMASigEps(Price,3,50,0.25);

   Signal[4] = TSMASigEps(Price,3,48,0.4);

   Signal[5] = TSMASigEps(Price,4,52,0.25);

   Signal[6] = TSMASigEps(Price,4,52,0.4);

   Signal[7] = TSMASigEps(Price,5,55,0.25);

   Signal[8] = TSMASigEps(Price,5,55,0.4);

   Signal[9] = TSMASigEps(Price,2,62,0.25);

   Signal[10] = TSMASigEps(Price,2,60,0.4);

   Signal[11] = TSMASigEps(Price,1,60,0.25);

   Signal[12] = TSMASigEps(Price,1,58,0.4);

•    Verify the technique and keep the development environment window open--we will revisit this process for the other types of signals.

•    Insert the modified TSSigEval_T2 analysis technique with the following settings and then click OK.

tutorial1L.png

We will again reserve the most recent year of data.

Again, you must insure the TradeStation MaxBarsBack setting (the Maximum number of bars the study will reference in the General tab) is high enough to accommodate the signaling algorithms that will be called. TSSigEval is set to a user-defined value of 125. You will need to increase this if more bars than this are used in the computations, something that can easily occur when using single pass MAs.

•    Check the Half Upper Limit box in the Z-axis options. Again, this is to make it easier to see the differences in the signals.

•    Check the Expanded button in the Y-axis Lag Range option to change the default 0.7-1.2 lag fraction scaling to a wider 0.5-1.5 scale to accommodate the higher lag measured in signal 2.

tutorial1M.png

We varied the MA lengths between 45-62 for the purpose of realizing the time horizon target. All of the different MAs fall between the 20-25 EM length target.

We are testing two different epsilon values, 0.25% and 0.4%. An epsilon band extends this percentage on each side of the prior bar's price when a sign change occurs in the difference computed for the current bar. Until that band is broken, the sign is not accepted. Please note that the epsilon exists to remedy the incomplete smoothing in the MA algorithm. It is not a volatility band. Indeed, the more volatile the price movements, the less likely the epsilon may be needed. Its purpose is to deal with the quiet periods where the slope is close to zero, and where oscillations in the sign would occur around zero. A fixed percentage often suffices. In our experience, values around 0.2-0.5% make sense for most MA algorithms for EOD data. Note that substantially higher epsilon values are not merely compensating for deficiencies in smoothing, but rather add a strong confirmation component to the trading signal.

Signals 1 and 2 are the SMA with the 0.25 and 0.4 epsilon %, signals 3 and 4 are for the 75%-SMA-25%WMA hybrid, signals 5 and 6 are for the 50%SMA-50%WMA hybrid, signals 7 and 8 are for the 25%SMA-75%WMA hybrid, signals 9 and 10 are for the WMA, and signals 11 and 12 are for the EMA. The aggregate results fit with our expectation of lag and accuracy and the tradeoff that is routinely observed in such signalers.

•    Place the mouse cursor atop signal 11:

tutorial1ZX.png

We have now added a chaotic component to our signaler, albeit a small one. We no longer see low coverage errors with the FIR-type MAs in terms of matching the EM reference signal. The errors are all in the vicinity of 20% or higher. The EMA, signals 11 and 12, have the lowest average lag, even though their ten year performance is weakest in terms of reward-pain.

At this point, we know now what we are going to see in that blind 1-year walkforward. We know AAPL's behavior is going to shift to a faster time horizon as compared to the ten year aggregate. The lowest possible lag is generally the best defense for the fluctuating optimal time horizons. That offers robustness, though not necessarily the best performance when the entity is behaving close to historical norms.

The point here is that it is not merely the Heisenberg-like tradeoff between accuracy in trading the order (usually the signalers with higher lag) and the lower lag (usually the signalers with less accuracy). It is also the issue of robustness across time. The lower the lag, in general, the greater the robustness will be, even if the accuracy is weaker and the aggregate performance historically is poorer.

•    Click the point 11 trading system (note that you can also see the equity curve for any of the tradescape EM signals by clicking on any tradescape point):

tutorial1R.png

This upper plot contains the equity curve for system 11 and for an EM signal representing this this same estimated EM length and lag fraction on the tradescape surface. The yellow equity curve is for the EM signal. The cyan equity curve is for signal 11. At this lag, the EM signal is very effective. As we would expect from an IIR filter, the EMA-based system 11 delivers lower lag without the accuracy, and its reward-pain performance reflects such.

•    Choose the Format Analysis Techniques... option in the TradeStation right click menu in the chart, select the TSSigEval_T2 technique, click on Status to turn it back On, and click on Format. On the Inputs tab, change the Reserved value to 0. Set the WalkFwd value at 252. Click OK.

Once more, with just two trades in this last year's time, the different systems aren't sufficiently differentiated to plot apart from one another and the estimated lag falls below the 0.7 lower limit of the default tradescape plot.

•    8031.png Click the Modify Graph Scaling button in the graph toolbar and set the Y Min to 0.4, the Y Max to 1.2, the Y Divs to 8, the Z Max to 5, and the Z Divs to 8. Click OK.

You can use this custom scaling option to set any scaling you wish for any tradescape plot.

tutorial1U.png

Once again, we see the lower lag on systems 9-12. None offers more reward than pain although once again we are trading a time horizon little favored in this time period and one that is rather strongly removed from the aggregate historical behavior. While system 12, with its higher epsilon, actually has a better RRt, we once again have a case where the the lower lag presents a robustness that offers a positive return even with the optimal time horizon shifting strongly to faster signaling.

All systems are once more in this grayscale gradient that represents RRt values varying from 1, light gray, to 0, dark gray. Note that all signals within this grayscale were profitable; that return was, however, realized with more pain than reward.

•    8619.png Click on the View Equity Curve for a Trading Signal, enter 11 and press OK (this is an alternative to clicking on a trading signal point, and may of use when signals rest atop one another).

tutorial1V.png

The blind one year walkforward is favorable. The buy and hold for this one year is -15.4%. For system 11, the actual return was 9.3%. The system did reasonably well, exiting at the prescribed turns and not being fooled into prematurely re-entering on the brief upturns. The one-year blind walkforward begins near bar 3690 in the plot.

Step 8: Evaluate Real World Breakout Signals Against the AAPL Tradescape

Many signalers do not trade the smoothed direction of price but rather the crossings that occur within a defined price band. The envelope can be formed using close, high, or low prices and it can be generated in many ways. If a central channel is estimated, a volatility or confidence interval envelope can be formed. We will use the simplest form of an envelope signaler, price breakouts. The bands are formed by the highest high and the lowest low in a specified window. The upside and downside transition windows can be of different lengths. Twenty bar windows are widely used by professional traders because of their historical use in the "turtle" trading system.

In a breakout, one enters long when the highest high (HH) of the preceding specified count of bars is surpassed during or at the close of the current bar, and exits long when the lowest low (LL) of its preceding count of bars is broken in a price decline. When one trades bands in this manner, one signals on the potential trending of the prices. There can be a significant difference between the upper and lower bands at any given point, depending on volatility, especially the average true range volatility that would fit very closely with this type of signaling.

Whipsaws usually do not occur because of the width of the price band, and one does expect to be out of the market for a good period of time owing to the barrier to entry, and sometimes to endure long in-market indeterminate periods owing to the barrier to exit.

We will begin by evaluating 12 different breakout pairs as candidate trading signals. From our experience, we know that the 20-25 EM Length zone will typically be covered by breakouts in the 25-45 HH and LL lengths. We furnish a simple TSBreakout function to signal breakouts from the highest high and lowest low.

•    From the TradeStation Development Environment, select the TSSigEval_T2 tab (if it is not open, use File | Open, choose Indicator from the dropdown and select TSSigEval_T2). Immediately use File | Save As and rename TSSigEval_T2 to TSSigEval_T3.

•    Change the line

   String SignalTitle("TSSigEval_T2"), // signal title to be added to the Tradescape plot

      to:

   String SignalTitle("TSSigEval_T3"), // signal title to be added to the Tradescape plot

•    Delete all of the lines between these two markers:

   { ---------------------------------------------------------------------------------------------------------------
      Begin user-defined signal region of code, add up to 15 Signals
      --------------------------------------------------------------------------------------------------------------- }

 

   { ---------------------------------------------------------------------------------------------------------------
      End user-defined signal region of code
      --------------------------------------------------------------------------------------------------------------- }

•    Insert the following between these two markers:

   Signal[0] = 12.0; // signal count

   Signal[1] = TSBreakout(PriceHi,PriceLo,25,25);

   Signal[2] = TSBreakout(PriceHi,PriceLo,30,25);

   Signal[3] = TSBreakout(PriceHi,PriceLo,35,25);

   Signal[4] = TSBreakout(PriceHi,PriceLo,40,25);

   Signal[5] = TSBreakout(PriceHi,PriceLo,30,30);

   Signal[6] = TSBreakout(PriceHi,PriceLo,35,30);

   Signal[7] = TSBreakout(PriceHi,PriceLo,40,30);

   Signal[8] = TSBreakout(PriceHi,PriceLo,45,30);

   Signal[9] = TSBreakout(PriceHi,PriceLo,35,35);

   Signal[10] = TSBreakout(PriceHi,PriceLo,40,35);

   Signal[11] = TSBreakout(PriceHi,PriceLo,45,35);

   Signal[12] = TSBreakout(PriceHi,PriceLo,50,35);

•    Verify the technique and keep the development environment window open--we will revisit this process for the other types of signals.

•    Insert the modified TSSigEval_T3 analysis technique with the following settings and then click OK.

tutorial1ZQ.png

We will once more reserve the most recent year of data.

The default value for TSSigEval's Maximum number of bars the study will reference in the General tab (MaxBarsBack) of 125 will generally suffice for all breakouts.

•    Check the Half Upper Limit box in the Z-axis options.

tutorial1ZR.png

We selected a mix of simple HH,LL breakouts that our experience suggested would cover the target time horizon. Each of the larger points with the numbers in them represent the 12 real-world trading signals. Clearly systems 5-8, with the LL=30 exit breakout, are in the target zone and they are all acceptable in terms of reward-pain. None come close to offering the high RRt seen with the EM signals at these same lags, but we are looking at a very different type of signaler.

•    Place the mouse cursor on the point for trading system 5:

tutorial1ZS.png

We selected signaler 5 because it tested out as having the least lag, it was better than most for reward-pain, and it fell exactly at the time horizon we targeted. Note that we did not optimize in the sense of mapping all possible HH and LL settings and choosing whichever pair produced the best RRt, or return, or trend, or win rate. We selected the one in a small focused set with the least estimated lag that gave acceptable results.

The estimated lag is a robust average, our effort to make this estimate as meaningful as possible. However refined the analyzes, the lag and accuracy are estimates that require a threshold for determining synchronization between the real-world signal and the corresponding EM signal with the same count of first derivative zero crossings. In other words, the estimates are imperfect. You should not make choices based on small differences. In this instance, signal 5 is distinct enough we can assume lower lag. Further, we do not deem it a coincidence that the symmetric signalers 5 and 9 have the strongest performance.

Compared to the EM signal, the win rate on system 5 is lower, 67%, the trend is lower at 39.6% (lower than the 43% buy and hold but in the market only 67% of the time), and the RRt is 3.39, a good improvement over the underlying's other worldly 2.34 RRt. Was the signaling worthwhile? The average retracement is 9.8% as compared to the 15.3% in the underlying. That is a good deal less trading pain for close to the same return.

Why is trading system 5 (or any of the other breakout systems tested) so much weaker than the EM signal? The estimated lag at the turns for signal 5 is 16.4 days with a robust SD of 5 bars. That wider scatter in lag is characteristic of breakouts in general. By their nature, they trade both order and chaos; they are capable of responding swiftly to abrupt unexpected adverse price movements. The cost for that defense in the signal is a weakened capacity to accurately catch the order that is present in the price movements. The breakout signal failed to match the EM signal turns a full 26% of the time. Given that a round trip trade consists of two turns, the entry and exit trade, it is possible that the round trips could fail to synch up close to half the time.

Note that when evaluating a signaling system which seeks to trade both order and chaos, the coverage error in the turns associated with trading the order may not be the critical item. In a system that does not seek to trade the order in the price movements, one would expect a reasonably high error. The same is true in adaptive algorithms that are effectively changing the information content used in the computations. This also applies when stops are incorporated into the trading scenario and they are periodically hit in the course of trading.

•    Click the point 5 trading system:

tutorial1ZT.png

This upper plot contains the equity curve for system 11 and for an EM signal representing exactly this same estimated EM length and lag fraction on the tradescape surface. The yellow equity curve is for the EM signal. The cyan equity curve is for signal 11.

Breakouts can miss a good degree of the price action since their function is mainly to identify trends and jump on board. The signal 11 breakouts did not manage the change in the microstructure of the price series that took place near the end of this ten year analysis period.

•    Choose the Format Analysis Techniques... option in the TradeStation right click menu in the chart, select the TSSigEval_T3 technique, click on Status to turn it back On, and click on Format. On the Inputs tab, change the Reserved value to 0. Set the WalkFwd value at 252. Click OK.

•    8031.png Click the Modify Graph Scaling button in the graph toolbar and set the Y Min to 0.35, the Y Max to 1, the Y Divs to 13, the Z Max to 5, and the Z Divs to 8. Click OK.

tutorial1ZU.png

Once more, we observe the unhappy shift in the entity's behavior for this one year period. The breakouts with the faster time horizon (signals 1 and 2) do very well, fitting with the observed shift. We realized very close to the time horizon targeted, but the optimal time horizon is a moving target that is lag-sensitive. We chose system 5 because of its lowest measured lag in the ten year analysis.

With just two trades in this year's time, we again see that many signals rest atop each other in the plot. If a number is drawn without a box, this means it is hidden in the plot.

•    8619.png Click on the View Equity Curve for a Trading Signal, enter 5 and press OK. Here it is not possible to directly click on signal 5 to see its equity curve.

When a point is hidden by another, you can also try to narrow the scale by zooming in to see if system 5 can be displayed at its own EM length and lag fraction. Zoom-in is done by boxing the desired region with the mouse. Reset the non-zoomed scaling with a right click anywhere in the graph.

tutorial1ZV.png

The blind one year walkforward is respectable. The -15.4% buy and hold is compared with a 14.2% return from signal system 5. The system did its job well, exiting at the prescribed breakouts and not being fooled into prematurely re-entering on the brief upturns.

At this point in the tutorial, you should start to see a pattern. The tradeoff you make in signaling systems when you use the Tradescape platform is a new and likely unfamiliar one. You buy robustness when you favor the lowest lag signaler. On the other hand, the greater return may well occur with a different higher lag (but higher accuracy) signaler. It all depends on whether or not the favored zones in the tradescape occur going forward where the long term historical behavior places them.

Step 9: Evaluate Real World Moving Average Crossover Signals Against the AAPL Tradescape

We will now explore basic moving average crossover signalers. In our experience, these tend to be misunderstood. These aren't price signalers at all, however much they may use two smoothed price components each with a different information content. There are more accurately sentiment signalers. They are also "sympathetic" or "correlational" signalers insofar as they compute something that should correlate with price trends in a very "fuzzy" way. A sympathetic signaler could be any indicator that maps positive sentiment, buying-selling pressure, trending, or any other property to the movements in price. Even if an indicator is formed using bands, such as the CCI, once it has been formed into an oscillator it largely falls under this category of signaller.

One class of sympathetic signaling is the referential signaling that occurs when one uses an overall market or sector surrogate to trade more volatile entities. The professional edition of the product includes referential procedures for this type of trading.

In the typical smoothed crossover signaler, one signal is generally a central channel and the other is a faster signal that crosses above and below it. A long entry signal is generated above and a long exit (or short entry) signal is generated below.

Whipsaws are still a factor, but they can only occur now when the two curves are in proximity to each other, and that convergence often occurs with the two components moving in opposite directions against each other. This is a tried and true signal technique and one that works very well when long bar counts are being processed.

This may be a good place to note that the practice of using an MA crossover of two similar lengths is a very different form of signaler. Using the tradescape platform, you will likely be shocked at the amount of lag in such systems. Lag fractions from 2-3 are common. They sometimes work because they are a poor man's principal cycle estimation routine. The phases and frequencies are locked by the two integer lengths, which is why you might see a good return from a 45x43 MA crossover, but a poor return from a 50x48 crossover. Such signalers will far exceed what a tradescape would generate at such an astronomically high lag fraction. In effect, the cycles are indirectly estimated far back in time and played forward. If the cycles are still present, one can realize a return well out of proportion to what would be expected from trading order at the lag of the estimator.

To conclude this tutorial, we will look at the traditional MA crossover whose principle rests in a long-term estimate of a central channel and a short-term estimate of present sentiment. It this context, an MA crossover is a sentiment segmentation technique. There is positive market sentiment when above the long term line and negative sentiment below. It can be an effective trading paradigm, and one of the reasons the professional version of the platform offers two-stage sentiment-augmented signaling we call Sentimentscapes.

Especially when working with MA crossovers, you must insure the TradeStation MaxBarsBack setting (the Maximum number of bars the study will reference in the General tab) is high enough to accommodate the signaling algorithms that will be called. TSSigEval is set to a user-defined value of 125. You will need to increase this if more bars than this are used in any of the MAs. In this tutorial no adjustment is needed.

•    From the TradeStation Development Environment, select the TSSigEval_T3 tab (if it is not open, use File | Open, choose Indicator from the dropdown and select TSSigEval_T3). Immediately use File | Save As and rename TSSigEval_T3 to TSSigEval_T4.

•    Change the line

   String SignalTitle("TSSigEval_T3"), // signal title to be added to the Tradescape plot

      to:

   String SignalTitle("TSSigEval_T4"), // signal title to be added to the Tradescape plot

•    Delete all of the lines between these two markers:

   { ---------------------------------------------------------------------------------------------------------------
      Begin user-defined signal region of code, add up to 15 Signals
      --------------------------------------------------------------------------------------------------------------- }

 

   { ---------------------------------------------------------------------------------------------------------------
      End user-defined signal region of code
      --------------------------------------------------------------------------------------------------------------- }

•    Insert the following between these two markers:

    Signal[0] = 9.0; // signal count

    Signal[1] = TSMACross(Price,0,90,7);

    Signal[2] = TSMACross(Price,0,90,8);

    Signal[3] = TSMACross(Price,0,100,8);

    Signal[4] = TSMACross(Price,0,80,9);

    Signal[5] = TSMACross(Price,0,90,9);

    Signal[6] = TSMACross(Price,1,100,9);

    Signal[7] = TSMACross(Price,0,80,10);

    Signal[8] = TSMACross(Price,0,90,10);

    Signal[9] = TSMACross(Price,1,100,10);

•    Verify the technique and keep the development environment window open--we will revisit this process for the other types of signals.

•    Insert the modified TSSigEval_T4 analysis technique with the following settings and then click OK.

tutorial1ZK.png

By this point, we certainly know what we will see, but we still reserve the most recent year of data.

There is a close correlation between the sweet spots in a comprehensive MA crossover optimization and the lengths needed to achieve the desired EM length of the signaler. Because of the indirection, you may find it necessary to perform that optimization in order to find the lengths needed to realize the target time horizon in the tradescape. We did that here to find the values for the crossover we test. The long MA ranges from 80-100 depending on the type of MA, and the fast MA ranges from 7-10.

Moving average crossovers are all about information content. In general, there is no advantage in using the various FIR-type weighted moving averages; in fact the WMA often produces poor crossovers. Adaptive MAs are usually a bad idea for the same reason. In this analysis, we included mostly SMA crossovers. We add two EMA crossovers for an IIR reference.

•    Check the Half Upper Limit box in the Z-axis options.

tutorial1ZL.png

This is a lovely outcome. The sentiment states, however "fuzzy" with respect to price, produce favorable results when the target time horizon is achieved. Once more, opting for robustness rather than potentially higher return, signal 2 would be the SMA choice, and the best choice for the target time horizon range. The estimated lags in the signal are between 0.8-0.9 lag fraction, not as good as the breakouts, but competitive with the epsilon signaled single pass MAs, and lower than the lag on the pure 2-pass MA direct signalers.

•    Place the mouse cursor on signals 2 and 9:

tutorial1ZN.png  tutorial1ZW.png

The SMA crossover has the better return and reward-pain, but a poorer win rate. System 9, an EMA crossover trades at a higher time horizon than our target and thus the lower trade count and much higher trade lengths.

Both crossovers have a high SD in the lag at the turns, ą9, as compared to ą5 for the breakout signal we selected, ą6 for the epsilon signaled MA we chose, and ą2 for the 2xSMA (or ą5 for the 2xEMA). This illustrates the additional fuzziness from a sympathetic signaler. There is a wider scatter in the lags that coincide with trading the order in the price movements. Because of the fuzziness, we would also expect a high coverage error, and here we see the error in the coverage at the turns to be 25-27%.

If we select system 2 since it is within our target range, we see the lag fraction is better than the direct price signaler we picked in Step 6, but poorer than the epsilon signaler we chose in step 7 and breakout signaler we selected in step 8.

•    Click the system 2 point:

tutorial1ZO.png

The EM signal at this same estimated signal 2 lag is stronger, but the real-world MA crossover approximates the buy and hold with just 72% in-market. The RRt of 3.05 is near that of the breakout, very respectable for a signaler that does not directly map to price.

Knowing as we do that the tradescape for this most recent single year little favors the time-horizon we targeted from the ten year aggregate tradescape of the prior data, we already know the lowest lag offers the best chance of still getting out with some return.

•    Choose the Format Analysis Techniques... option in the TradeStation right click menu in the chart, select the TSSigEval_T4 technique, click on Status to turn it back On, and click on Format. On the Inputs tab, change the Reserved value to 0. Set the WalkFwd value at 252. Click OK.

•    Check the Half Upper Limit box in the Z-axis options.

•    Check the Expanded button in the Y-axis Lag Range option to change the default 0.7-1.2 lag fraction scaling to a wider 0.5-1.5 scale.

tutorial1ZP.png

The tradescape shows the zone where one is rewarded for signaling the order in the time series. This is the map for a fully accurate ordered trading of AAPL for this one year period. We know we would have been a lot happier in this year's time had we used a faster signaler with a shorter time horizon. Once more, we see no systems that offer more reward than pain (spectral color rather than grayscale). The systems plot poorly because the lag must be estimated from just two round trips. That is not an issue with a signaler with a very tight SD in the lag at the turns, but for a fuzzy signaler with a wide scatter, those two entries and exits must estimate a lag. There is simply too little data in this one year blind walkforward to estimate an accurate lag and scatter for any of these systems. Systems 3,5,6,8, and 9 were in before the year's walkforward began and the only activity in the year was a single exit (these plot at the lower limit of the graph near EM Length 60).

While the EM length and lag fraction are not absolute properties of a signal (they can vary somewhat with the entity being traded), we can assume that system 2's real time horizon and lag fraction continue to be the 22 and 0.88 we estimated from the ten year study where we had sufficient data to estimate these properties. If we look at the one year tradescape at [22, 0.88] we may not be pleased to have so sharply missed the optimal trading zone for this period of time, but we are still in a very good place because of the lower lag.

As we have done throughout this tutorial, you should rely on the equity curve for any final assessment, especially when there are so few trades.

•    8619.png Click on the View Equity Curve for a Trading Signal, enter 2 and press OK.

tutorial1ZY.png

Again there are just two trades in the year (the plot does show a trade in a warm-in period prior to the start of the year, but this is not used). The system defended well with a 17.4% return for the year, the best of all of the systems walked blindly forward in this tutorial. The yellow EM equity curve should be disregarded here, as its lag is based on the estimate of the lag for signal 2, and here we know that estimated lag is not likely accurate. There are too few trades and too much scatter in the lags of the signaler.

8087.png Note that the graph toolbar has a button that allows you to toggle off the underlying and EM references in the upper plot.

•    To close all Tradescape windows currently open in a single step, right click the icon on the taskbar and choose Close All Windows.

Step 10: Putting It All Together

If these were the only signaling systems available to you, which one would you trade?

We will start with an extract from the Tradescape reports that are optionally generated from any tradescape plot. We will collect this information so that we see just the real-world trading system information:

tutorial1ZZ.png

This is the sum total of all of trading signal information generated in this tutorial. We have four classes of signaling algorithms and a total of 29 trading signalers. The yellow highlights are for the four systems we selected and reviewed. Take a few moments to note that we did not pick the highest win rate, return (Trend), or reward-pain (Sharpe,Rģ,RRt). We did not pick the systems with the least coverage error at the turns (CovgErr). We took the rather conservative and robust approach of choosing the lowest lag that fell within our target time horizon.

We did tweak the parameters in our signalers, but we did so only to realize the time horizon we sought from those classes of signalers. We did not do so for the purpose of optimization. It was a simple matter of our originally choosing to trade the 20-25 EM Length time horizon, and that we wished to achieve this with the lowest lag possible. We accepted that we often sacrificed accuracy in signaling to realize this lower lag. If everything tracked history walking forward, we knew we were not going to see the highest possible return. Still, if the behavior of the entity were to change significantly, we would have the best defense that particular signaler could offer.

AAPL is a challenging entity to signal because its underlying has historically been exceptional for reward-pain. It is hard to improve upon an RRt of 2.3 (where there is already more than twice the reward than pain). It is difficult to realize a greater return than the underlying. What the signaler must do is diminish the pain that is present without losing too much of the price action that generates the return. All four of the systems we selected did this. All defended well as the local tradescape for the most recent blind year proved to be well away from the long term average behavior.

The two pass EMA in the first group is the ultimate in simplicity. By design, It seeks to trade only the ordered movements of price. We relied on an IIR type of filter for the lower lag, and that may make a signal scientist somewhat wary. It is also the highest lag fraction of the four candidates.

The single pass EMA with the epsilon retains this algorithmic simplicity but offers a 1-pass solution, the lag is reduced to the second lowest lag of the four, but it also has the weakest reward-pain and the lowest return in the blind walkforward. That could be a consequence of having to use twice the length of the 2-pass EMA selected in the first group and we know an EMA tends to degrade with higher length.

The symmetric breakout has the lowest lag fraction and a very good win rate, but we know it trades less of the order (it has the worst coverage error). We also know that optimal breakouts dance all over the [HH,LL] map as market sentiment changes.

The MA crossover trades AAPL's own sentiment, the lag is higher, the win rate is weak, but it fared better in the blind one-year walkforward. We also know optimal MA crossover settings can also be all over the [nSlow,nFast] optimization map across time.

We conclude with the perspective that all four represent respectable and viable choices. From our view, there is no clear optimal choice. While we might opt for the lowest lag since the progressive tradescapes raised that red flag, the actual choice might come down to our experience with each of the algorithms.