public CapitalRequest(string email, TradeLink.AppKit.Results rs) : this(email, rs.ToString()) { SubmittedResults = rs; usingresults = true; result_symbols = rs.Symbols; result = System.Text.RegularExpressions.Regex.Replace(result, "Symbols:.*\n", string.Empty); Source = CapitalRequestSource.TradeLink; }
public override void GotFill(TradeLink.API.Trade fill) { // keep track of position D(fill.symbol + " fill: " + fill.ToString()); _pt.Adjust(fill); // ensure fill comes from this response int idx = _entrysignal.getindex(fill.symbol); if (idx < 0) return; // reset signals if we're flat (allows re-entry) if (_pt[fill.symbol].isFlat) { _entrysignal[fill.symbol] = false; _exitsignal[fill.symbol] = false; } }
public void Subscribe(TradeLink.API.Basket mb) { // save last basket _b = mb; TLSend(MessageTypes.REGISTERSTOCK, Name + "+" + mb.ToString()); }
public void Subscribe(TradeLink.API.Basket mb) { TLSend(MessageTypes.REGISTERSTOCK, Text + "+" + mb.ToString()); }
public override void GotPosition(TradeLink.API.Position p) { // keep track of position D(p.Symbol + " pos: " + p.ToString()); _pt.Adjust(p); }
public override void GotPosition(TradeLink.API.Position pos) { // keep track of position D(pos.symbol + " pos: " + pos.ToString()); track_positions.Adjust(pos); }
public override void GotFill(TradeLink.API.Trade fill) { // keep track of position D(fill.symbol + " fill: " + fill.ToString()); track_positions.Adjust(fill); // ensure fill comes from this response int idx = track_symbols.getindex(fill.symbol); // dimon: imho this is ugly (error prone) method. What if 2 strategies working with same symbol simultaneously? it all will go to hell.. if (idx < 0) return; // reset signals if we're flat (allows re-entry) if (track_positions[fill.symbol].isFlat) { track_symbols[fill.symbol] = false; track_exitsignals[fill.symbol] = false; } }