void execute_gotAccounts(string msg) { debug("accounts: " + msg); if (RequestPositionsOnAccounts) { RequestPositions(msg); } _abuff.Write(msg); }
/// <summary> /// pass new ticks through here to be processed asyncrhomously /// </summary> /// <param name="k"></param> public void newTick(Tick k) { if (k == null) { _nwt++; if (GotBadTick != null) { GotBadTick(); } return; } _tickcache.Write(k); if ((_readtickthread != null) && (_readtickthread.ThreadState == ThreadState.Unstarted)) { _readtick = true; _readtickthread.Start(); } else if ((_readtickthread != null) && (_readtickthread.ThreadState == ThreadState.WaitSleepJoin)) { _tickswaiting.Set(); // signal ReadIt thread to read now } }
/// <summary> /// write an imbalance to buffer for later processing /// </summary> /// <param name="imb"></param> public void newImbalance(Imbalance imb) { if (imb == null) { _niw++; if (GotBadImbalance != null) { GotBadImbalance(); } return; } _imbcache.Write(imb); if ((_readimbthread != null) && (_readimbthread.ThreadState == ThreadState.Unstarted)) { _readimb = true; _readimbthread.Start(); } else if ((_readimbthread != null) && (_readimbthread.ThreadState == ThreadState.WaitSleepJoin)) { // signal ReadIt thread to read now _imbswaiting.Set(); } }
void quote_gotTick(Tick t) { _kbuf.Write(t); _reader.Interrupt(); }
void execute_gotFill(Trade t) { _fbuff.Write(t); _reader.Interrupt(); }
void execute_gotOrder(Order o) { _obuff.Write(o); _reader.Interrupt(); }
void execute_gotOrderCancel(long number) { _cbuff.Write(number); _reader.Interrupt(); }
void execute_gotPosition(Position pos) { _pbuff.Write(pos); }
void execute_gotUnknownMessage(MessageTypes type, long source, long dest, long msgid, string request, ref string response) { _mbuff.Write(new GenericMessage(type, source, dest, msgid, request, response)); }