Beispiel #1
0
		public SMA(TimeSeries input, int length, BarData option, Color color) : base(input)
		{
			this.fLength = length;
			this.fOption = option;
			this.Init();
			this.Color = color;
		}
Beispiel #2
0
    public KRI(TimeSeries input, int length)
			: base(input)  {
      this.fLength = 14;

      this.fLength = length;
      this.Init();
    }
Beispiel #3
0
 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);
 }
Beispiel #4
0
		public PCL(TimeSeries input, int length, Color color)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.Init();
      this.Color = color;
    }
Beispiel #5
0
		public PERF(TimeSeries input, double k, BarData option)	: base(input) 
    {
      this.fK = 14.0;
      this.fOption = option;
      this.fK = k;
      this.Init();
    }
Beispiel #6
0
 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;
 }
Beispiel #7
0
		public Range(TimeSeries input, int length, Color color)	: base(input) 
    {
      this.length = 14;
      this.length = length;
      this.Init();
			this.fColor = color;
    }
Beispiel #8
0
 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;
 }
Beispiel #9
0
		public PDI(TimeSeries input, int length, EIndicatorStyle style)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fStyle = style;
      this.Init();
    }
Beispiel #10
0
 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;
 }
Beispiel #11
0
 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;
 }
Beispiel #12
0
		public EMA(TimeSeries input, int length, BarData option)	: base(input) 
    {
      this.fLength = 14;
      this.fLength = length;
      this.fOption = option;
      this.Init();
    }
Beispiel #13
0
		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;
    }
Beispiel #14
0
    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();
    }
Beispiel #15
0
		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();
    }
Beispiel #16
0
    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;
    }
Beispiel #17
0
		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;
    }
Beispiel #18
0
		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;
    }
Beispiel #19
0
		public VCH(TimeSeries input, int length1, int length2):base(input)
    {
      this.fLength1 = 14;
      this.fLength2 = 10;
      this.fLength1 = length1;
      this.fLength2 = length2;
      this.Init();
    }
Beispiel #20
0
Datei: R.cs Projekt: 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);
 }
Beispiel #21
0
		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;
    }
Beispiel #22
0
		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();
    }
Beispiel #23
0
    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;
    }
Beispiel #24
0
 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);
 }
Beispiel #25
0
 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)));
 }
Beispiel #26
0
    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;
    }
Beispiel #27
0
    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;
    }
Beispiel #28
0
 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;
 }
Beispiel #29
0
    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();
    }
Beispiel #30
0
    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();
    }
Beispiel #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);
 }
Beispiel #32
0
 public SeriesEventArgs(TimeSeries series) : base()
 {
     this.Series = series;
 }
Beispiel #33
0
 public virtual double GetCovariance(TimeSeries series)
 {
     throw new NotSupportedException();
 }
Beispiel #34
0
 public ECross Crosses(TimeSeries series, Bar bar, BarData barData)
 {
     return(this.Crosses(series, bar.DateTime, barData));
 }
Beispiel #35
0
 public override double GetCovariance(TimeSeries series)
 {
     return(this.GetCovariance(series, this.FirstDateTime, this.LastDateTime));
 }
Beispiel #36
0
 public bool CrossesAbove(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime) == ECross.Above);
 }
Beispiel #37
0
 public bool CrossesAbove(TimeSeries series, DateTime dateTime)
 {
     return(this.Crosses(series, dateTime) == ECross.Above);
 }
Beispiel #38
0
 public bool CrossesBelow(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime) == ECross.Below);
 }
Beispiel #39
0
 public bool CrossesBelow(TimeSeries series, DateTime dateTime)
 {
     return(this.Crosses(series, dateTime) == ECross.Below);
 }
Beispiel #40
0
 public ECross Crosses(TimeSeries series, Bar bar)
 {
     return(this.Crosses(series, bar.DateTime));
 }
Beispiel #41
0
 public ECross Crosses(TimeSeries series, DateTime dateTime, BarData barData)
 {
     return(this.Crosses(series, dateTime, (int)barData));
 }
Beispiel #42
0
 public virtual double GetCorrelation(TimeSeries series, DateTime datetime1, DateTime datetime2)
 {
     throw new NotSupportedException();
 }
Beispiel #43
0
 public virtual double GetCorrelation(TimeSeries series)
 {
     throw new NotSupportedException();
 }
Beispiel #44
0
 public ECross Crosses(TimeSeries series, Bar bar, int row)
 {
     return(this.Crosses(series, bar.DateTime, row));
 }