Posted Wednesday September 30 2009

What/how would be the best way to calculate this indicator? Would be in a system or as an indicator?
If I do it in a system I have the problem of calculating the EMA of the Close/ Index as EMA only takes ISeries so once I have the value in a user series can I get an EMA of it? Unless I write my own EMA function.
If I do it as an indicator can I get the underlying index data into the indicator as well as the symbol data to do the calcs?
The momentum of comparative strength (MoCS) formula:
The MoCS is essentially the traditional comparative strength formula run through a MACD formula.
“Data Series” is the close/last of the stock or ETF being analyzed.
MoCS = (12period exponential moving average of ( data series / S&P 500 )) minus (26period exponential moving average of ?( Data Series / S&P 500 )).
A 9period moving average is then placed on the MoCS to act as the signal line.
Thanks.

Posted Wednesday September 30 2009

I don't think you can do this as an indicator unless you handle retrieving underlying index data on your own. Indicators are data independent, so there's no mechanism for guaranteeing that you're getting the index data that you need. I'd go with a UserSeries if possible.

Posted Thursday October 01 2009

You should be able to do this all with indicators which you set up in your startup method (without using user series), I think. You will need to have the S&P 500 as one of the symbols you use in your system, and you'll need a way to access it from the other symbol scripts. Once you have this set up you can just do:
ratioSeries = new DivideSeries(); ratioSeries.SetInputs(Bars.Close, SP500.Bars.Close);
Then you can set up the other indicators to be based on the ratioSeries.
Daniel
