private void OnReceiveRealData(object sender, _DKHOpenAPIEvents_OnReceiveRealDataEvent e) { sb = new StringBuilder(512); int index = Array.FindIndex(Enum.GetNames(typeof(IRealType.RealType)), o => o.Equals(e.sRealType)); foreach (int fid in type.Catalog[index]) { sb.Append(axAPI.GetCommRealData(e.sRealKey, fid)).Append(';'); } switch (index) { case 1: if (e.sRealKey.Substring(0, 3).Equals("101")) { SendDatum?.Invoke(this, new Datum(sb)); } break; case 5: string[] find = sb.ToString().Split(';'); OptionsCalling[e.sRealKey] = double.Parse(find[1].Contains("-") ? find[1].Substring(1) : find[1]); break; case 7: if (sb.ToString().Substring(0, 1).Equals("e") && DeadLine == false) { DeadLine = true; Delay.delay = 4150; Request(Code[0].Substring(0, 8)); } break; } }
void StartProgress() { foreach (var quotes in Retrieve.Quotes) { if (quotes.Price != null && quotes.Volume != null) { SendDatum?.Invoke(this, new Datum(quotes.Time, quotes.Price)); continue; } SendQuotes?.Invoke(this, new Quotes(quotes.Time, quotes.SellPrice, quotes.BuyPrice, quotes.SellQuantity, quotes.BuyQuantity, quotes.SellAmount, quotes.BuyAmount)); } }
int StartProgress(int length) { if (length > 2) { foreach (var quotes in Retrieve.Quotes) { if (quotes.Price != null && quotes.Volume != null) { SendDatum?.Invoke(this, new Datum(quotes.Time, quotes.Price, quotes.Volume)); continue; } SendQuotes?.Invoke(this, new Quotes(quotes.Time, quotes.SellPrice, quotes.BuyPrice, quotes.SellQuantity, quotes.BuyQuantity, quotes.SellAmount, quotes.BuyAmount)); } foreach (var qe in Retrieve.QuotesEnumerable) { foreach (var quotes in qe.Value) { if (quotes.Price != null && quotes.Volume != null) { SendDatum?.Invoke(this, new Datum(quotes.Time, quotes.Price, quotes.Volume)); continue; } SendQuotes?.Invoke(this, new Quotes(quotes.Time, quotes.SellPrice, quotes.BuyPrice, quotes.SellQuantity, quotes.BuyQuantity, quotes.SellAmount, quotes.BuyAmount)); } } if (games.Count > 0 && SetStatisticalStorage(games) == false) { Message = new Secret().Message; } } else { foreach (var kv in Retrieve.Charts) { foreach (var chart in kv.Value) { SendDatum?.Invoke(this, new Datum(chart.Date, chart.Price, chart.Volume)); } } if (Charts.Count > 0 && SetBasicChart(Charts) && games.Count > 0 && SetStatisticalBulkStorage(games) == false) { Message = new Secret().Message; } } return(statement == null ? 0 : statement.Count); }
public Trading(ConnectXingAPI api, Specify specify, Queue <Chart> charts) { this.specify = specify; Short = new Stack <double>(512); Long = new Stack <double>(512); SendDatum += Analysize; foreach (Chart chart in charts) { SendDatum?.Invoke(this, new Datum(chart)); } SendDatum -= Analysize; this.api = api; OnTime = true; api.SendDatum += Analysize; }
public Trading(ConnectXingAPI api, Specify specify, Quotes quotes, Queue <Chart> charts) { this.specify = specify; Short = new Stack <double>(512); Long = new Stack <double>(512); SendDatum += Analysize; foreach (Chart chart in charts) { SendDatum?.Invoke(this, new Datum(chart)); } SendDatum -= Analysize; this.api = api; this.quotes = quotes; Check = string.Empty; api.SendDatum += Analysize; }
private void OnReceiveRealData(object sender, _DKHOpenAPIEvents_OnReceiveRealDataEvent e) { sb = new StringBuilder(512); int index = Array.FindIndex(Enum.GetNames(typeof(IRealType.RealType)), o => o.Equals(e.sRealType)); foreach (int fid in type.Catalog[index]) { sb.Append(axAPI.GetCommRealData(e.sRealKey, fid)).Append(';'); } switch (index) { case 1: if (e.sRealKey.Substring(0, 3).Equals("101")) { SendDatum?.Invoke(this, new Datum(sb)); } break; case 5: string[] find = sb.ToString().Split(';'); OptionsCalling[e.sRealKey] = double.Parse(find[1].Contains("-") ? find[1].Substring(1) : find[1]); break; case 7: if (sb.ToString().Substring(0, 1).Equals("e") && DeadLine == false) { DeadLine = true; Delay.delay = 4150; if (RemainingDate.Equals(DateTime.Now.ToString("yyyyMMdd"))) { Squence = 0; axAPI.SetRealRemove("ALL", axAPI.GetFutureCodeByIndex(1)); RemainingDay(axAPI.GetFutureCodeByIndex(0)); TimerBox.Show("Futures Options Expiration Date.\n\nThe Data can be Mixed.", "Caution", MessageBoxButtons.OK, MessageBoxIcon.Exclamation, 7651); } Request(Code[0].Substring(0, 8)); new TheOld().ForsakeOld(Path.Combine(Application.StartupPath, @"..\Log\")); } break; } }
void OnReceiveRealData(object sender, _DKHOpenAPIEvents_OnReceiveRealDataEvent e) { var sb = new StringBuilder(512); int index = Array.FindIndex(Enum.GetNames(typeof(RealType)), o => o.Equals(e.sRealType)); if (index < 0) { return; } foreach (int fid in catalogReal[index]) { sb.Append(API.GetCommRealData(e.sRealKey, fid)).Append(';'); } var param = sb.ToString().Split(';'); switch (index) { case 0b1: if (e.sRealKey.Equals(Code)) { SendDatum?.Invoke(this, new Datum(param)); SendTrend?.Invoke(this, new Trends(Trend, Volume)); } return; case 0b10: if (e.sRealKey.Equals(Code)) { SendQuotes?.Invoke(this, new Quotes(new string[] { param[35], param[27], param[19], param[11], param[3], param[7], param[15], param[23], param[31], param[39] }, new string[] { param[36], param[28], param[20], param[12], param[4], param[8], param[16], param[24], param[32], param[40] }, new string[] { param[38], param[30], param[22], param[14], param[6], param[10], param[18], param[26], param[34], param[42] }, param[0], SellOrder, BuyOrder, string.Concat(param[44], ";", param[47]))); } return; case 0b1000: if (e.sRealKey.Equals(Code)) { SendCurrent?.Invoke(this, new Current(Quantity, param)); } return; case 0b1001: if (param[0].Equals("e") && DeadLine) { DeadLine = false; if (Temporary != null) { Temporary.SetStorage(Code); SendCount?.Invoke(this, new NotifyIconText(-106)); } else { OnReceiveBalance = false; } } else if (param[0].Equals("3") && DeadLine == false) { DeadLine = true; Delay.Milliseconds = 205; if (Temporary == null || Collector) { OnReceiveBalance = true; } } break; case 0xA: SendStocksDatum?.Invoke(this, new Stocks(e.sRealKey, param)); return; case 0xB: SendStocksQuotes?.Invoke(this, new StocksQuotes(e.sRealKey, param[0b100]));