QuantStudio Financial Data Analysis and Trading Framework

PCU Class

Price Channel Upper (PCU).

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

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

[Visual Basic]
Public Class PCU
    Inherits TIndicator
[C#]
public class PCU : 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

Price Channel is one of the simplest and oldest trend-following models. It requires no calculations. The rules are: Buy when the weekly closing price moves up to a new 20-period high; sell and sell short when the weekly closing price moves down to a new 20-period low. In other words, when price moves out of its n-period range, go in the direction of this new trend.


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","PCU DEMO",600,400);
        
    Canvas.Divide(1,2);
    
    PCU PCU = new PCU(Daily, 14);
    
    Canvas.cd(1);
    Daily.Draw("c");
    
    Canvas.cd(2);
    PCU.Draw(Color.Red);
    

Requirements

Namespace: RQuant.Indicator

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

See Also

PCU Members | RQuant.Indicator Namespace