private async void ExecuteCopyRates(object o) { if (string.IsNullOrEmpty(TimeSeriesValues?.SymbolValue)) { return; } TimeSeriesResults.Clear(); var result = await Execute(() => { MqlRates[] array; var count = _mtApiClient.CopyRates(TimeSeriesValues.SymbolValue, TimeSeriesValues.TimeFrame, TimeSeriesValues.StartPos, TimeSeriesValues.Count, out array); return(count > 0 ? array : null); }); if (result == null) { AddLog("CopyRates: result is null"); return; } RunOnUiThread(() => { foreach (var rates in result) { TimeSeriesResults.Add( $"time={rates.time}; open={rates.open}; high={rates.high}; low={rates.low}; close={rates.close}; tick_volume={rates.tick_volume}; spread={rates.spread}; real_volume={rates.tick_volume}"); } }); AddLog("CopyRates: success"); }
private async void ExecuteCopySpread(object o) { if (string.IsNullOrEmpty(TimeSeriesValues?.SymbolValue)) { return; } TimeSeriesResults.Clear(); var result = await Execute(() => { int[] array; var count = _mtApiClient.CopySpread(TimeSeriesValues.SymbolValue, TimeSeriesValues.TimeFrame, TimeSeriesValues.StartPos, TimeSeriesValues.Count, out array); return(count > 0 ? array : null); }); if (result == null) { AddLog("CopySpread: result is null"); return; } RunOnUiThread(() => { foreach (var value in result) { TimeSeriesResults.Add(value.ToString()); } }); AddLog("CopySpread: success"); }
private async void ExecuteCopyTicks(object o) { if (string.IsNullOrEmpty(TimeSeriesValues?.SymbolValue)) { return; } TimeSeriesResults.Clear(); var result = await Execute(() => _mtApiClient.CopyTicks(TimeSeriesValues.SymbolValue)); if (result == null) { AddLog("CopyTicks: result is null"); return; } AddLog("CopyTicks: success."); RunOnUiThread(() => { foreach (var v in result) { var tickStr = $"time = {v.time}, bid = {v.bid}, ask = {v.ask}, last = {v.last}, volume = {v.volume}"; TimeSeriesResults.Add(tickStr); } }); }