Consulting | Custom Trading Systems
Built-In Indicators | Custom Indicators

October 2013 Stocks and Commodities Traders Tips

An Expert of a System

AIQ Version:

Original article by Sylvain Vervoort
AIQ Code by Richard Denning

In Figure 1, I show a chart of Netflix (NFLX) with a color bar study that shows when the expert system is in a buy mode (green bars) when the typical price exponential moving average (typEMA) is above the Heinkin-Ashi close exponential moving average (haEMA) and close is above the open after having been in the sell mode. For the sell to be true (red bars) the typEMA must be below the haEMA and the close must be below the open for the initial signal to go short after having been in the buy mode. Figure 1 also shows the two moving averages typEMA in yellow and the haEMA in green. White arrows show the signal dates for the sample trade on NFLX. The entries and exits are the next day at the open. I simplified the system and did not code the stop loss or the breakeven exits. I ran a test on the NASDAQ 100 from 8/11/2000 to 8/9/2013. The long side test results are summarized in Figure 2. The average return for all 13,295 trades is 0.64% per trade before commission and slippage. This return assumes that all trades are taken. I tested the short side over this same time period and there were 13,256 trades averaging a loss of 1.00% per trade (summary not shown).


Figure 1 – chart of NFLX with typEMA (yellow) and haEMA(green), with color study showing buys (green bars with up white arrows) and sells (red bars with down white arrows).

Figure 2 – summary of back-test of long side on NASDAQ 100 list of stocks from 8/11/2000 to 8/09/2013.

EDS Code:
(right click and choose Save As)


Traders Studio Version :

Original article by Sylvain Vervoort
Traders Studio Code by Richard Denning

The following code files are contained in the download below:

  • Function: HA_CLOSE gets the value of the Heinkin-Ashi close
  • Function: TYP_PRICE: gets the typical price
  • Indicator plot: “SV_EXPERT_IND” a plotting function that allows the SVE moving averges to be displayed on a chart
  • System code: “SV_EXPERT_SYS” a system to trade a version of the authors system. Note: my version omits the stop loss and breakeven exit.
In Figure 1, I show an equity curve and an underwater equity curve with the parameters 5 for the Heinkin-Ashi exponential moving average (haEMA) and 10 for the typical price exponential moving averge (typEMA) trading the futures contract on the Australian Dollar (AD) using Pinnacle data. The parameter set of haEMA=5, typEMA=10 was derived by optimizing over the entire data history from 1988 to 2013. Commission and slippage were not taken out. Next I did a walkforward analysis using training window of 250 and a forward window of 125. This test did not show good results, and in fact, two of the three boundary exit options showed that the system lost money over the period. Only when I chose the “exit all trades and re-enter” option for the boundaries did the system show a net profit. This result is shown in Figure 2 and it is clear that the system failed the walkforward. I did not have time to try other training and forward test periods which might have produced better results.


Figure 1 – Equity and underwater equity curve for the author’s system trading the AN futures contract using the most profitable parameter set obtained via optimization (haEMA=5, typEMA=10).

Figure 2 - Equity and underwater equity curve for the author’s system trading the AN futures contract using the results of a walkforward test with a training period of 250 bars and a forward period of 125 bars.

Traders Studio Code:
(right click and choose Save As)














Disclaimer | Privacy Policy | Contact Us | Spam Blocker | ©2013 Traders Edge Systems