public Ticket OrderSend(Symbol symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment, int magic, MT4DateTime expiration, MT4Color arrow_color) { int number = mt4.OrderSend(symbol.symbol, cmd, volume, price, slippage, stoploss, takeprofit, comment, magic, expiration, arrow_color); if(number != -1) { Ticket ticket = new Ticket() { Number = number, Cmd = cmd == 0 ? "Ask" : "Bid", Symbol = symbol, date = DateTime.Now, Rate = cmd == 0 ? this.GetAsk(symbol) : this.GetBid(symbol), Status = Ticket.TicketStatus.STATUS_ORDERED}; this.orderTicketList.Add(ticket); return ticket; } else { return null; } }
public void UpdateRateSymbol(Symbol symbol) { symbol.ask = this.GetAsk(symbol); symbol.bid = this.GetBid(symbol); }
public double GetAsk(Symbol symbol) { return mt4.MarketInfo(symbol.symbol, 10); }
public double GetBid(Symbol symbol) { return mt4.MarketInfo(symbol.symbol, 9); }
public void ChangeSymbol(Symbol symbol) { currentSymbol = symbol; Clear(); }
public void Start(Symbol symbol) { this.ChangeSymbol(symbol); this.Start(); }