private void metaTrader4_QuoteRecieved(QuoteListener mql) { if (OrderCount != mql.OrdersTotal()) { this.BeginInvoke((MethodInvoker)(() => dataGridView1.Rows.Clear())); for (int i = mql.OrdersTotal() - 1; i >= 0; i--) { if (mql.OrderSelect(i, SELECT_BY.SELECT_BY_POS)) { int orderTicket = mql.OrderTicket(); string orderSymbol = mql.OrderSymbol(); double orderLots = mql.OrderLots(); double orderProfit = mql.OrderProfit(); this.BeginInvoke((MethodInvoker)(() => dataGridView1.Rows.Add(orderTicket, orderSymbol, orderLots, orderProfit, "Close"))); } } } if (HistoryCount != mql.HistoryTotal()) { this.BeginInvoke((MethodInvoker)(() => dataGridView2.Rows.Clear())); for (int i = mql.HistoryTotal() - 1; i >= 0; i--) { if (mql.OrderSelect(i, SELECT_BY.SELECT_BY_POS, POOL_MODES.MODE_HISTORY)) { int orderTicket = mql.OrderTicket(); string orderSymbol = mql.OrderSymbol(); double orderLots = mql.OrderLots(); double orderProfit = mql.OrderProfit(); this.BeginInvoke((MethodInvoker)(() => dataGridView2.Rows.Add(orderTicket, orderSymbol, orderLots, orderProfit))); } } } HistoryCount = mql.HistoryTotal(); OrderCount = mql.OrdersTotal(); double bid = mql.Bid(); double ask = mql.Ask(); this.BeginInvoke((MethodInvoker) (() => BidPrice.Text = "Bid: " + bid.ToString())); this.BeginInvoke((MethodInvoker) (() => AskPrice.Text = "Ask: " + ask.ToString())); }
public QuoteListener() { QuoteListener quoteListener = this; Action <MqlErrorException> action = quoteListener.MqlError + new Action <MqlErrorException>(this.OnMqlError); quoteListener.MqlError = action; }
internal void OnQuote(QuoteListener quoteListener) { while (this._functionsBuffer.Count > 0) this._functionsBuffer.Dequeue()((MqlHandler) quoteListener); if (this.QuoteRecieved == null) return; this.QuoteRecieved(quoteListener); }
internal void OnQuote(QuoteListener quoteListener) { while (this._functionsBuffer.Count > 0) { Action <MqlHandler> action = this._functionsBuffer.Dequeue(); action(quoteListener); } if (this.QuoteRecieved != null) { this.QuoteRecieved(quoteListener); } }
internal void OnQuote(QuoteListener quoteListener) { while (this._functionsBuffer.Count > 0) { this._functionsBuffer.Dequeue()((MqlHandler)quoteListener); } if (this.QuoteRecieved == null) { return; } this.QuoteRecieved(quoteListener); }
private void metaTrader4_QuoteRecieved(QuoteListener mql) { if (OrderCount != mql.OrdersTotal()) { this.Dispatcher.BeginInvoke((Action)(() => { DataGridOpen.Items.Clear(); })); for (int i = mql.OrdersTotal() - 1; i >= 0; i--) { if (mql.OrderSelect(i, SELECT_BY.SELECT_BY_POS)) { int orderTicket = mql.OrderTicket(); string orderSymbol = mql.OrderSymbol(); double orderLots = mql.OrderLots(); double orderProfit = mql.OrderProfit(); var data = new DataGridRowAdd { OrderTicket = orderTicket, Symbol = orderSymbol, Size = orderLots, Profit = orderProfit}; this.Dispatcher.BeginInvoke((Action)(() => { DataGridOpen.Items.Add(data); })); } } } if (HistoryCount != mql.HistoryTotal()) { this.Dispatcher.BeginInvoke((Action)(() => { DataGridHistory.Items.Clear(); })); for (int i = mql.HistoryTotal() - 1; i >= 0; i--) { if (mql.OrderSelect(i, SELECT_BY.SELECT_BY_POS, POOL_MODES.MODE_HISTORY)) { int orderTicket = mql.OrderTicket(); string orderSymbol = mql.OrderSymbol(); double orderLots = mql.OrderLots(); double orderProfit = mql.OrderProfit(); var data = new DataGridRowAdd { OrderTicket = orderTicket, Symbol = orderSymbol, Size = orderLots, Profit = orderProfit}; this.Dispatcher.BeginInvoke((Action)(() => { DataGridHistory.Items.Add(data); })); } } } HistoryCount = mql.HistoryTotal(); OrderCount = mql.OrdersTotal(); double bid = mql.Bid(); double ask = mql.Ask(); this.Dispatcher.BeginInvoke((Action)(() => { BidPrice.Content = "Bid: " + bid.ToString(); })); this.Dispatcher.BeginInvoke((Action)(() => { AskPrice.Content = "Ask: " + ask.ToString(); })); }
private void metaTrader4_QuoteRecieved(QuoteListener mql) { this.BeginInvoke((MethodInvoker) (() => dataGridView1.Rows.Clear())); for (int i = mql.OrdersTotal() - 1; i >= 0; i--) { if (mql.OrderSelect(i, SELECT_BY.SELECT_BY_POS)) { int orderTicket = mql.OrderTicket(); string orderSymbol = mql.OrderSymbol(); double orderLots = mql.OrderLots(); double orderProfit = mql.OrderProfit(); this.BeginInvoke((MethodInvoker) (() => dataGridView1.Rows.Add(orderTicket, orderSymbol, orderLots, orderProfit, "Close"))); } } double bid = mql.Bid(); double ask = mql.Ask(); this.BeginInvoke((MethodInvoker) (() => BidPrice.Text = bid.ToString())); this.BeginInvoke((MethodInvoker) (() => AskPrice.Text = ask.ToString())); }
internal void OnQuote(QuoteListener quoteListener) { while (_functionsBuffer.Count > 0) { Action<MqlHandler> action = _functionsBuffer.Dequeue(); action(quoteListener); } if (QuoteRecieved != null) { QuoteRecieved(quoteListener); } }
public QuoteListener() { QuoteListener quoteListener = this; quoteListener.MqlError += OnMqlError; }
internal static int AccountNumber(this QuoteListener nandler) { string str = nandler.CallMqlMethod("AccountNumber", null); return(Convertor.ToInt(str)); }
internal static string Symbol(this QuoteListener handler) { string str = handler.CallMqlMethod("Symbol", null); return(str); }
internal static int AccountNumber(this QuoteListener nandler) { return(Convertor.ToInt(nandler.CallMqlMethod("AccountNumber", (object[])null))); }
internal static string Symbol(this QuoteListener handler) { return(handler.CallMqlMethod("Symbol", (object[])null)); }
public QuoteListener() { QuoteListener quoteListener = this; quoteListener.MqlError += new Action <MqlErrorException>(this.OnMqlError); }
private void metaTrader4_QuoteRecieved(QuoteListener mql) { }