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

May 2012 Stocks and Commodities Traders Tips

Sentiment Zone Oscillator :

AIQ Version:

Original article by Walid Khalil
AIQ Code by Richard Denning

The AIQ code for Walid Khalil’s Sentiment Zone Oscillator Indicator and the related system from the article, “Sentiment Zone Oscillator”, is provided at the web site noted below.

Using the author’s system that is described in the article, I ran a test on the NASDAQ 100 list of stocks using the Portfolio Manager module. The following capitalization settings were used:

  • Maximum of 10 open positions
  • Size each position at 10% of mark-to-market total capital
  • Take no more than 3 new positions per day
  • Compute the mark-to-market capital each day
  • Choose signals based on a relative strength indicator for ranking in descending order for longs

In Figure 1, I show the equity curve for the long only trading on the NASDAQ 100 list of stocks for the period from 12/31/99 to 3/16/2012. The return averaged 10.3% per year with a maximum drawdown of 56.5% on 3/9/09. The trend filters that are applied to each stock in the system did not prevent the large drawdown during the two bear markets in the test period. Applying an index based trend filter might improve the results but I did not try this due to time constraints.

Figure 1 – Equity curve for a trading simulation for the Sentiment Zone Oscillator system on the NASDAQ 100 list of stocks for the period 12/31/99 to 3/16/12 (blue line) compared to the buy and hold on the NDX index (red line).

EDS Code for Sentiment Zone Oscillator
(right click and choose Save As)


Traders Studio Version :

Original article by Walid Khalil
Traders Studio Code by Richard Denning

The TradersStudio code for Walid Khalil’s article , “Sentiment Zone Oscillator”, is provided below. The following code files are provided in the download below:

  • Function: “SZO” computes the SZO value.
  • Indicator Plot: “SZO_IND” for displaying the SZO indicator with over bought/sold levels and SZO moving average
  • Function: “TEMA” computes the triple exponential moving average.
  • System: “SZO_Sys” for back-testing the author’s system.

In Figure 1, I show the indicator on a chart of Apple, Inc. for part of 2011. Also the chart shows the buy arrows along with the exits for several trades from the system.

Traders Studio Code for Sentiment Zone Oscillator:
SZO Indicator &
(right click and choose Save As)














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