static void client_Advise(object sender, DdeAdviseEventArgs e) { Quote quote = new Quote(e.Text); beat.Add(quote); string log = string.Format("{0} {1} {2} {3} {4}", e.Text, beat.DeltaBid, beat.DeltaAsk, beat.MaxUp, beat.MaxDown); writer.WriteLog(log); //Console.WriteLine("Bid: {0} Ask: {1} Spread : {2}", quote.Bid, quote.Ask, quote.Spread); Console.WriteLine(beat.DeltaBid > 0 ? "CALL" : "PUT"); Console.WriteLine("Delta Bid : {0}, Ask : {1}", beat.DeltaBid, beat.DeltaAsk); Console.WriteLine("Max Up : {0}, Down : {1}", beat.MaxUp, beat.MaxDown); Console.WriteLine(); }
private void OnAdviseVolume(object sender, DdeAdviseEventArgs args) { log.WriteLine("Volume: " + args.Item + " " + args.Text + " " + getTimeStamp()); }
private static void OnAdvise(object sender, DdeAdviseEventArgs args) { string value = Regex.Replace(args.Text, @"\s", ""); value = value.Replace(Convert.ToChar(0x0).ToString(), ""); if (value.Length > 0) tw.WriteLine("{0}\t{1}\t{2:dd/MM/yyyy HH:mm:ss.fff}", args.Item, value, DateTime.Now); }
private static void OnAdvise(object sender, DdeAdviseEventArgs args) { Console.WriteLine("OnAdvise: " + args.Text); }
void BidKursUpdated_Advise(object sender, DdeAdviseEventArgs e) { var bid = ConvertToDoubleTwoDecimal(e.Text.Substring(0, e.Text.Length - 3)); _kurs.bid = bid; }
void AskKursUpdated_Advise(object sender, DdeAdviseEventArgs e) { var ask = ConvertToDoubleTwoDecimal(e.Text.Substring(0, e.Text.Length - 3)); _kurs.ask = ask; }
private void OnAdvise(object sender, DdeAdviseEventArgs args) { //========================================================================================= //Log(args.Item + " " + args.Text); // get the DDE feed string[] fxData = (args.Item + " " + args.Text).Split(new char[] { ' ' }); Tick tick = null; try{ tick = new Tick() { //EURUSD 2014/05/06 23:59 1.34455 1.34456 symbol = fxData[0], date = DateTime.Parse(fxData[1] + " " + fxData[2]), bid = double.Parse(fxData[3]), ask = double.Parse(fxData[4]) }; } catch(Exception) { Log("Invalid tick data"); } //-- Log Price -- works -- prints bid price for All symbol // Log(fxData[3]); Double checked July 2014 - so data is local and present here, //------------- //------------------------------------------------ // Bind Data // chart1.Series["Series1"].Points.DataBindXY(fxData[1], fxData[3]); // chart1.Series["Series1"].Points.DataBindXY(fxData[2], fxData[3]); // chart1.Series["Series1"].Points.DataBind(dataSource, fxData[2], fxData[3],); // string xVal = fxData[2];// Hours:Minutes == 23:59 // string YVal = fxData[3]; // chart1.Series["Series1"].Points.DataBindXY(xVal, YVal); // chart1.Series["Series1"].Points.AddXY(xVal, YVal); // chart1.Series[0].Points.AddXY(date, bid); //--------------------------------------------------- // create data source if(tick != null) { if (dataSource.ContainsKey(tick.symbol)) { dataSource[tick.symbol].Insert(0, tick.bid); // Log(tick.bid); } else { dataSource.Add(tick.symbol, new List<double>(){ tick.bid }); } if (OnTick != null) { OnTick.Invoke(tick); } } //------------------------------ }
private void client_Advise(object sender, DdeAdviseEventArgs args) { DdeClient dc = (DdeClient)sender; string key = dc.Service + "|" + dc.Topic + "!" + args.Item; //取得 key 所對應位置的 DataGridViewRow DataGridViewRow chg_value_row = (DataGridViewRow)ht_gdv[key]; //將變動的值指定至該列所在的欄位 "Item_Value" int codepage = Encoding.Default.CodePage; //取得編碼的 codpage. 中文 Default: 950 string data = Encoding.GetEncoding(codepage).GetString(args.Data, 0, args.Data.Length); //顯示變動後的 Item 值. chg_value_row.Cells["col_iteminfo_value"].Value = data; }
private void OnAdvise(object sender, DdeAdviseEventArgs args) { Double tmp = Convert.ToDouble(args.Text.Trim()); AssetValue = Convert.ToInt32(tmp); String value = Convert.ToString(tmp); if (this.Visible) SetControlPropertyThreadSafe(label1, "Text", value); }
private void client_Advise(object sender, DdeAdviseEventArgs args) { displayTextBox.Text = "OnAdvise: " + args.Text; }