Topic: Indicator Calculations

Hi guys,
I need help understanding the logic behind the calcs for Osc of Momentum. Please, correct me if I am wrong. What this indicator does is calculate two momentum and substract the second from the first(as in the last for loop). Am I understanding the code correctly? Because I must be missing something, If I insert the two momentum in the chart, there is no way I can get the Oscillator value by just substractin one from the other. Are there other separated class for oscillators that is in other place?

/// <summary>
        /// Calculates the indicator's components
        /// </summary>
        public override void Calculate(SlotTypes slotType)
            // Reading the parameters
            MAMethod  maMethod  = (MAMethod)IndParam.ListParam[1].Index;
            BasePrice basePrice = (BasePrice)IndParam.ListParam[2].Index;
            int iPeriod1 = (int)IndParam.NumParam[0].Value;
            int iPeriod2 = (int)IndParam.NumParam[1].Value;
            int iPrvs    = IndParam.CheckParam[0].Checked ? 1 : 0;

            // Calculation
            int iFirstBar = iPeriod1 + iPeriod2 + 2;
            double[] adIndicator1 = new double[Bars];
            double[] adIndicator2 = new double[Bars];
            double[] adOscllator  = new double[Bars];

// ---------------------------------------------------------
            Momentum Momentum1 = new Momentum(slotType);
            Momentum1.IndParam.ListParam[1].Index = IndParam.ListParam[1].Index;
            Momentum1.IndParam.ListParam[2].Index = IndParam.ListParam[2].Index;
            Momentum1.IndParam.NumParam[0].Value = IndParam.NumParam[0].Value;
            Momentum1.IndParam.CheckParam[0].Checked = IndParam.CheckParam[0].Checked;

            Momentum Momentum2 = new Momentum(slotType);
            Momentum2.IndParam.ListParam[1].Index = IndParam.ListParam[1].Index;
            Momentum2.IndParam.ListParam[2].Index = IndParam.ListParam[2].Index;
            Momentum2.IndParam.NumParam[0].Value = IndParam.NumParam[1].Value;
            Momentum2.IndParam.CheckParam[0].Checked = IndParam.CheckParam[0].Checked;

            adIndicator1 = Momentum1.Component[0].Value;
            adIndicator2 = Momentum2.Component[0].Value;
// ----------------------------------------------------------

            for (int iBar = iFirstBar; iBar < Bars; iBar++)
                adOscllator[iBar] = adIndicator1[iBar] - adIndicator2[iBar];

Re: Indicator Calculations

Never mind, I just realised I had the wrong period in the two momentum. duh!!