ex_fix v0.1.4 ExFix
Elixir implementation of FIX Session Protocol FIXT.1.1. Currently only supports FIX session initiator (buy side).
Usage
defmodule MyFixApplication do
@behaviour ExFix.FixApplication
require Logger
alias ExFix.Types.Message
alias ExFix.Parser
@msg_new_order_single "D"
def on_logon(fix_session_name, session_pid) do
fields = [] # See examples directory
ExFix.send_message!(session_pid, @msg_new_order_single, fields)
end
def on_message(fix_session_name, msg_type, session_pid, %Message{} = msg) do
Logger.info "Msg received: #{inspect msg = Parser.parse2(msg)}"
end
def on_logout(_fix_session_name), do: :ok
end
ExFix.start_session_initiator("mysession", "SENDER", "TARGET", MyFixApplication,
socket_connect_host: "localhost", socket_connect_port: 9876,
logon_username: "user1", logon_password: "pwd1", transport_mod: :ssl)
Link to this section Summary
Link to this section Functions
Link to this function
send_message!(session_name, msg_type, fields)
send_message!(String.t, String.t, [ExFix.Types.fix_field]) :: :ok
Send FIX message to a session
Link to this function
start_session_initiator(session_name, sender_comp_id, target_comp_id, fix_application, opts \\ [])
Starts FIX session initiator
Link to this function
stop_session(session_name, registry \\ nil)
Stop FIX session