All Projects → wynfred → presso

wynfred / presso

Licence: GPL-3.0 license
Event-driven backtest/realtime quantitative trading system.

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to presso

reactive-trader
In the coming weeks this plans to become a Gekko plugin that reacts to market changes, finding and running only the most profitable strategies.
Stars: ✭ 91 (+54.24%)
Mutual labels:  trading, strategy, coin
Starquant
a light-weighted, integrated trading/backtesting system/platform(综合量化交易回测系统/平台)
Stars: ✭ 250 (+323.73%)
Mutual labels:  trading, quant, backtest
Rqalpha
A extendable, replaceable Python algorithmic backtest && trading framework supporting multiple securities
Stars: ✭ 4,425 (+7400%)
Mutual labels:  trading, quant, backtest
Crex
A Golang cryptocurrency trading API & Library. Support Binance, BitMEX, Deribit, Bybit, Huobi DM, OKEX Futures and more.
Stars: ✭ 166 (+181.36%)
Mutual labels:  trading, quant, backtest
Vnpy
基于Python的开源量化交易平台开发框架
Stars: ✭ 17,054 (+28805.08%)
Mutual labels:  trading, quant
Wondertrader
WonderTrader——量化研发交易一站式框架
Stars: ✭ 221 (+274.58%)
Mutual labels:  trading, quant
Trading Backtest
A stock backtesting engine written in modern Java. And a pairs trading (cointegration) strategy implementation using a bayesian kalman filter model
Stars: ✭ 247 (+318.64%)
Mutual labels:  trading, backtest
Algotrading
Algorithmic trading framework for cryptocurrencies.
Stars: ✭ 249 (+322.03%)
Mutual labels:  trading, backtest
wtpy
wtpy是基于wondertrader为底层的针对python的子框架
Stars: ✭ 283 (+379.66%)
Mutual labels:  trading, quant
onetoken
1Token Demo & Docs
Stars: ✭ 53 (-10.17%)
Mutual labels:  trading, quant
cryptoquant
An Quantatitive trading library for crypto-assets 数字货币量化交易框架
Stars: ✭ 96 (+62.71%)
Mutual labels:  trading, quant
Devalpha Node
A stream-based approach to algorithmic trading and backtesting in Node.js
Stars: ✭ 217 (+267.8%)
Mutual labels:  trading, backtest
Gekko Backtesttool
Batch backtest, import and strategy params optimalization for Gekko Trading Bot. With one command you will run any number of backtests.
Stars: ✭ 203 (+244.07%)
Mutual labels:  trading, backtest
Cryptotrader
A cryptocurrency trader for all famous exchanges
Stars: ✭ 228 (+286.44%)
Mutual labels:  trading, strategy
Awesome Quant
中国的Quant相关资源索引
Stars: ✭ 2,529 (+4186.44%)
Mutual labels:  trading, quant
Trading Server
A multi-asset, multi-strategy, event-driven trade execution and management platform for running many algorithms/bots at many venues simultaneously with unified risk management and reporting. Uses MongoDB for storage and Telegram for user notifications/trade consent.
Stars: ✭ 191 (+223.73%)
Mutual labels:  trading, backtest
goex backtest
goex orderbook回测, fetch驱动非event驱动的数字货币回测系统
Stars: ✭ 33 (-44.07%)
Mutual labels:  quant, backtest
crypto-trading-engine
Crypto real-time trading engine
Stars: ✭ 19 (-67.8%)
Mutual labels:  trading, quant
Squant
SQuant是使用scala语言编写的量化开发工具箱,提供开箱即用的A股股票数据和外汇数据(docker镜像),以及高效的回测框架与交易模块。方便Java/Scala爱好者进行量化投资研究。 QQ群:281599099,微信公众号:Python量化交易实战。对,我已经转python了。。。
Stars: ✭ 155 (+162.71%)
Mutual labels:  trading, quant
IBATS HuobiTrader old
【停止维护】新版本更新已迁移到 IBATS 项目组对应名称项目中。Auto Backtest Analysis Trade Framework 支持期货、数字货币进行量化交易,集成回测、分析、交易于一体。当前项目主要用于数字货币使用。
Stars: ✭ 21 (-64.41%)
Mutual labels:  quant, backtest

presso

Event-driven backtest/realtime quantitative trading system.

Architecture

Pipeline

DataEvent

  • Raw Data -> DataEvent

DataEvents process raw data and generate events. Raw data can be news, history price, market data, etc. A DataEvent is a numpy array and its first value must be a timestamp. It will be put into a priority queue with the timestamp so all history events for backtesting are ordered by time.

Alpha

  • DataEvent -> Signal (A value from -1 to 1)

Alphas represent trading strategies. An Alpha subscribes to a main_dataevent and has access to other DataEvents. It is triggered when its main_dataevent sends out a new data event. It processes data and calculates a signal which is sent to a handler in Portfolio.

Portfolio

  • Signals -> Transactions

Portfolio is a combination of Alphas. It opens orders according to the signals received, and then sends them to Connectors. It also holds current positions and a list of Transactions.

Connector

  • Transaction -> Execute

Connectors are order executors. A Connector could be an API wrapper of an exchange or a simulator using history data.

Statistics

  • Transactions -> Statistics

Statistics are triggered at the end of program. They will collect information from Transactions and save data, generate visual charts, calculate ratios, etc.

Transaction

Transactions are records that store information through the pipeline. A Transaction is filled by different modules and stored in Portfolio.

EventQueue

EventQueue contains a priority queue and a locking system. DataEvents put events into the EventQueue and wait for its event to be consumed. There will be only one event in EventQueue for every DataEvent, so that all history events are triggered by time.

Manifest

Manifest is a TOML file that defines the structure of a Portfolio and dependencies of modules.

Install and Run

git clone https://github.com/wynfred/presso.git
cd presso
sudo pip3 install .
presso run example/manifest.toml
# Press ENTER to stop DataEvents and run Statistics
# Check presso.log for logs

Dependencies

python3.6
aiohttp
ccxt
numpy
toml

Examples

Alpha

from presso.core.abstract.alpha import AbstractAlpha


class ExampleAlpha(AbstractAlpha):
    def _init(self):
        # TODO
        pass

    async def _calcSignal(self, data):
        # TODO
        pass

    @property
    def name(self):
        return 'Example'

DataEvent

from presso.core.abstract.dataevent import AbstractDataEvent


class ExampleDataEvent(AbstractDataEvent):
    def _init(self):
        # TODO
        pass

    async def _iter(self):
        # TODO
        pass

Portfolio

from presso.core.abstract.portfolio import AbstractPortfolio


class ExamplePortfolio(AbstractPortfolio):
    def _init(self):
        # TODO
        self._positions[TICKER.USD] = 100000
        self._positions[TICKER.BTC] = 0

    def onExampleSignal(self, transaction):
        # TODO
        if transaction.signal > 0 and self._positions[TICKER.USD] > 0:
            transaction.buy = TICKER.BTC
            transaction.sell = TICKER.USD
            transaction.total = self._positions[TICKER.USD] * 0.5
            transaction.operation = OPERATION.MARKET
        self._execute(self._connectors['kline_history'], transaction)

Connector

from presso.core.abstract.connector import AbstractConnector


class ExampleConnector(AbstractConnector):
    def _init(self):
        # TODO
        pass

    async def execute(self, transaction):
        # TODO
        pass

Statistics

from presso.core.abstract.statistics import AbstractStatistics


class ExampleStatistics(AbstractStatistics):
    def _init(self):
        # TODO
        pass

    def onTransaction(self, transaction):
        # TODO
        pass

    def finish(self):
        # TODO
        pass
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].