FixAlchemy.FixHelpers (FIXAlchemy v0.2.4)

View Source

Macros and helpers for working with FIX messages using symbolic field names.

Provides compile-time translation of field names to tag numbers for performance.

Summary

Functions

Get a field value from a FIX message map using symbolic name.

Build a map with symbolic field names that get translated to tag numbers.

Translate a field name to its tag number at compile time.

Functions

fix_get(map, field_name)

(macro)

Get a field value from a FIX message map using symbolic name.

Examples

fix_get(msg, :Account)
fix_get(msg, :CashOutstanding)

fix_map(map_ast)

(macro)

Build a map with symbolic field names that get translated to tag numbers.

Examples

fix_map(%{
  balance: fix_get(collateral, :CashOutstanding),
  equity: fix_get(collateral, :EndCash),
  account_id: fix_get(collateral, :Account)
})

fix_tag(field_name)

(macro)

Translate a field name to its tag number at compile time.

Examples

fix_tag(:Account)        # => 1
fix_tag(:CashOutstanding) # => 901
fix_tag(:EndCash)        # => 922