Skip to content
This repository was archived by the owner on Nov 17, 2022. It is now read-only.
Chris McGee edited this page Feb 10, 2018 · 10 revisions

Titan Wiki

Here you can find more in depth documentation regarding the inner workings of Titan. From a high level, Titan is a framework built on top of ccxt which aims to provide an interface and set of utilities for writing algorithmic strategies. Titan handles the storage, listening, and feed of market data, upon which it provides a structure and interface for combining indicators and buy/sell rules to define strategies. As it currently sits, Titan supports strategies that utilize a single trading pair, exchange, and data resolution combo (i.e. 5m, 1h, or 1d candles). However, future plans include supporting different types of strategies including things like arbitrage, multiple data resolutions, and shifting to a different trading pair dynamically.

Titan Core

Titan's core module contains the basic functionality for keeping in touch with the markets as well as everything database related. This module will be able to run on its own as a headless version of the system once more hooks are added. The core module is able to listen and store market data for any exchange, pair, and time resolution available through ccxt. This is accomplished by the following:

MarketWatcher

The MarketWatcher class defines an object which is responsible for keeping in sync with market data of a specific resolution on a specific exchange, of a specific pair (i.e. GDAX, LTC/BTC, 1h). Each market watcher that is instantiated is an active object that will run on its own thread and keep the database in sync with data from the API for its respective pair/resolution. When it gets a new candle, it will pass it along to the strategies that are subscribed via pypubsub.

ticker.py

The ticker is simply a timer that runs for each data data resolution on its own thread, and notifies market watchers to pull a new candle from their API. Only one ticker for each data resolution will run. These tickers will be automatically started by MarketWatchers as they are created.

Market

The Market class provides functionality for interfacing with an exchange in the context of a strategy. It manages the API keys, provides methods for making orders, and facilitates TA indicators and other market data analysis.

Order

The Order class contains functionality for executing, canceling, and getting status of an order through ccxt, and writing that order to the database.

Position

The Position class is a container for an order which allows custom stop-losses, and profit-target sell points to be applied.

Clone this wiki locally