QuantStudio Financial Data Analysis and Trading Framework

OSC Class

Oscillator (OSC)

For a list of all members of this type, see OSC Members.

System.Object
   RQuant.Indicator.TTimeArray
      RQuant.Indicator.TDoubleArray
         RQuant.Indicator.TIndicator
            RQuant.Indicator.OSC

[Visual Basic]
Public Class OSC
    Inherits TIndicator
[C#]
public class OSC : TIndicator

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

An oscillator is the simple difference between two Moving Averages.
One trading rule is similar to the crossover system used in Moving Averages. In fact, the oscillator is another method of using two Moving Averages. Sell when the oscillator crosses the zero line from above to below. Buy when the oscillator crosses from below to above. Some traders buy the valleys and sell the peaks of the oscillator.

Formula:

Example

TDataManager.cd("Demo");

TDailyArray Daily1 = TDataManager.GetStock("YHOO").DailyArray;

DateTime Date1 = DateTime.Parse("1999/02/08"); 
DateTime Date2 = DateTime.Parse("2000/12/29"); 

TDailyArray Daily = Daily1.Clone(Date1, Date2);

TCanvas Canvas = new TCanvas("Canvas","OSC DEMO",600,400);
    
Canvas.Divide(1,2);

OSC OSC = new OSC(Daily, 14, 20);

Canvas.cd(1);
Daily.Draw("c");

Canvas.cd(2);
OSC.Draw(Color.Red);

Requirements

Namespace: RQuant.Indicator

Assembly: RQuant.Indicator (in RQuant.Indicator.dll)

See Also

OSC Members | RQuant.Indicator Namespace