public IEnumerable <IDataPoint> GetPoints(IDataSeries series) { foreach (var p in this) { yield return(p); } }
internal DataSeriesObject(IDataSeries series, DateTime dateTime1, DateTime dateTime2, EventQueue queue, DataProcessor processor) { this.series = series; eventQueue = queue; if (processor == null) { this.processor = new DataProcessor(); } else { this.processor = processor; } if (!(dateTime1 == DateTime.MinValue) && (dateTime1 >= series.DateTime1)) { index1 = series.GetIndex(dateTime1, SearchOption.Next); } else { index1 = 0L; } if (!(dateTime2 == DateTime.MaxValue) && (dateTime2 <= series.DateTime2)) { index2 = series.GetIndex(dateTime2); } else { index2 = series.Count - 1L; } current = index1; progressDelta = (int)Math.Ceiling(Count() / 100.0); progressCount = progressDelta; progressPercent = 0; }
private void ltvDataSeries_SelectedIndexChanged(object sender, EventArgs e) { this.InitChart(); if (this.ltvDataSeries.SelectedItems.Count == 1) { IDataSeries dataSeries = (this.ltvDataSeries.SelectedItems[0] as DataSeriesViewItem).DataSeries; this.dataSeriesViewer.SetDataSeries(dataSeries); switch (DataSeriesHelper.GetDataSeriesInfo(dataSeries.Name).DataType) { case DataType.Trade: this.InitChart((ChartPanel) new TradeChartPanel(), dataSeries); break; case DataType.Quote: this.InitChart((ChartPanel) new QuoteChartPanel(), dataSeries); break; case DataType.Bar: case DataType.Daily: this.InitChart((ChartPanel) new BarChartPanel(), dataSeries); break; } } else { this.dataSeriesViewer.SetDataSeries((IDataSeries)null); } }
protected override void OnBarUpdate() { IDataSeries ema1 = EMA(Input, Period); double difference = ema1[0] - EMA(ema1, Period)[0]; Value.Set(ema1[0] + difference); }
public ExportTask(IDataSeries dataSeries, string outputFileName) { this.DataSeries = dataSeries; this.OutputFileName = outputFileName; this.State = ExportTaskState.Waiting; this.Text = string.Empty; }
internal override WorksheetSeriesDataProvider CreateSeriesDataProvider(IDataSeries dataSeries) { WorksheetSeriesDataProvider provider = base.CreateSeriesDataProvider(dataSeries); IDataSeries series1 = base.DataSeries; return(provider); }
public void Execute(TestParameters testParameters, TimeSpan duration, Action <double> fpsResult) { int pointCount = testParameters.PointCount; int seriesCount = testParameters.PointCount; DataSeries = null; // Generate Data and mark time XyData[] xyData = new XyData[seriesCount]; var random = new Random(); for (int i = 0; i < seriesCount; i++) { var generator = new RandomWalkGenerator(random.Next(0, int.MaxValue)); xyData[i] = generator.GetRandomWalkSeries(pointCount); } // Append to SciChartSurface var allDataSeries = new IDataSeries[seriesCount]; for (int i = 0; i < seriesCount; i++) { var dataSeries = new XyDataSeries <double, double>(); dataSeries.Append(xyData[i].XData, xyData[i].YData); allDataSeries[i] = dataSeries; } DataSeries = allDataSeries; // Run test (just refresh) _testRunner = new DispatcherTimerRunner(duration, () => this.sciChart.InvalidateElement(), fpsResult); sciChart.Rendered += _testRunner.OnSciChartRendered; _testRunner.Run(); }
protected override void OnInit() { this.instrument = this.Key as Instrument; DataSeriesList dataSeries = this.instrument.GetDataSeries(); this.template = Global.ChartManager.Templates["Default Template"]; this.Text = "Chart [" + ((FIXInstrument)this.instrument).Symbol + "]"; this.instrumentListSource.AddInstrument(this.instrument); this.instrumentListSource.SelectedInstrument = this.instrument; IEnumerator enumerator = dataSeries.GetEnumerator(); try { while (enumerator.MoveNext()) { IDataSeries idataSeries = (IDataSeries)enumerator.Current; string key = DataSeriesHelper.SeriesNameToString(idataSeries.Name); if (key.StartsWith("Bar") || key == "Daily") { this.seriesNames.Add(key, idataSeries.Name); this.instrumentListSource.AddSeries(this.instrument, new BarSeries(key)); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } this.instrumentListSource.Refresh(); }
/// <summary> /// The mean reversion is the theory suggesting that prices and returns eventually move back towards the mean or average. /// </summary> public Mean_Reversion_Indicator Mean_Reversion_Indicator(IDataSeries input, System.Boolean isLongEnabled, System.Boolean isShortEnabled, System.Int32 bollinger_Period, System.Double bollinger_Standard_Deviation, System.Int32 momentum_Period, System.Int32 rSI_Period, System.Int32 rSI_Smooth, System.Int32 rSI_Level_Low, System.Int32 rSI_Level_High, System.Int32 momentum_Level_Low, System.Int32 momentum_Level_High) { var indicator = CachedCalculationUnits.GetCachedIndicator <Mean_Reversion_Indicator>(input, i => i.IsLongEnabled == isLongEnabled && i.IsShortEnabled == isShortEnabled && i.Bollinger_Period == bollinger_Period && Math.Abs(i.Bollinger_Standard_Deviation - bollinger_Standard_Deviation) <= Double.Epsilon && i.Momentum_Period == momentum_Period && i.RSI_Period == rSI_Period && i.RSI_Smooth == rSI_Smooth && i.RSI_Level_Low == rSI_Level_Low && i.RSI_Level_High == rSI_Level_High && i.Momentum_Level_Low == momentum_Level_Low && i.Momentum_Level_High == momentum_Level_High); if (indicator != null) { return(indicator); } indicator = new Mean_Reversion_Indicator { BarsRequired = BarsRequired, CalculateOnBarClose = CalculateOnBarClose, Input = input, IsLongEnabled = isLongEnabled, IsShortEnabled = isShortEnabled, Bollinger_Period = bollinger_Period, Bollinger_Standard_Deviation = bollinger_Standard_Deviation, Momentum_Period = momentum_Period, RSI_Period = rSI_Period, RSI_Smooth = rSI_Smooth, RSI_Level_Low = rSI_Level_Low, RSI_Level_High = rSI_Level_High, Momentum_Level_Low = momentum_Level_Low, Momentum_Level_High = momentum_Level_High }; indicator.SetUp(); CachedCalculationUnits.AddIndicator2Cache(indicator); return(indicator); }
private int calcLastCross(IDataSeries series1, IDataSeries series2) { int crossedAbove = 0; for (crossedAbove = 0; crossedAbove < FastPlot.Count; crossedAbove++) { if (CrossAbove(series1, series2, crossedAbove)) { break; } } int crossedBelow = 0; for (crossedBelow = 0; crossedBelow < FastPlot.Count; crossedBelow++) { if (CrossBelow(series1, series2, crossedBelow)) { break; } } int lookBackPeriod = Math.Min(crossedAbove, crossedBelow); direction = -1; // init direction, crossed below if (lookBackPeriod == crossedAbove) { direction = 1; // crossed above } return(lookBackPeriod); }
public double NtGetWaveAShort(IDataSeries ds, int barsAgo) { double rVal = 0.0; rVal = TTMWaveAOC(ds, false).Wave1[barsAgo]; return(rVal); }
public static DataObjectViewer GetViewer(IDataSeries dataSeries) { if (dataSeries == null) { return((DataObjectViewer)null); } switch (DataSeriesHelper.GetDataSeriesInfo(dataSeries.Name).DataType) { case DataType.Trade: return((DataObjectViewer) new TradeViewer()); case DataType.Quote: return((DataObjectViewer) new QuoteViewer()); case DataType.Bar: return((DataObjectViewer) new BarViewer()); case DataType.Daily: return((DataObjectViewer) new DailyViewer()); case DataType.MarketDepth: return((DataObjectViewer) new MarketDepthViewer()); default: return((DataObjectViewer)null); } }
public void Save(Instrument instrument, IDataSeries series, SaveMode option = SaveMode.Add) { for (long i = 0; i < series.Count; i++) { Server.Save(instrument, series[i], option); } }
public double NtGetWaveBLong(IDataSeries ds, int barsAgo) { double rVal = 0.0; rVal = TTMWaveBOC(ds, false).Wave2[barsAgo]; return(rVal); }
private TimeSeries(string name, string description = "", int id = -1, IDataSeries series = null) { this.name = name; this.description = description; Id = id; this.series = series ?? new MemorySeries(name, description); }
private IDataSeries GetDataSeries() { string str1 = (string)null; switch (this.template.SymbolOptions.Option) { case SymbolOption.FileName: str1 = this.currentFile.Name; if (this.currentFile.Extension != string.Empty) { str1 = str1.Substring(0, str1.IndexOf('.')); break; } else { break; } case SymbolOption.Column: str1 = this.currentItems[this.GetColumnIndex(ColumnType.Symbol)].Trim(); break; case SymbolOption.Manually: str1 = this.template.SymbolOptions.Name; break; } if (this.template.OtherOptions.CreateInstrument && InstrumentManager.Instruments[str1] == null) { new Instrument(str1, APITypeConverter.InstrumentType.Convert(this.template.OtherOptions.InstrumentType)).Save(); } string str2 = (string)null; switch (this.template.DataOptions.DataType) { case DataType.Trade: str2 = "Trade"; break; case DataType.Quote: str2 = "Quote"; break; case DataType.Bar: str2 = "Bar" + (object)'.' + ((object)(BarType)1).ToString() + (string)(object)'.' + this.template.DataOptions.BarSize.ToString(); break; case DataType.Daily: str2 = "Daily"; break; } string str3 = str1 + (object)'.' + str2; IDataSeries idataSeries = DataManager.Server.GetDataSeries(str3) ?? DataManager.Server.AddDataSeries(str3); if (this.template.OtherOptions.ClearSeries && !this.clearedSeries.ContainsKey((object)idataSeries)) { idataSeries.Clear(); this.clearedSeries.Add((object)idataSeries, (object)true); } return(idataSeries); }
protected override void OnStartUp() { if (smooth > 1) { switch (maType) { case MovingAverageType.SMA: avg = SMA(Input, smooth); break; case MovingAverageType.SMMA: avg = SMMA(Input, smooth); break; case MovingAverageType.TMA: avg = TMA(Input, smooth); break; case MovingAverageType.WMA: avg = WMA(Input, smooth); break; case MovingAverageType.VWMA: avg = VWMA(Input, smooth); break; case MovingAverageType.TEMA: avg = TEMA(Input, smooth); break; case MovingAverageType.HMA: avg = HMA(Input, smooth); break; case MovingAverageType.VMA: avg = VMA(Input, smooth, smooth); break; default: avg = EMA(Input, smooth); break; } } else { avg = Input; } }
/// <summary> /// In this function we do all the work and send back the OrderAction. /// </summary> /// <param name="data"></param> /// <returns></returns> public OrderAction?calculate(IDataSeries data, IDataSeries open, IDataSeries high, IOrder longorder, IOrder shortorder, int bollinger_period, double bollinger_standarddeviation, int momentum_period, int rsi_period, int rsi_smooth, int rsi_level_low, int rsi_level_high, int momentum_level_low, int momentum_level_high) { //Calculate BB Bollinger bb = Bollinger(data, bollinger_standarddeviation, bollinger_period); Momentum mom = Momentum(data, momentum_period); RSI rsi = RSI(data, rsi_period, rsi_smooth); bb_lower = bb.Lower[0]; bb_middle = bb.Middle[0]; bb_upper = bb.Upper[0]; //if (high[0] > open[1]) //{ if (mom[0] >= momentum_level_high && rsi[0] <= rsi_level_low && data[0] <= bb.Lower[0] && data[1] <= bb.Lower[1] && data[2] <= bb.Lower[2]) { return(OrderAction.Buy); } else if (mom[0] <= momentum_level_low && rsi[0] >= rsi_level_high && data[0] >= bb.Upper[0] && data[1] >= bb.Upper[1] && data[2] >= bb.Upper[2]) { return(OrderAction.SellShort); } else if (data[0] >= bb.Upper[0] && longorder != null) { //currently we left the building on the upper band, is it better if we switch to a stop? return(OrderAction.Sell); } else if (data[0] <= bb.Lower[0] && shortorder != null) { return(OrderAction.BuyToCover); } //} return(null); }
public virtual void Create(C1Chart chart, IDataSeries[] dss, int npts) { Reset(chart); IEnumerable x = null; for (int i = 0; i < dss.Length; i++) { DataSeries ds = null; if (i < chart.Data.Children.Count) { ds = (DataSeries)chart.Data.Children[i]; dss[i].Update(ds, npts); } else ds = dss[i].Create(npts); XYDataSeries xds = ds as XYDataSeries; if (xds != null) { if (x == null) x = xds.XValuesSource; else xds.XValuesSource = x; } if( !chart.Data.Children.Contains(ds)) chart.Data.Children.Add(ds); } }
private SCIStackedMountainRenderableSeries GetRenderableSeries(IDataSeries dataSeries, uint fillColorStart, uint fillColorEbd) { return(new SCIStackedMountainRenderableSeries { DataSeries = dataSeries, AreaStyle = new SCILinearGradientBrushStyle(fillColorStart, fillColorEbd, SCILinearGradientDirection.Vertical), }); }
public void Create(C1Chart chart, IDataSeries ds, int nser, int npts) { IDataSeries[] dss = new IDataSeries[nser]; for (int i = 0; i < nser; i++) dss[i] = ds; Create(chart, dss, npts); }
private StackedMountainRenderableSeries GetRenderableSeries(IDataSeries dataSeries, Color fillColorStart, Color fillColorEbd) { return(new StackedMountainRenderableSeries { DataSeries = dataSeries, AreaStyle = new LinearGradientBrushStyle(0, 0, 0, 1, fillColorStart, fillColorEbd, TileMode.Clamp) }); }
private StackedColumnRenderableSeries GetRenderableSeries(IDataSeries dataSeries, Color strokeColor, Color fillColor) { return(new StackedColumnRenderableSeries { DataSeries = dataSeries, StrokeStyle = new PenStyle.Builder(Activity).WithColor(strokeColor).WithThickness(1f, ComplexUnitType.Dip).Build(), FillBrushStyle = new SolidBrushStyle(fillColor) }); }
private StackedColumnRenderableSeries GetRenderableSeries(IDataSeries dataSeries, uint fillColor, uint strokeColor) { return(new StackedColumnRenderableSeries { DataSeries = dataSeries, StrokeStyle = new SolidPenStyle(Activity, strokeColor), FillBrushStyle = new SolidBrushStyle(fillColor) }); }
/// <summary> /// Show seasonal trends /// </summary> public Seasonal_Indicator Seasonal_Indicator(IDataSeries input, SeasonalType seasonalType) { if (InInitialize && input == null) { throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); } return(LeadIndicator.Seasonal_Indicator(input, seasonalType)); }
/// <summary> /// Provides a signal in every even minute /// </summary> public DummyOneMinuteEven_Indicator DummyOneMinuteEven_Indicator(IDataSeries input) { if (InInitialize && input == null) { throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); } return(LeadIndicator.DummyOneMinuteEven_Indicator(input)); }
/// <summary> /// Qualitative Quantitative Estimation. QQE is a combination moving average RSI + ATR. /// </summary> public QQE QQE(IDataSeries input, System.Int32 rSI_Period, System.Int32 sF) { if (InInitialize && input == null) { throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); } return(LeadIndicator.QQE(input, rSI_Period, sF)); }
/// <summary> /// The Minimum shows the minimum of the last n bars. /// </summary> /// <returns></returns> public MIN MIN(IDataSeries input, int period) { if (InInitialize && input == null) { throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); } return(_indicator.MIN(input, period)); }
/// <summary> /// Compare the current value of an indicator to latest high value of the indicator in a defined period of time. /// </summary> public HighestHighValue_Indicator HighestHighValue_Indicator(IDataSeries input) { if (InInitialize && input == null) { throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); } return(LeadIndicator.HighestHighValue_Indicator(input)); }
/// <summary> /// The mean reversion is the theory suggesting that prices and returns eventually move back towards the mean or average. /// </summary> public Mean_Reversion_Indicator Mean_Reversion_Indicator(IDataSeries input, System.Boolean isLongEnabled, System.Boolean isShortEnabled, System.Int32 bollinger_Period, System.Double bollinger_Standard_Deviation, System.Int32 momentum_Period, System.Int32 rSI_Period, System.Int32 rSI_Smooth, System.Int32 rSI_Level_Low, System.Int32 rSI_Level_High, System.Int32 momentum_Level_Low, System.Int32 momentum_Level_High) { if (InInitialize && input == null) { throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); } return(LeadIndicator.Mean_Reversion_Indicator(input, isLongEnabled, isShortEnabled, bollinger_Period, bollinger_Standard_Deviation, momentum_Period, rSI_Period, rSI_Smooth, rSI_Level_Low, rSI_Level_High, momentum_Level_Low, momentum_Level_High)); }
public void Remove(string series, DateTime datetime) { IDataSeries dataSeries = this.file.Series[series]; if (dataSeries != null) { dataSeries.Remove(datetime); } }
/// <summary> /// Plots the Fibonacci Lines of the current session., /// </summary> public Fibonacci_Current_Session Fibonacci_Current_Session(IDataSeries input) { if (InInitialize && input == null) { throw new ArgumentException("You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); } return(LeadIndicator.Fibonacci_Current_Session(input)); }
/// <summary> /// Froms the bar series to a double array. /// </summary> /// <param name="thebarserie">The thebarserie.</param> /// <returns></returns> public static double[] FromBarSeriestoDouble(IDataSeries thebarserie) { var outputtedseries = new double[thebarserie.Count]; int index = 0; foreach (Data.Data.Bar abar in thebarserie) { outputtedseries[index] = abar.Close; index++; } return outputtedseries; }
public static void GenerateXGrids(this ICanvasRange range, IDataSeries series) { for (double dy = range.Ymin + range.YTick; dy < range.Ymax; dy += range.YTick) { Line gridLine = new Line { X1 = range.NormalizePoint(new Point(range.Xmin, dy)).X, Y1 = range.NormalizePoint(new Point(range.Xmin, dy)).Y, X2 = range.NormalizePoint(new Point(range.Xmax, dy)).X, Y2 = range.NormalizePoint(new Point(range.Xmax, dy)).Y }; series.AddLinePattern(gridLine); range.ChartCanvas.Children.Add(gridLine); } }
protected override void OnStartUp() { if (smooth > 1) switch (maType) { case MovingAverageType.SMA : avg = SMA(Input, smooth); break; case MovingAverageType.SMMA : avg = SMMA(Input, smooth); break; case MovingAverageType.TMA : avg = TMA(Input, smooth); break; case MovingAverageType.WMA : avg = WMA(Input, smooth); break; case MovingAverageType.VWMA : avg = VWMA(Input, smooth); break; case MovingAverageType.TEMA : avg = TEMA(Input, smooth); break; case MovingAverageType.HMA : avg = HMA(Input, smooth); break; case MovingAverageType.VMA : avg = VMA(Input, smooth, smooth); break; default : avg = EMA(Input, smooth); break; } else avg = Input; }
public static DataObjectViewer GetViewer(IDataSeries dataSeries) { if (dataSeries == null) return (DataObjectViewer) null; switch (DataSeriesHelper.GetDataSeriesInfo(dataSeries.Name).DataType) { case DataType.Trade: return (DataObjectViewer) new TradeViewer(); case DataType.Quote: return (DataObjectViewer) new QuoteViewer(); case DataType.Bar: return (DataObjectViewer) new BarViewer(); case DataType.Daily: return (DataObjectViewer) new DailyViewer(); case DataType.MarketDepth: return (DataObjectViewer) new MarketDepthViewer(); default: return (DataObjectViewer) null; } }
public TimeSeries(string name, string title) { this.fColor = Color.Black; this.fMonitored = true; this.fToolTipEnabled = true; this.fToolTipFormat = ""; this.fToolTipDateTimeFormat = ""; this.fChildren = new ArrayList(); this.fName = name; this.fTitle = title; this.fArray = new MemorySeries<object>(); }
public void Save(Instrument instrument, IDataSeries series, SaveMode option = SaveMode.Add) { for (long i = 0; i < series.Count; i++) Server.Save(instrument, series[i], option); }
protected virtual void Add(IDataSeries series, IDataObject obj) { series.Add(obj.DateTime, obj); }
public void OutputSeries(out IDataSeries trades, out IDataSeries bids, out IDataSeries asks) { trades = new TickSeries(); bids = new TickSeries(); asks = new TickSeries(); PbTickCodec codec = new PbTickCodec(); int TradingDay = -1; int _lastTradeSize = 0; foreach (var s in Series) { if(TradingDay != s.TradingDay) { _lastTradeSize = 0; TradingDay = s.TradingDay; } var dateTime = codec.GetDateTime(s.ActionDay == 0 ? s.TradingDay : s.ActionDay).Add(codec.GetUpdateTime(s)); var tick = PbTick2DepthMarketDataNClass(codec, s); if(SubscribeExternData) { var trade = new TradeEx(dateTime, 0, _InstrumentId, tick.LastPrice, (int)tick.Volume); trade.Size -= _lastTradeSize; trade.DepthMarketData = tick; trades.Add(trade); } else { var trade = new Trade(dateTime, 0, _InstrumentId, tick.LastPrice, (int)tick.Volume); trade.Size -= _lastTradeSize; trades.Add(trade); } if (tick.Bids != null && tick.Bids.Length > 0) { var bid = new Bid(dateTime, 0, _InstrumentId, tick.Bids[0].Price, tick.Bids[0].Size); bids.Add(bid); } if (tick.Asks != null && tick.Asks.Length > 0) { var ask = new Ask(dateTime, 0, _InstrumentId, tick.Asks[0].Price, tick.Asks[0].Size); asks.Add(ask); } _lastTradeSize = (int)tick.Volume; } }
/// <summary> /// The anaMovingMedian (Simple Moving Average) is an indicator that shows the average value of a security's price over a period of time. /// </summary> /// <returns></returns> public anaMovingMedian anaMovingMedian(IDataSeries input, int period) { if (InInitialize && input == null) throw new ArgumentException( "You only can access an indicator with the default input/bar series from within the 'Initialize()' method"); return _indicator.anaMovingMedian(input, period); }
public bool Contains(IDataSeries series) { return this.list.Contains(series); }
public int IndexOf(IDataSeries series) { return this.list.IndexOf(series); }
protected override void Add(IDataSeries series, IDataObject obj) { series.Update(obj.DateTime, obj); }
public SeriesObjectEventArgs(IDataSeries series, IDataObject obj) : base() { this.Series = series; this.Object = obj; }
public DataSeriesViewItem(IDataSeries dataSeries) : base(new string[4], 0) { this.dataSeries = dataSeries; this.Update(); }
/// <summary> /// The anaMovingMedian (Simple Moving Average) is an indicator that shows the average value of a security's price over a period of time. /// </summary> /// <returns></returns> public anaMovingMedian anaMovingMedian(IDataSeries input, int period) { if (cacheanaMovingMedian != null) for (int idx = 0; idx < cacheanaMovingMedian.Length; idx++) if (cacheanaMovingMedian[idx].Period == period && cacheanaMovingMedian[idx].EqualsInput(input)) return cacheanaMovingMedian[idx]; lock (checkanaMovingMedian) { checkanaMovingMedian.Period = period; period = checkanaMovingMedian.Period; if (cacheanaMovingMedian != null) for (int idx = 0; idx < cacheanaMovingMedian.Length; idx++) if (cacheanaMovingMedian[idx].Period == period && cacheanaMovingMedian[idx].EqualsInput(input)) return cacheanaMovingMedian[idx]; var indicator = new anaMovingMedian(); indicator.BarsRequired = BarsRequired; indicator.CalculateOnBarClose = CalculateOnBarClose; #if NT7 indicator.ForceMaximumBarsLookBack256 = ForceMaximumBarsLookBack256; indicator.MaximumBarsLookBack = MaximumBarsLookBack; #endif indicator.Input = input; indicator.Period = period; Indicators.Add(indicator); indicator.SetUp(); var tmp = new anaMovingMedian[cacheanaMovingMedian == null ? 1 : cacheanaMovingMedian.Length + 1]; if (cacheanaMovingMedian != null) cacheanaMovingMedian.CopyTo(tmp, 0); tmp[tmp.Length - 1] = indicator; cacheanaMovingMedian = tmp; return indicator; } }
/// <summary> /// The anaMovingMedian (Simple Moving Average) is an indicator that shows the average value of a security's price over a period of time. /// </summary> /// <returns></returns> public anaMovingMedian anaMovingMedian(IDataSeries input, int period) { return _indicator.anaMovingMedian(input, period); }
public DataSeriesObject(IDataSeries series, DateTime dateTime1, DateTime dateTime2, EventQueue dataQueue, DataProcessor processor) { this.queue = new EventQueue(EventQueueId.All, EventQueueType.Master, EventQueuePriority.Normal, 128, null); this.series = series; this.dataQueue = dataQueue; this.processor = processor ?? new DataProcessor(); this.index1 = dateTime1 == DateTime.MinValue || dateTime1 < series.DateTime1 ? 0 : series.GetIndex(dateTime1, SearchOption.Next); this.index2 = dateTime2 == DateTime.MaxValue || dateTime2 > series.DateTime2 ? series.Count - 1 : series.GetIndex(dateTime2, SearchOption.Prev); this.current = this.index1; this.delta = (int)Math.Ceiling((this.index2 - this.index1 + 1) / 100.0); this.count = this.delta; this.percent = 0; }
public void SetDataSeries(IDataSeries series) { this.WF0dC3KCxx = series; this.PI6dU6Axph.SelectedItem = (object) Dhgssiwum3QkgMqvJP.kqFukiu92g(series); this.Text = string.Format(RNaihRhYEl0wUmAftnB.aYu7exFQKN(10402), (object) series.Name); }
public DataSeriesViewItem(IDataSeries dataSeries) : base(new string[1]) { this.DataSeries = dataSeries; this.SubItems[0].Text = DataSeriesHelper.GetDataSeriesInfo(dataSeries.Name).Symbol; this.ImageIndex = 0; }
public int Add(IDataSeries series) { return this.list.Add(series); }
public DataSeriesViewer() { this.InitializeComponent(); this.dataSeries = (IDataSeries) null; }
public TimeSeries(IDataSeries series) : this(series.Name, series.Description, -1, series) { }
public void SetDataSeries(IDataSeries dataSeries) { this.dataSeries = dataSeries; this.Init(); }
private void CalculateGD(IDataSeries input, DataSeries output) { output.Set((EMA(input, Period)[0] * (1 + VFactor)) - (EMA(EMA(input, Period), Period)[0] * VFactor)); }
public double MyStdDev(IDataSeries price, int p, AverageType at) { double avg; switch (at) { case AverageType.EMA : avg = EMA(price, p)[0]; break; case AverageType.SMA : avg = SMA(price, p)[0]; break; case AverageType.HMA : avg = HMA(price, p)[0]; break; case AverageType.LinReg : avg = LinReg(price, p)[0]; break; case AverageType.VOLMA : avg = VOLMA(price, p)[0]; break; case AverageType.ATR : avg = 1000 * ATR(price, p)[0]; break; case AverageType.StdDev : avg = 1000 * StdDev(price, p)[0]; break; case AverageType.CCI : avg = CCI(price, p)[0]; break; case AverageType.RSI : avg = RSI(price, p, 3)[0]; break; case AverageType.ROC : avg = ROC(price, p)[0]; break; default : avg = WMA(price, p)[0]; break; } double sum = 0; for (int barsBack = Math.Min(CurrentBar, p - 1); barsBack >= 0; barsBack--) sum += (price[barsBack] - avg) * (price[barsBack] - avg); return (Math.Sqrt(sum / Math.Min(CurrentBar + 1, p))); }