示例#1
0
文件: SMA.cs 项目: heber/FreeOQ
		public SMA(TimeSeries input, int length, BarData option, Color color) : base(input)
		{
			this.fLength = length;
			this.fOption = option;
			this.Init();
			this.Color = color;
		}
示例#2
0
文件: KRI.cs 项目: heber/FreeOQ
    public KRI(TimeSeries input, int length)
			: base(input)  {
      this.fLength = 14;

      this.fLength = length;
      this.Init();
    }
示例#3
0
文件: Range.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index, int length)
 {
   if (index < length - 1 + input.FirstIndex)
     return double.NaN;
   double min = input.GetMin(index - length + 1, index, BarData.Low);
   return Math.Log(input.GetMax(index - length + 1, index, BarData.High) / min);
 }
示例#4
0
文件: PCL.cs 项目: heber/FreeOQ
		public PCL(TimeSeries input, int length, Color color)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.Init();
      this.Color = color;
    }
示例#5
0
文件: PERF.cs 项目: heber/FreeOQ
		public PERF(TimeSeries input, double k, BarData option)	: base(input) 
    {
      this.fK = 14.0;
      this.fOption = option;
      this.fK = k;
      this.Init();
    }
示例#6
0
文件: PCL.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index, int length)
 {
   if (index >= length + input.FirstIndex)
     return input.GetMin(index - length, index - 1, BarData.Low);
   else
     return double.NaN;
 }
示例#7
0
文件: Range.cs 项目: heber/FreeOQ
		public Range(TimeSeries input, int length, Color color)	: base(input) 
    {
      this.length = 14;
      this.length = length;
      this.Init();
			this.fColor = color;
    }
示例#8
0
文件: TH.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index)
 {
   if (index >= 1 + input.FirstIndex)
     return Math.Max(input[index, BarData.High], input[index - 1, BarData.Close]);
   else
     return double.NaN;
 }
示例#9
0
文件: PDI.cs 项目: heber/FreeOQ
		public PDI(TimeSeries input, int length, EIndicatorStyle style)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fStyle = style;
      this.Init();
    }
示例#10
0
文件: OBV.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index)
 {
   if (index < 1 + input.FirstIndex)
     return double.NaN;
   double num1 = input[index, BarData.Close];
   double num2 = input[index - 1, BarData.Close];
   double num3 = input[index, BarData.Volume];
   double num4 = 0.0;
   if (index > 1 + input.FirstIndex)
   {
     if (num1 > num2)
       num4 = OBV.Value(input, index - 1) + num3;
     if (num1 < num2)
       num4 = OBV.Value(input, index - 1) - num3;
     if (num1 == num2)
       num4 = OBV.Value(input, index - 1);
   }
   else
   {
     if (num1 > num2)
       num4 = num3;
     if (num1 < num2)
       num4 = -num3;
     if (num1 == num2)
       num4 = 0.0;
   }
   return num4;
 }
示例#11
0
文件: VROC.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index, int length)
 {
   if (index >= length - 1 + input.FirstIndex)
     return (input[index, BarData.Volume] - input[index - length + 1, BarData.Volume]) / input[index - length + 1, BarData.Volume] * 100.0;
   else
     return double.NaN;
 }
示例#12
0
文件: EMA.cs 项目: heber/FreeOQ
		public EMA(TimeSeries input, int length, BarData option)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.Init();
    }
示例#13
0
文件: PCL.cs 项目: heber/FreeOQ
		public PCL(TimeSeries input, int length, Color color, EDrawStyle drawStyle)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.Init();
      this.Color = color;
      this.DrawStyle = drawStyle;
    }
示例#14
0
文件: RSI.cs 项目: heber/FreeOQ
    public RSI(TimeSeries input, int length, BarData option, EIndicatorStyle style)
			: base(input){
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.fStyle = style;
      this.Init();
    }
