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 full refresh(the market data’ updates) arrives.
The message type (MsgType, Tag ID: 35) is “W”. 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);
String symbolName = null;
quickfix.field.Symbol symbol = new quickfix.field.Symbol();
snapshot.get(symbol);
symbolName = symbol.getValue();
It just has one symbol’s quote. So, in this group field, there is only one element.
NoMDEntries noMDEntries = new NoMDEntries();
snapshot.get(noMDEntries);
MarketDataSnapshotFullRefresh.NoMDEntries types = new MarketDataSnapshotFullRefresh.NoMDEntries();
snapshot.getGroup(1, types);
// ...
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();
}
MarketDataIncrementalRefresh is a message including all the updates of multiple symbols.
MarketDataSnapshotFullRefresh is a message to receive one symbol’s quotes(including the bid price and the ask price).
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(MarketDataSnapshotFullRefresh snapshot, SessionID sessionID) {
try {
SendingTime sendingTime = new SendingTime();
((Message) snapshot).getHeader().getField(sendingTime);
LocalDateTime localDateTime = sendingTime.getValue();
long time = localDateTime.toEpochSecond(ZoneOffset.UTC);
String symbolName = null;
quickfix.field.Symbol symbol = new quickfix.field.Symbol();
snapshot.get(symbol);
symbolName = symbol.getValue();
NoMDEntries noMDEntries = new NoMDEntries();
snapshot.get(noMDEntries);
MarketDataSnapshotFullRefresh.NoMDEntries types = new MarketDataSnapshotFullRefresh.NoMDEntries();
MDEntryType mdEntryType = new MDEntryType();
MDEntryPx mdEntryPx = new MDEntryPx();
snapshot.getGroup(1, types);
types.get(mdEntryType);
double bid = 0.0;
if (mdEntryType.getValue() == MDEntryType.BID) {
types.get(mdEntryPx);
bid = mdEntryPx.getValue();
}
snapshot.getGroup(2, types);
types.get(mdEntryType);
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