ticker-beats

module
v0.15.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 17, 2022 License: Apache-2.0

README

Ticker Beats

Disclosure

First of all, this is a POC, so I'm not worried to code the perfect solution. There are not enough unit tests, there is duplicated code, there is a lot of things I usually don't do professionally. My main goal here is to exercise my skills and to have a Portfolio of interesting things.

However, I already started to work on the debts and on the TODO list. I'm planning to have at least 60% of code coverage so that I can automate the building steps which are done manually for now.

Things I'm willing to use here

  • Self-hosted Kubernetes cluster, using Raspberry PIs
  • Use of Google Protobuf
  • Use of some free GCP resources, like Container Registry
  • Automatic building (probably the last thing I gonna do)
  • Self-hosted messaging protocol
  • Self-hosted Datadog alike
  • Self-hosted log ingestion server
  • GRPc protocol
  • My own Health Check solution
  • Redis as a cache for tradings
  • more to be defined...

As you can see, there is a lot of stuff I'm willing to use, probably it's not gonna be the fastest solution, but as I said it's just a funny exercise.

Main Idea

This app will monitor a directory where name-specific logs files will be created which is gonna be parsed into a Protobuf message struct and sent to the server, there the ticker-heart server will process it resulting in new records in the database if needed (record duplication fault-tolerant).

These messages contain deals, orders, positions, accounts info, and trades from a Metatrader 5's Experts Advisors. These robots are not open to the general public neither the code that generates the log files nor the code to manage all the infrastructure needed to handle this Solution.

It can handle multiple accounts and receive duplicated messages, in other words, it's fault-tolerant for duplicated deals, orders, positions, and accounts messages, it's stateless vertical and horizontal scalable microservice.

It's also meant to do more than that, but you'll have to discover it by yourself... :P

Secondary repositories

Building the docker image

docker build -t r6o.co/ticker-beats:latest .

  • vlatest is the image version number, change it as needed.
  • Remove or change mydocker-registry for local images.

Building Executables for Different Architectures

  • Windows: env GOOS=windows GOARCH=amd64 go build server/main.go
  • Linux: env GOOS=linux GOARCH=amd64 go build server/main.go
  • Raspberry Pi: env GOOS=linux GOARCH=arm64 go build server/main.go

Directories

Path Synopsis
internal
api
Package mock_api is a generated GoMock package.
Package mock_api is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL