ticker-heart

module
v0.18.3 Latest Latest
Warning

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

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

README

Ticker Heart

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
  • Work as a Deal Replicator for other accounts
  • 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 is a GRPc Server API that will receive messages from the ticker-beats. 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-heart:latest .

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

$ENV list

  • TICKER_SERVER_PORT: server port
  • TICKER_DATABASE_URL: database connection string

Database connection string

You must define an environment variable to connect to the database

  • Example DSN: user=jack password=secret host=pg.example.com port=5432 dbname=mydb sslmode=verify-ca pool_max_conns=10
  • Example URL: postgres://jack:[email protected]:5432/mydb?sslmode=verify-ca&pool_max_conns=10

Directories

Path Synopsis
internal
api
tickerbeats/beats
package tickerbeats is a generated GoMock package.
package tickerbeats is a generated GoMock package.
tickerbeats/signal/repo
package signalrepo is a generated GoMock package.
package signalrepo is a generated GoMock package.
tickerbeats/signal/service
package signalsvc is a generated GoMock package.
package signalsvc is a generated GoMock package.
transaction/accounts/repo
package accountsrepo is a generated GoMock package.
package accountsrepo is a generated GoMock package.
transaction/accounts/service
package accountssvc is a generated GoMock package.
package accountssvc is a generated GoMock package.
transaction/accountsinfo/repo
package accountsInforepo is a generated GoMock package.
package accountsInforepo is a generated GoMock package.
transaction/accountsinfo/service
package accountsInfosvc is a generated GoMock package.
package accountsInfosvc is a generated GoMock package.
transaction/deals/repo
package dealsrepo is a generated GoMock package.
package dealsrepo is a generated GoMock package.
transaction/deals/service
package dealssvc is a generated GoMock package.
package dealssvc is a generated GoMock package.
transaction/orders/repo
package ordersrepo is a generated GoMock package.
package ordersrepo is a generated GoMock package.
transaction/orders/service
package orderssvc is a generated GoMock package.
package orderssvc is a generated GoMock package.
transaction/positions/repo
package positionsrepo is a generated GoMock package.
package positionsrepo is a generated GoMock package.
transaction/positions/service
package positionssvc is a generated GoMock package.
package positionssvc is a generated GoMock package.
transaction/traderules/repo
package tradeRulesrepo is a generated GoMock package.
package tradeRulesrepo is a generated GoMock package.
transaction/traderules/service
package tradeRulessvc is a generated GoMock package.
package tradeRulessvc is a generated GoMock package.
transaction/tradetransaction/repo
package tradetransactionrepo is a generated GoMock package.
package tradetransactionrepo is a generated GoMock package.
transaction/tradetransaction/service
package tradetransactionsvc is a generated GoMock package.
package tradetransactionsvc is a generated GoMock package.

Jump to

Keyboard shortcuts

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