示例#15
0
文件: D_Fast.cs 项目: heber/FreeOQ
		public D_Fast(TimeSeries input, int length, int order)	: base(input) 
    {
      this.fLength = 14;
      this.fOrder = 10;
      this.fLength = length;
      this.fOrder = order;
      this.Init();
    }
示例#16
0
文件: Range.cs 项目: heber/FreeOQ
    public Range(TimeSeries input, int length, Color color, EDrawStyle drawStyle)
			: base(input)  {
      this.length = 14;
      this.length = length;
      this.Init();
			this.fColor = color;
      this.fDrawStyle = drawStyle;
    }
示例#17
0
文件: ADXR.cs 项目: heber/FreeOQ
		public ADXR(TimeSeries input, int length, EIndicatorStyle style, Color color)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fStyle = style;
      this.Init();
      this.Color = color;
    }
示例#18
0
文件: PERF.cs 项目: heber/FreeOQ
		public PERF(TimeSeries input, double k, BarData option, Color color)	: base(input) 
    {
      this.fK = 14.0;
      this.fOption = option;
      this.fK = k;
      this.Init();
      this.Color = color;
    }
示例#19
0
文件: VCH.cs 项目: heber/FreeOQ
		public VCH(TimeSeries input, int length1, int length2):base(input)
    {
      this.fLength1 = 14;
      this.fLength2 = 10;
      this.fLength1 = length1;
      this.fLength2 = length2;
      this.Init();
    }
示例#20
0
文件: R.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index, int length)
 {
   if (index < length - 1 + input.FirstIndex)
     return double.NaN;
   double num = input[index, BarData.Close];
   double min = input.GetMin(index - length + 1, index, BarData.Low);
   double max = input.GetMax(index - length + 1, index, BarData.High);
   return -100.0 * (max - num) / (max - min);
 }
示例#21
0
文件: VCH.cs 项目: heber/FreeOQ
		public VCH(TimeSeries input, int length1, int length2, Color color): base(input)
    {
      this.fLength1 = 14;
      this.fLength2 = 10;
      this.fLength1 = length1;
      this.fLength2 = length2;
      this.Init();
      this.Color = color;
    }
示例#22
0
文件: ENVL.cs 项目: heber/FreeOQ
		public ENVL(TimeSeries input, int length, double shift, BarData option)	: base(input) 
    {
      this.fLength = 14;
      this.fShift = 20.0;
      this.fLength = length;
      this.fShift = shift;
      this.fOption = option;
      this.Init();
    }
示例#23
0
文件: EMA.cs 项目: heber/FreeOQ
    public EMA(TimeSeries input, int length, BarData option, Color color, EDrawStyle drawStyle)
			: base(input) {
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.Init();
      this.Color = color;
      this.DrawStyle = drawStyle;
    }
示例#24
0
文件: PVT.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index)
 {
   if (index < 1 + input.FirstIndex)
     return double.NaN;
   double num1 = input[index, BarData.Close];
   double num2 = input[index - 1, BarData.Close];
   double num3 = input[index, BarData.Volume];
   return index < 2 + input.FirstIndex ? (num1 - num2) / num2 * num3 : (num1 - num2) / num2 * num3 + PVT.Value(input, index - 1);
 }
示例#25
0
文件: TR.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index)
 {
   if (index < input.FirstIndex + 1)
     return double.NaN;
   double num1 = input[index, BarData.High];
   double num2 = input[index, BarData.Low];
   double num3 = input[index - 1, BarData.Close];
   return Math.Max(Math.Abs(num1 - num2), Math.Max(Math.Abs(num1 - num3), Math.Abs(num3 - num2)));
 }
示例#26
0
文件: PERF.cs 项目: heber/FreeOQ
    public PERF(TimeSeries input, double k, BarData option, Color color, EDrawStyle drawStyle)
			: base(input) {
      this.fK = 14.0;
      this.fOption = option;
      this.fK = k;
      this.Init();
      this.Color = color;
      this.DrawStyle = drawStyle;
    }
