What is FIX API? Why is FIX API helpful?
FIX API. FIX is the so-called Financial Information eXchange (FIX) protocol. It is a message-based standard for the …
This is a callback function to receive streaming quote messages once the market movements change.
It can be triggered after a subscription request message for the streaming quotes is sent.
Usually, it’s a notification when a message describing the incremental refresh(the market data’ updates) arrives.
The message type (MsgType, Tag ID: 35) is “X”. Actually, this tag field is encapsulated, only useful when you check the log file.
We will get these tag fields from the message:
SendingTime sendingTime = new SendingTime();
((Message) snapshot).getHeader().getField(sendingTime);
LocalDateTime localDateTime = sendingTime.getValue();
long time = localDateTime.toEpochSecond(ZoneOffset.UTC);
NoMDEntries noMDEntries = new NoMDEntries();
snapshot.get(noMDEntries);
for (int i = 1; i <= noMDEntries.getValue(); i++) {
MarketDataSnapshotFullRefresh.NoMDEntries types = new MarketDataSnapshotFullRefresh.NoMDEntries();
snapshot.getGroup(i, types);
// ...
}
String symbolName = types.getString(Symbol.FIELD);
This is an enumeration variable to describe that the tick quote stands for Ask(Offer) or Bid.
This variable stands for the current tick quote.
MDEntryType mdEntryType = new MDEntryType();
MDEntryPx mdEntryPx = new MDEntryPx();
types.get(mdEntryType);
double bid = 0.0;
if (mdEntryType.getValue() == MDEntryType.BID) {
types.get(mdEntryPx);
bid = mdEntryPx.getValue();
}
double ask = 0.0;
if (mdEntryType.getValue() == MDEntryType.OFFER) {
types.get(mdEntryPx);
ask = mdEntryPx.getValue();
}
MarketDataSnapshotFullRefresh is a message to receive one symbol’s quotes(including the bid price and the ask price).
MarketDataIncrementalRefresh is a message including all the updates of multiple symbols.
The received messages will output to the “datalog” folder.
If you want to parse them, please use Fintechee Online FIX Parser.
If you want to trade via FIX API, please use Fintechee FIX API Trading Platform Individual Version(Paid Version).
If you have a Github / Youtube account, you can get a free license for the paid version(No Charge)!
If you have no Github / Youtube account, you can still use Fintechee FIX API Trading Platform Bridge Version(Free Forever)!
If you are working for financial institutions, you can choose Fintechee FIX API Trading Platform Institution Version(White Label License).
Please access our Github repository to get the latest source codes.
public void onMessage(MarketDataIncrementalRefresh snapshot, SessionID sessionID) {
try {
SendingTime sendingTime = new SendingTime();
((Message) snapshot).getHeader().getField(sendingTime);
LocalDateTime localDateTime = sendingTime.getValue();
long time = localDateTime.toEpochSecond(ZoneOffset.UTC);
NoMDEntries noMDEntries = new NoMDEntries();
snapshot.get(noMDEntries);
for (int i = 1; i <= noMDEntries.getValue(); i++) {
MarketDataSnapshotFullRefresh.NoMDEntries types = new MarketDataSnapshotFullRefresh.NoMDEntries();
snapshot.getGroup(i, types);
String symbolName = types.getString(Symbol.FIELD);
MDEntryType mdEntryType = new MDEntryType();
MDEntryPx mdEntryPx = new MDEntryPx();
types.get(mdEntryType);
double bid = 0.0;
if (mdEntryType.getValue() == MDEntryType.BID) {
types.get(mdEntryPx);
bid = mdEntryPx.getValue();
}
double ask = 0.0;
if (mdEntryType.getValue() == MDEntryType.OFFER) {
types.get(mdEntryPx);
ask = mdEntryPx.getValue();
}
System.out.println(time + " " + symbolName + ": Ask " + ask + ", Bid " + bid);
}
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
FIX API. FIX is the so-called Financial Information eXchange (FIX) protocol. It is a message-based standard for the …
This is the FIX API Starter Application Class. It includes: A method to be called to start FIX API Data session A method …
We offer professional FIX API consulting services, including self-service options for establishing a broker business. There are no additional fees, and all resources can be utilized without any associated costs.
Book One