Skip to content

Instantly share code, notes, and snippets.

@ssanderson
ssanderson / tsc_gen.py
Created August 1, 2012 01:36
top-level draft of trade_simulation_client generator
from zipline.gens import stateful_transform
from zipline.finance.trading import TransactionSimulator
from zipline.finance.performance import PerformanceTracker
def trade_simulation_client(stream_in, algo, environment, sim_style):
"""
Generator that takes the expected output of a merge, a user
algorithm, a trading environment, and a simulator style as
arguments. Pipes the merge stream through a TransactionSimulator
and a PerformanceTracker, which keep track of the current state of
@ssanderson
ssanderson / tsc_gen.py
Created July 31, 2012 22:16
tentative top-level design for TSC
from zipline.gens import stateful_transform
from zipline.finance.trading import TransactionSimulator
from zipline.finance.performance import PerformanceTracker
def trade_simulation_client(stream_in, algo, environment, sim_style):
#============
# Algo Setup
#============
@ssanderson
ssanderson / queueoverview.txt
Created June 13, 2012 17:31
Qexec Queue and Server Flavors
Flavors of queues in Qexec system topology:
|| Queue type: || Receives new tasks from: || Routes tasks to: ||
--------------------------------------------------------------------------------------------------------------
|| LQueue || http PUT requests (via WSGI app) || RQueue (via ZMQ socket) ||
|| RQueue || polls an LQueue for new tasks (via ZMQ socket) || Arbiter instances (via gevent queues)||
|| MQueue || http PUT requests (via WSGI app) || Arbiter instances (via gevent queues)||
Flavors of servers:
@ssanderson
ssanderson / multiply.py
Created June 7, 2012 20:08
zmq node chain test
#Midpoint for zmq node chain test. Receives a message
#via SUB socket, then propagates that message out via
#PUB socket to sink nodes.
import zmq
context = zmq.Context()
receiver = context.socket(zmq.SUB)
receiver.connect("tcp://localhost:5555")