FIX API Reference¶
Fix¶
Fix Session¶
- class nasdaq_protocols.fix.session.FixSessionId(host='nohost', port=0, username='nouser')¶
Bases:
SessionId
- Parameters:
host (str)
port (int)
username (str)
- class nasdaq_protocols.fix.session.FixSession(on_msg_coro=None, on_close_coro=None, session_id=NOTHING, dispatch_on_connect=False, *, sequence=1, client_heartbeat_interval=1, server_heartbeat_interval=1)¶
Bases:
AsyncSession
- Parameters:
on_msg_coro (Callable[[Any], Awaitable[None]])
on_close_coro (Callable[[], Coroutine])
session_id (FixSessionId)
dispatch_on_connect (bool)
sequence (Iterator[int])
client_heartbeat_interval (int)
server_heartbeat_interval (int)
- on_msg_coro: Callable[[Any], Awaitable[None]]¶
- on_close_coro: Callable[[], Coroutine]¶
- sequence: Iterator[int]¶
- client_heartbeat_interval: int¶
- server_heartbeat_interval: int¶
- session_id: FixSessionId¶
- dispatch_on_connect: bool¶
- sender_comp_id: str¶
- sender_sub_id: str¶
- target_comp_id: str¶
- abstract begin_string()¶
- send_msg(msg)¶
Send a message to the peer. :param msg: Any message that is serializable.
- Parameters:
msg (Message)
- Return type:
None
- async send_heartbeat()¶
Callback to send a heartbeat to the peer. :meta private:
- log = <Logger FixSession (WARNING)>¶
- class nasdaq_protocols.fix.session.Fix44Session(on_msg_coro=None, on_close_coro=None, session_id=NOTHING, dispatch_on_connect=False, *, sequence=1, client_heartbeat_interval=1, server_heartbeat_interval=1)¶
Bases:
FixSession
- Parameters:
on_msg_coro (Callable[[Any], Awaitable[None]])
on_close_coro (Callable[[], Coroutine])
session_id (FixSessionId)
dispatch_on_connect (bool)
sequence (Iterator[int])
client_heartbeat_interval (int)
server_heartbeat_interval (int)
- begin_string()¶
- class nasdaq_protocols.fix.session.Fix50Session(on_msg_coro=None, on_close_coro=None, session_id=NOTHING, dispatch_on_connect=False, *, sequence=1, client_heartbeat_interval=1, server_heartbeat_interval=1)¶
Bases:
FixSession
- Parameters:
on_msg_coro (Callable[[Any], Awaitable[None]])
on_close_coro (Callable[[], Coroutine])
session_id (FixSessionId)
dispatch_on_connect (bool)
sequence (Iterator[int])
client_heartbeat_interval (int)
server_heartbeat_interval (int)
- begin_string()¶
Fix Messages¶
- class nasdaq_protocols.fix.core.FixSerializable¶
Bases:
Serializable
- class nasdaq_protocols.fix.core.MessageSegments(value)¶
Bases:
Enum
An enumeration.
- class nasdaq_protocols.fix.core.Field(value)¶
Bases:
FixSerializable
- to_bytes()¶
pack the object to binary format.
- Return type:
tuple[int, bytes]
- class nasdaq_protocols.fix.core.DataSegment(values=NOTHING)¶
Bases:
FixSerializable
- Parameters:
values (dict[int, FixSerializable])
- to_bytes()¶
pack the object to binary format.
- Return type:
tuple[int, bytes]
- classmethod from_bytes(bytes_)¶
unpack the object from binary format.
- Parameters:
bytes_ (bytes)
- Return type:
tuple[int, type[DataSegment] | DataSegment]
- class nasdaq_protocols.fix.core.GroupContainer(values=None, count=0)¶
Bases:
FixSerializable
- Parameters:
values (list[Group] | None)
count (int)
- to_bytes()¶
pack the object to binary format.
- Return type:
tuple[int, bytes]
- classmethod from_bytes(bytes_)¶
unpack the object from binary format.
- Parameters:
bytes_ (bytes)
- Return type:
tuple[int, type[GroupContainer] | GroupContainer]
- class nasdaq_protocols.fix.core.Group(values=NOTHING)¶
Bases:
DataSegment
- Parameters:
values (dict[int, FixSerializable])
- to_bytes()¶
pack the object to binary format.
- Return type:
tuple[int, bytes]
- class nasdaq_protocols.fix.core.Message(data=None)¶
Bases:
FixSerializable
- Parameters:
data (dict[MessageSegments, Any])
- to_bytes()¶
pack the object to binary format.
- Return type:
tuple[int, bytes]