TradersEdgeSystems.com

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

December 2011 Stocks and Commodities Traders Tips


Applying The Put/Call Ratio Indicator:

AIQ Version:

Original article by Sylvain Vervoort
AIQ Code by Richard Denning

The AIQ code for Sylvain Vervoort’s Put/Call Ratio Indicators and the IFTStoch Indicator and related system from the article, “Applying The Put/Call Ratio Indicator”, is provided at the web site noted below. The code provided has been modified from the author’s formulas which used weighted averaging. This type of averaging is not provided in AIQ as a built-in function and had to be coded long style. The result was very inefficient code that runs so slowly as not to be of any use. I modified the formulas by substituting exponential averaging for the weighted averaging. The code now runs fast enough to be useful and the indicators can be plotted without hanging up the processor. I believe that the modified code can produce similar results. Although the values are not the same as the author’s values when using the same parameters, the resulting shapes of the indicators are similar. I have a “PCratio.dta” data file that can be downloaded and saved into the “C:\wintes32\tdata\” folder. Once the file is saved, go to the Data Manager module and run the utility “Rebuild Master Ticker List” to complete the data file install process.

Using the author’s system called the SVE_Stoch_IFT, 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 the IFTStoch 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. The return averaged 19% per year with a maximum drawdown of 50% on 3/9/09.

The short side, when tested separately from the longs, lost 91% of the initial capital by 1/7/2004 then ceased to trade due to limited capital. The results of the short side test are not shown.

I did not attempt to filter the trades using the Put/Call Ratio indicators as the author did not supply specific code for this purpose.

Captions:
Figure 1 – Equity curve for a trading simulation for the SVE_Stoch_IFT system on the NASDAQ 100 list of stocks for the period 12/31/98 to 10/10/11 (blue line) compared to the buy and hold on the S&P 500 index (red line).

EDS Code for Put Call Ratio Modified
PC Ratio Mod2.EDS
(right click and choose Save As)

PCRATIO.dta data file
PCRATIO.dta
(right click and choose Save As      AND SAVE TO C:\wintes32\tdata\ folder


 

Traders Studio Version :

Original article by Sylvain Vervoort
Traders Studio Code by Richard Denning

The following code files are provided in the download below:

  • Function: “TEMA“ computes the TRIX value for input to the FAST PCRI
  • Function: “RainbowMA“ computes the Rainbow moving average for all indicators
  • Indicator Plot: “PCRI_FAST_IND2” for displaying the PCRI_FAST indicator on a chart
  • Indicator Plot: “PCRI_SLOW_IND2“ for displaying the PCRI_SLOW indicator on a chart
  • Indicator Plot: “PCRI_FISH_IND2“ for displaying the PCRI_IFISH indicator on a chart
  • System: “PC_RATIO_TEST2”a session code for setting up a session chart-not a system from this month’s issue (December 2011):
  • Function: “IFTStoch” computes the IFTStoch Indicator
  • Indicator Plot: “IFTStoch_IND” for displaying the IFTStoch Indicator on a chart
  • System: “FVE_STOCH_IFT_SYS” is the session code for the trading system provided by the author.

The function “IFTStoch” has an input parameter that sets the type of averaging used in the indicator. The choices are: simple = 1, weighted = 2, exponential = 3. Although the author uses the weighted averaging, upon testing I found a slight advantage to exponential averaging over the weighted and the simple. The tests that are shown in figures 1 and 2 use exponential averaging.

In Figure 1, I show the log equity curve for the “FVE_STOCH_IFT_SYS” using the tradeplan “TS_StockPlanFilterRanking” using parameters of 30 for the upper percent and 0 for the ranking type. This tradeplan ships with the TradersStudio program and is explained in the manual. In Figure 2, I show the underwater equity curve. The test was run using my standard test list of 74 highly active NASDAQ stocks from 1998 to 10/07/11 which showed a 14.1% compound annual return with a 62.7% maximum drawdown that occurred on 11/11/2002.

I did not attempt to filter the trades using the Put/Call Ratio indicators as the author did not supply specific code for this purpose.

Captions:
Figure 1: Log equity curve for the “SVE_STOCH_IFT_SYS” on the 74 NASDAQ stocks, 1998 to 10/07/11, using the tradeplan “TS_StockPlanFilterRanking(30,0)”.

Figure 2: Underwater equity curve for the “SVE_STOCH_IFT_SYS” on the 74 NASDAQ stocks, 1998 to 10/07/11, using the tradeplan “TS_StockPlanFilterRanking(30,0)”.

Traders Studio Code for Put/Call Ratio:
SVE_STOCH_IFT_SYS_TSZ.zip
(right click and choose Save As)

 

 

 

 

 

 

 

 

 

 

 

 

 

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