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 …
These are the basic components for FIX API Data class.
It includes:
private boolean resetReq;
String mdReqID;
private String userName;
private String userPassword;
private String accountId;
private long requestID;
private SessionID sessionID;
List<String> symbolsList;
resetReq is used to configure whether to reset sequence number once reconnected. mdReqID is used to store the ID of a new subscription to streaming quotes. It will be used when you unsubscribe from the streaming quotes. nextID is used to generate a new unique ID.
public Data(SessionSettings settings, boolean resetReq) {
this.resetReq = resetReq;
try {
userName = settings.getString("Username");
userPassword = settings.getString("Password");
accountId = settings.getString("AccountId");
symbolsList = new ArrayList<String>();
symbolsList.add("EUR/USD");
symbolsList.add("EUR/GBP");
symbolsList.add("GBP/USD");
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
private synchronized long nextID() {
requestID++;
if (requestID > 0x7FFFFFF0) {
requestID = 1;
}
return requestID;
}
public void fromAdmin(Message message, SessionID sessionID) {
try {
crack(message, sessionID);
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
public void fromApp(Message message, SessionID sessionID) {
try {
crack(message, sessionID);
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
public void toAdmin(Message message, SessionID sessionID) {
try {
if (message instanceof Logon) {
logger.info("Data via toAdmin login begun for " + this.userName);
message.setString(Username.FIELD, userName);
message.setString(Password.FIELD, userPassword);
if (resetReq) {
message.setBoolean(ResetSeqNumFlag.FIELD, ResetSeqNumFlag.YES_RESET_SEQUENCE_NUMBERS);
}
message.setInt(EncryptMethod.FIELD, EncryptMethod.NONE_OTHER);
} else if (message instanceof Logout) {
logger.info("Data logged out via toAdmin " + this.userName);
}
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
public void toApp(Message message, SessionID sessionID) {
}
public void onCreate(SessionID sessionID) {
this.sessionID = sessionID;
}
public void logout() {
sendMarketDataRequestList(SubscriptionRequestType.DISABLE_PREVIOUS_SNAPSHOT_UPDATE_REQUEST);
Logout mdr = new Logout();
send(mdr);
}
public void onLogon(SessionID sessionID) {
logger.warn("Data via onLogon login begun" + (userName == null ? "" : " for " + userName) );
sendMarketDataRequestList(SubscriptionRequestType.SNAPSHOT_UPDATES);
}
public void onLogout(SessionID sessionID) {
logger.warn("Data logged out via onLogout" + (userName == null ? "" : " for " + userName) );
}
private void send(Message message) {
try {
Session.sendToTarget(message, sessionID);
} catch (Exception e) {
e.printStackTrace();
logger.error(e.getMessage());
}
}
The received messages will output to the “orderlog” 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.
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