Get Updates:
Email
Twitter
RSS

3/10 Oscillator

Reader Steve H commissioned me to build this popular study used by Linda Bradford Raschke. The indicator itself is exceptionally simple. The fast line (red) is a 10 period simple moving average subtracted from a 3 period simple moving average. The slow line (cyan) is then a 16 period SMA of the slow line. The histogram is the delta between these two lines and therefore crosses the zero line when the fast and slow line cross. The histogram is hidden by default but can be revealed in the normal manner on the study properties pane.

3/10 Oscillator

3/10 Oscillator


# THREE TEN OSCILLATOR
# http://thinkscripter.wordpress.com
# thinkscripter@gmail.com
# Last Update 06 APR 2009

declare lower;

input price = close;

def SMA3 = average(price, 3);
def SMA10 = average(price, 10);

def osc = SMA3-SMA10;
def ave = average(osc, 16);

plot deltaHistogram = osc-ave;
deltaHistogram.setPaintingStrategy(paintingStrategy.HISTOGRAM);
deltaHistogram.assignValueColor(if deltaHistogram > 0 then color.green else color.red);
deltaHistogram.hide();

plot osc310 = osc;
osc310.setDefaultColor(color.red);

plot ave16 = ave;
ave16.setDefaultColor(color.cyan);

plot zero = 0;
zero.setDefaultColor(color.white);

8 Responses to “3/10 Oscillator”

  1. Randy Harris says:

    Interesting, I always thought the MACD could be used for this with settings of 3/10/16. But I just set up a MACD under ThinkScripters 3/10 – and while they are extremely similar, they are a little different.

    Image here: http://dl.getdropbox.com/u/35527/invest/Picture%201.png

    • Aye! You are correct sir. They are not the same. MACD uses exponential averages and the 3/10 oscillator is based on simple moving averages. A subtle but important distinction.
      -Eric

  2. Eternum says:

    Hi Eric,

    Looking at numerous charts at LBR Group site, it looks like histogram is not the difference between oscillator and its average, but rather mimics oscillator itself because it is all the time contained within oscillator.
    Another worlds: deltaHistogram = osc;
    Not that this is very important from the usefulness perspective, rather cosmetic.

    • When I coded the study, I felt that there was more value added to having a histogram of the difference. To simply fill the oscillator with lines adds no new information. When you plot the delta as a histogram you are now getting a unique new representation of some of the data. The great thing is, it is easy to modify to suit your desires.

  3. haxen says:

    This is a cosmetic duplicate of LBR’s 3/10 oscillator. As ThinkScripter says, it is very simple, all I did was clean it up to look like Linda’s current screen.

    declare lower;

    input fastLength = 3;
    input slowLength = 10;
    input MACDLength = 16;

    def fastAvg = Average(data = close, length = fastLength);
    def slowAvg = Average(data = close, length = slowLength);

    plot Value = fastAvg – slowAvg;
    plot Avg = Average(data = Value, length = MACDLength);
    plot Diff = fastAvg – slowAvg;
    plot ZeroLine = 0;

    Value.SetDefaultColor(GetColor(1));
    Avg.SetDefaultColor(GetColor(8));
    Diff.SetDefaultColor(GetColor(5));
    Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
    Diff.DefineColor(“Positive”, Color.UPTICK);
    Diff.DefineColor(“Negative”, Color.DOWNTICK);
    Diff.AssignValueColor(if diff >= 0 then Diff.color(“Positive”) else Diff.color(“Negative”));
    ZeroLine.SetDefaultColor(GetColor(0));

    • Thanks for the addition :) NOTE: IF YOU CUT AND PASTE THE ABOVE CODE FROM HAXEN YOU WILL HAVE TO REPLACE THE BI-DIRECTIONAL QUOTES AND MINUS SIGNS FOR TOS TO ACCEPT THE CODE.
      Eric

  4. Chris says:

    Eric, does this indicator still work, cant get the Zero line to show?

    Thanks

Leave a Reply