示例#27
0
文件: PDI.cs 项目: heber/FreeOQ
    public PDI(TimeSeries input, int length, EIndicatorStyle style, Color color, EDrawStyle drawStyle)
			: base(input) {
      this.fLength = 14;
      this.fLength = length;
      this.fStyle = style;
      this.Init();
      this.Color = color;
      this.DrawStyle = drawStyle;
    }
示例#28
0
文件: MarketFI.cs 项目: heber/FreeOQ
 public static double Value(TimeSeries input, int index)
 {
   if (index < input.FirstIndex)
     return double.NaN;
   double num1 = input[index, BarData.High];
   double num2 = input[index, BarData.Low];
   double num3 = input[index, BarData.Volume];
   return num3 == 0.0 ? 0.0 : (num1 - num2) / num3 * 1000.0;
 }
示例#29
0
文件: MACD.cs 项目: heber/FreeOQ
    public MACD(TimeSeries input, int length1, int length2, BarData option)
			: base(input)  {
      this.fLength1 = 14;
      this.fLength2 = 10;
      this.fLength1 = length1;
      this.fLength2 = length2;
      this.fOption = option;
      this.Init();
    }
示例#30
0
文件: BBU.cs 项目: heber/FreeOQ
    public BBU(TimeSeries input, int length, double k, BarData option)
			: base(input)   {
      this.fLength = 14;
      this.fK = 3.0;
      this.fLength = length;
      this.fOption = option;
      this.fK = k;
      this.Init();
    }
示例#31
0
 ///<summary>
 ///  Initializes a new instance of the UserIndicator class
 ///</summary>
 public UserIndicator(ISeries input)
 {
     this.input = input;
     if (input is TimeSeries)
     {
         this.series = (FreeQuant.Series.TimeSeries)(input as TimeSeries).series;
     }
     if (input is BarSeries)
     {
         this.series = (FreeQuant.Series.TimeSeries)(input as BarSeries).series;
     }
     if (input is Indicator)
     {
         this.series = (FreeQuant.Series.TimeSeries)(input as Indicator).indicator;
     }
     this.indicator = new FreeQuant.Indicators.Indicator(this.series);
 }
示例#32
0
 public SeriesEventArgs(TimeSeries series) : base()
 {
     this.Series = series;
 }
示例#33
0
 public virtual double GetCovariance(TimeSeries series)
 {
     throw new NotSupportedException();
 }
示例#34
0
 public ECross Crosses(TimeSeries series, Bar bar, BarData barData)
 {
     return(this.Crosses(series, bar.DateTime, barData));
 }
示例#35
0
 public override double GetCovariance(TimeSeries series)
 {
     return(this.GetCovariance(series, this.FirstDateTime, this.LastDateTime));
 }
示例#36
0
 public bool CrossesAbove(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime) == ECross.Above);
 }
示例#37
0
 public bool CrossesAbove(TimeSeries series, DateTime dateTime)
 {
     return(this.Crosses(series, dateTime) == ECross.Above);
 }
示例#38
0
 public bool CrossesBelow(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime) == ECross.Below);
 }
示例#39
0
 public bool CrossesBelow(TimeSeries series, DateTime dateTime)
 {
     return(this.Crosses(series, dateTime) == ECross.Below);
 }
示例#40
0
 public ECross Crosses(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime));
 }
示例#41
0
 public ECross Crosses(TimeSeries series, DateTime dateTime, BarData barData)
 {
     return(this.Crosses(series, dateTime, (int)barData));
 }
示例#42
0
 public virtual double GetCorrelation(TimeSeries series, DateTime datetime1, DateTime datetime2)
 {
     throw new NotSupportedException();
 }
示例#43
0
 public virtual double GetCorrelation(TimeSeries series)
 {
     throw new NotSupportedException();
 }
示例#44
0
 public ECross Crosses(TimeSeries series, Bar bar, int row)
 {
     return(this.Crosses(series, bar.DateTime, row));
 }