TradersEdgeSystems.com

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

November 2011 Stocks and Commodities Traders Tips


Constructing 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 from the article, “Constructing The Put/Call Ratio Indicator”, is provided 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.

For those who want to try it, I have provided the code that matches the original formulas.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.

Also below is 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. The three modified PC ratio indicators are shown in Figure 1 on a chart of the S&P 500 Index.

Captions:
Figure 1 – The three Put/Call Ratio indicators shown on a chart of the S&P 500 Index.

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

EDS Code for Put Call Ratio Modified
PC Ratio Mod.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 TradersStudio code for Sylvain Vervoort’s Put/Call Ratio Indicators from the article, “Constructing The Put/Call Ratio Indicator”, is provided at the web sites noted below. The following code files are provided in the download from the websites:

  • Function: “TEMA“ computes the TRIX value for input to the FAST PCRI
  • Function: “RainbowMA“ competes 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

In Figure 1, I show the three put/call ratio indicators under a chart of the SP500 index. Please note that I have rescaled the PCRI SLOW indicator by multiplying it by 100 to make it in a similar range of 0 to 100.

Captions:
Figure 1: The three put/call ratio indicators under a chart of the S&P 500 index shown in this order: “fast”, ”slow”, ”iFish”.

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

 

 

 

 

 

 

 

 

 

 

 

 

 

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