Git Product home page Git Product logo

taohansens / fix-trading-simulator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from felipewind/fix-trading-simulator

0.0 0.0 0.0 1.87 MB

A trading simulator between a Broker and a Stock Exchange using the Financial Information eXchange (FIX) Protocol. It's a study project using QuickFIX/J, Quarkus, Angular, Docker, Docker Compose and PostgreSQL.

License: MIT License

Shell 0.94% Java 58.68% TypeScript 21.81% CSS 1.69% HTML 16.83% Dockerfile 0.05%

fix-trading-simulator's Introduction

Fix Trading Simulator

Overview

A trading simulator between a Broker and a Stock Exchange using the Financial Information eXchange (FIX) Protocol. It's a study project using QuickFIX/J, Quarkus, Angular, Docker, Docker Compose and PostgreSQL.

If you want to participate on this project, just open an issue and we can talk about!

Both Broker and Exchange systems were built with Quarkus on the back-end and Angular on the front-end.

The back-ends communicate each other with QuickFIX/J and each has a schema into the PostgreSQL.

Each Angular front-end communicates with the Quarkus back-end using REST and Websockets.

System Architecture

image

Project Structure

Broker back-end

Broker front-end

Exchange back-end

Exchange front-end

Documentation

Features

Orders

You can submit, negotiate, cancel and list your orders.

It's possible to set the Exchange to automatically negotiate the orders.

Every change in the orders are broadcasted using websockets and are imeaditelly updated on the front-end.

Session

Make logon and logout.

View the session status and storage.

View the session configuration.

List the messages sent from the session.

Logs

List the FIX events.

List the messages received and sent.

Running the project

With docker-compose

After start, access project at:

The containers should be running like this:

docker ps
CONTAINER ID        IMAGE                               COMMAND                  CREATED             STATUS              PORTS                    NAMES
8191a0fcde2f        felipewind/exchange-front-end:1.0   "/docker-entrypoint.…"   16 minutes ago      Up 16 minutes       0.0.0.0:90->80/tcp       exchange-front-end
1178d4e1c02f        felipewind/broker-front-end:1.0     "/docker-entrypoint.…"   16 minutes ago      Up 16 minutes       0.0.0.0:80->80/tcp       broker-front-end
2370c47d0a2d        felipewind/broker-back-end:1.0      "/deployments/run-ja…"   16 minutes ago      Up 16 minutes       0.0.0.0:8080->8080/tcp   broker-back-end
8106b9a48217        felipewind/exchange-back-end:1.0    "/deployments/run-ja…"   16 minutes ago      Up 16 minutes       0.0.0.0:8090->8090/tcp   exchange-back-end
6b53a07b72ac        postgres                            "docker-entrypoint.s…"   16 minutes ago      Up 16 minutes       0.0.0.0:5432->5432/tcp   fix-trading-simulator_postgresql-qfj_1

Using the Docker Hub Images

Inside the root folder of the project, execute:

$ chmod +x ./run-from-docker-hub.sh
$ ./run-from-docker-hub.sh

Docker Hub images:

Building the Docker images locally

Inside the root folder of the project, execute:

$ chmod +x ./run-with-local-build.sh
$ ./run-with-local-build.sh

After the first build, you can use the run-after-local-build script.

Without docker-compose

The default version of the development back-end projects is using H2 data base (in memory).

It's possible to change the application.properties and set them to run with PostgreSQL, in this case you should start a PostgreSQL container:

docker run -d --name postgres-qfj -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=postgres postgres

Enter inside the exchange-back-end folder and type:

$ ./mvnw compile quarkus:dev -Ddebug=5006

Access http://localhost:8090/q/swagger-ui/

Enter inside the broker-back-end folder and type:

$ ./mvnw compile quarkus:dev

Access http://localhost:8080/q/swagger-ui/

Enter inside the exchange-front-end folder and type:

$ npm install
$ ng serve

Access http://localhost:4300

Enter inside the exchange-back-end folder and type:

$ npm install
$ ng serve

Access http://localhost:4200

Images

Session Control

image

Session Properties

image

Session Messages

image

Orders list

Broker

image

Exchange

image

Logs - FIX Events

image

Logs - Messages incoming

image

Broker - Swagger

image

Exchange - Swagger

image

Help Queries

select * from broker.sessions;
select * from broker.messages;
select * from broker.event_log  order by id desc;
select * from broker.messages_log_incoming order by id desc;
select * from broker.messages_log_outgoing order by id desc;

select * from exchange.sessions;
select * from exchange.messages;
select * from exchange.event_log  order by id desc;
select * from exchange.messages_log_incoming order by id desc;
select * from exchange.messages_log_outgoing order by id desc;

fix-trading-simulator's People

Contributors

felipewind avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.