Ejemplo n.º 1
0
Archivo: mux.py Proyecto: smandy/pyfix
 def __init__(self, mux):
     FIXApplication.__init__(self, fix)
     self.mux = mux
     self.dispatchDict = {fix.OrderSingle: self.onOrder,
                          fix.Heartbeat: self.noop}
     self.recovery_dict = {fix.ExecutionReport: self.onRecoveredExecution,
                          fix.OrderSingle: self.onRecoveredOrder,
                          fix.ResendRequest: self.noop,
                          fix.Heartbeat: self.noop,
                          fix.Logon: self.noop}
     self.orders = 0
     self.execs = 0
Ejemplo n.º 2
0
    def __init__(self, fix):
        FIXApplication.__init__(self, fix)
        self.dispatch_dict = {
            fix.ExecutionReport: self.on_execution,
            fix.Heartbeat: beep
        }

        self.recovery_dict = {
            fix.ExecutionReport: self.recovered_execution,
            fix.Heartbeat: self.noop,
            fix.Logon: self.noop,
            fix.OrderSingle: self.on_recovered_new_order_single,
        }
Ejemplo n.º 3
0
    def __init__(self, fix):
        FIXApplication.__init__(self, fix)
        self.dispatch_dict = {
            fix.ExecutionReport: self.on_execution,
            fix.Heartbeat: beep
        }

        self.recovery_dict = {
            fix.ExecutionReport: self.recovered_execution,
            fix.Heartbeat: self.noop,
            fix.Logon: self.noop,
            fix.OrderSingle: self.on_recovered_new_order_single,
        }
Ejemplo n.º 4
0
    def __init__(self, fix):
        FIXApplication.__init__(self, fix)
        self.dispatchDict = {fix.Heartbeat: self.onHeartbeat}
        self.testRequests = {}
        self.latencies = defaultdict(lambda: DelayData())

        #frequncies = [ 1., 10, 30, 50, 75, 100, 110, 120, 130, 140, 150, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270 ]

        frequencies = range(10, 300, 5)
        self.delays = [1. / x for x in frequencies]

        #self.delays = [ 0.0005, 0.0001]

        self.delay = self.delays.pop(0)
        self.stopped = False
Ejemplo n.º 5
0
    def __init__(self, fix):
        FIXApplication.__init__(self, fix)
        self.dispatchDict = { fix.Heartbeat : self.onHeartbeat }
        self.testRequests = {}
        self.latencies = defaultdict( lambda: DelayData() )

        #frequncies = [ 1., 10, 30, 50, 75, 100, 110, 120, 130, 140, 150, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270 ]

        frequencies = range( 10, 300, 5)
        self.delays = [ 1./x for x in frequencies]
        
        #self.delays = [ 0.0005, 0.0001]

        self.delay = self.delays.pop(0)
        self.stopped = False
Ejemplo n.º 6
0
    def __init__(self, session_manager, fix, config):
        self.session_manager = session_manager
        self.protocol = None
        self.fix = fix
        self.sender = config.sender
        self.target = config.target
        self.sender_compid = fix.SenderCompID(self.sender)
        self.target_compid = fix.TargetCompID(self.target)
        self.begin_string = fix.BeginString(fix.version)
        self.out_msg_seq_num = 1
        self.in_msg_seq_num = 1
        self.set_persister(
            BerkeleyPersister(config.persistRoot, self.sender, self.target))
        self.heartbeat_interval = config.heartbeatInterval
        # Why do we need an sp?
        self.sp = SynchronousParser(self.fix)
        self.last_by_type = {}
        self.state = None
        if config.app:
            self.set_app(config.app)
        else:
            self.set_app(FIXApplication(fix))

        self.on_integrity_exception = None
        self.last_integrity_exception = None
        self.want_to_be_logged_in = True
Ejemplo n.º 7
0
 def __init__(self):
     FIXApplication.__init__(self, fix)
     self.dispatch_dict = {fix.OrderSingle: self.on_order}
Ejemplo n.º 8
0
 def __init__(self, f):
     FIXApplication.__init__(self, f)
     self.dispatch_dict = {
         f.OrderSingle: self.on_order,
         f.Heartbeat: boop
     }
Ejemplo n.º 9
0
 def __init__(self, f):
     FIXApplication.__init__(self, f)
     self.dispatch_dict = {f.OrderSingle: self.on_order, f.Heartbeat: boop}
Ejemplo n.º 10
0
 def __init__(self):
     FIXApplication.__init__(self, fix)
     self.dispatch_dict = {fix.OrderSingle: self.on_order}
Ejemplo n.º 11
0
 def __init__(self, onHeartbeat, onStateChange):
     FIXApplication.__init__(self, fix)
     self.dispatchDict = { fix.Heartbeat : self.onHeartbeat }
     self.heartBeatDelegate = onHeartbeat
     self.stateDelegate = onStateChange
Ejemplo n.º 12
0
 def __init__(self, onHeartbeat, onStateChange):
     FIXApplication.__init__(self, fix)
     self.dispatchDict = {fix.Heartbeat: self.onHeartbeat}
     self.heartBeatDelegate = onHeartbeat
     self.stateDelegate = onStateChange