Oscillator of Moving Average (OsMA) free

by qualitiedx2 in category Oscilator at 06/08/2012
Description

The Moving Average of Oscillator (OsMA), is an indicator that is calculated by taking the difference between a shorter-term moving average and a longer-term moving average. The two most common are the 12 period moving average and the 26 period moving averages.

OSMA

Notification Publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section you may use the Copyright Infringement Notification form to submit a claim.
Formula / Source Code
Language: C#
Trading Platform: cAlgocTrader
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.Indicators;

namespace cAlgo.Indicators
{
    [Levels(0.0)]
    [Indicator(IsOverlay = false, ScalePrecision = 5, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class OSMA : Indicator
    {
        [Parameter(DefaultValue = 12)]
        public int shortCycle { get; set; }

        [Parameter(DefaultValue = 26)]
        public int longCycle { get; set; }

        [Parameter(DefaultValue = 9)]
        public int signalPeriod { get; set; }

        [Output("Main", PlotType = PlotType.Histogram)]
        public IndicatorDataSeries Result { get; set; }

        MacdHistogram macd;

        protected override void Initialize()
        {
            macd = Indicators.MacdHistogram(shortCycle, longCycle, signalPeriod);
        }

        public override void Calculate(int index)
        {
            Result[index] = macd.Signal[index] - macd.Histogram[index];
        }
    }
}
Comments

Eduardo_Cerejo - August 13, 2013 @ 18:11

It would be nice if you could the 0.0 line, it's very difficult to put an horizontal line at the 0 level

BBalazs - August 02, 2015 @ 11:44

Thank you for the indicator, you saved me a lot of time :)

Dat M. Vo - July 26, 2017 @ 16:46

How can I import this OsMA into my cTrader for Android platform? Or do you have another way?

Please, please! Thank you.

5