Skip to content
Bharath edited this page Dec 6, 2020 · 19 revisions

OpenTrading

OpenTrading platform runs as a standalone Java process with a set of executors and listeners. It performs trading during weekdays and performs backtesting during weekends.

Action!

Basically, OpenTrading process performs the following.

  1. Starts at market open
  2. Receives market data from a data provider
  3. Consumes or calculates market technicals
  4. Executes trades (on Stocks/Options) for intraday/short/long term, based on various market strategies on a virtual/real account
  5. Closes positions, when SL (Stop Loss) or target is met
  6. Calculates P/L and stores trade performance
  7. Performs backtesting
  8. Persists data and transactions
  9. Generates reports
  10. Sends notifications

Modules

Note: Modules and it's names are not that final and we will be refining and redefining them in the days to come

1. Boot (Application/Process/Service)

Purpose: Bootstraps OpenTrading platform.
Repo Style: Poly

Parent: Defines spec for OpeTrading platform

  • open-trading-core

Children: Implement the parent

  • open-trading-alpaca
  • open-trading-tdameritrade
  • open-trading-tastyworks
  • open-trading-zerodha
  • open-trading-ibkr

2. Persistence (Dependency)

Purpose: Persists data across the platform.
Repo Style: Mono (Multi modules)

Repo:

  • open-trading-persistence

Dependency: Defines persistence spec

  • open-trading-persistence-core

Dependents: Implement the dependency

  • open-trading-persistence-postgresql
  • open-trading-persistence-s3

3. Data (Dependency)

Purpose: Pulls market data from data providers.
Repo Style: Mono (Multi modules)

Repo:

  • open-trading-data

Dependency: Defines spec for connecting, streaming, requesting market data from data providers

  • open-trading-data-core

Dependents: Implement the dependency

  • open-trading-data-finnhub
  • open-trading-data-yahoo

4. Compute (Dependency)

Purpose: Computes market technicals required for technical analysis.
Repo Style: Mono

Repo:

  • open-trading-compute

5. Strategy (Dependency)

Purpose: Defines strategies.
Repo Style: Mono

Repo:

  • open-trading-strategy

6. Oracle (Dependency)

Purpose: Analyzes market technicals. Executes strategies. Generates signals for opening trades.
Repo Style: Mono

Repo:

  • open-trading-oracle

7. Executor (Dependency)

Purpose: Receives trade signals and opens/closes trades.
Repo Style: Mono

Repo:

  • open-trading-executor

8. Watchdog (Dependency)

Purpose: Tracks executed trades and generates signals for closing trades.
Repo Style: Mono

Repo:

  • open-trading-watchdog

9. Simulator (Service)

Purpose: Simulates market data.
Repo Style: Mono

Repo:

  • open-trading-simulator

10. Backtest (Process/Service)

Purpose: Processes historical data and backtests strategies.
Repo Style: Mono

Repo:

  • open-trading-backtest

11. Report (Process/Service)

Purpose: Processes persisted data and generates reports for visualizing trade performance.
Repo Style: Mono

Repo:

  • open-trading-report

12. Mailer (Service)

Purpose: Receives/Generates and sends notifications.
Repo Style: Mono (Multi modules)

Repo:

  • open-trading-mailer

Dependency: Defines mailer spec

  • open-trading-mailer-core

Dependents: Implement the dependency

  • open-trading-mailer-email
  • open-trading-mailer-sms

13. Aspect (Dependency)

Purpose: Focuses on aspects like logging and auditing.
Repo Style: Mono

Repo:

  • open-trading-aspect

14. Facade (Service)

Purpose: Acts as a gateway between UI client and services.
Repo Style: Poly

Parent: Defines facade spec

  • open-trading-facade-core

Children: Implement the parent

  • open-trading-facade-boot
  • open-trading-facade-simulator
  • open-trading-facade-report
  • open-trading-facade-mailer

15. UI (Client)

Purpose: Interacts with services and helps controlling, managing and visualizing data and reports.
Repo Style: Poly

Parent: Defines view spec

  • open-trading-glass-core

Children: Implement the parent

  • open-trading-glass-platform
  • open-trading-glass-simulator
  • open-trading-glass-report
  • open-trading-glass-mailer