Yes you would need to calculate the daily index advance and decline values in the Breadth engine using 2 separate scripts. Once created they can be used in the calculation for the McClellan Oscillator:
(19-day EMA of advances minus declines) - (39 day EMA of advances minus declines)
We calculate those advance/decline numbers for NYSE, Nasdaq and the S&P500 in our Breadth Measures data, so the formula to calculate a Custom Code symbol for the oscillator using would be as follows for the S&P500:
//Get SPX Advance/Decline Data from Breadth Measures data
D1 = GETDATA(CODE=ADVSPX:BM);
D2 = GETDATA(CODE=DECSPX:BM);
//Setup 19EMAs on AD Codes
A1 = MA(D1, BARS=19, STYLE=Exponential) ;
A2 = MA(D2, BARS=19, STYLE=Exponential) ;
//Setup 39EMAs on AD Codes
A3 = MA(D1, BARS=39, STYLE=Exponential) ;
A4 = MA(D2, BARS=39, STYLE=Exponential) ;
//Calulate Oscillator
(A1 - A2) - (A3 - A4)
Thanks Yan. We are tied up with other projects at the moment so wouldn’t be able to do any custom development work at this time. However, if you have the up and down numbers already calculated and stored in a .csv file then that will make it easier as you won’t need to use the Breadth Engine to calculate them - you would just need to import the .csv files on which to create the oscillator.
Thank you Darren, No worries, i support you guys. Just an idea, i can wait for years, you guys have already done wonderful works, everything would be better in the future. Cheers.
I trade mostly in Chinese equities market, which include shanghai composite index, shenzhen composite index and China next index. Since the individual equities in these exchange are not included in the optuma data base, i create extra data folder in optuma by importing data everyday and do breath calculation. It can satisfy my need for now.
For the Mcclellan Oscillator, i use local software which can directly get those upside ticker and downside ticker numbers and it works for me.
Since the quality of Chinese equities data included in optuma default database is very poor(i am sorry but it’s true, the data are not accurate and the majority of them have very short tracking periods ), probably there is no need to build that at all.
If you need any more details, you can let me know.