Skip to content

Commit 64bf581

Browse files
committed
Updated readme
1 parent 606b69e commit 64bf581

2 files changed

Lines changed: 37 additions & 3 deletions

File tree

README.md

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ I'm extracting results and creating various graphs for trend analyses using SciP
1414

1515
![alt text](documents/images/random-indices-sp500-variable.svg)
1616

17-
*Read more results on https://mccaffers.com/randomly_trading/*
17+
*Read more results on https://mccaffers.com/quantitative_analysis/randomly_trading/*
1818

1919
## Setup
2020

21-
This backtesting engine can pull tick data from local files or from a Postgres database. I'm using QuestDB.
21+
This backtesting engine can pull tick data from local files or from a Postgres database (I'm using QuestDB). Strategy execution is dispatched via a Redis list called `strategy_queue`, with each entry a Base64-encoded JSON payload — the `load` subcommand enqueues strategies (LPUSH) and the `run` subcommand dequeues and executes them (RPOP). The default workflow expects a local `redis-server` listening on `127.0.0.1:6379`.
2222

2323
### Clone with submodules
2424

@@ -40,6 +40,19 @@ For OpenSuse: zypper in postgresql-devel
4040
For ArchLinux: pacman -S postgresql-libs
4141
```
4242

43+
### Install Boost, OpenSSL, and Redis
44+
45+
Boost.Redis is header-only but its single translation unit (compiled via `<boost/redis/src.hpp>` from `source/redisRunner.cpp`) pulls in Boost.Asio's SSL layer, so OpenSSL is a transitive requirement. A local `redis-server` on `127.0.0.1:6379` is also needed for the default `load`/`run` workflow.
46+
47+
```
48+
For Mac Homebrew: brew install boost openssl redis
49+
For Ubuntu/Debian systems: sudo apt-get install libboost-all-dev libssl-dev redis-server
50+
```
51+
52+
The canonical CI prerequisite list lives in `.github/workflows/scripts/brew.sh` (`postgresql`, `pkg-config`, `boost`).
53+
54+
![alt text](documents/flow.png)
55+
4356
### Build dependencies
4457

4558
`libpqxx` is built once via CMake. `boost-decimal` is header-only and pulled in via `add_subdirectory` from the top-level `CMakeLists.txt` — nothing to build. The script below handles the libpqxx build:
@@ -76,7 +89,28 @@ Xcode - Library Path
7689

7790
### Run via terminal
7891

79-
`bash ./scripts/run.sh`
92+
`bash ./scripts/run.sh` builds the project, then — if `redis-cli ping` reaches a local Redis — enqueues an inline JSON strategy via `load` and executes it via `run localhost`. If Redis is unreachable the script prints a message and exits cleanly (see `scripts/run.sh:22-25`), so first-time users without Redis still get a clear signal.
93+
94+
The `BacktestingEngine` binary exposes a subcommand CLI:
95+
96+
```
97+
BacktestingEngine load <path> [path...]
98+
Read each file as raw JSON, Base64-encode it, and LPUSH onto the Redis
99+
`strategy_queue` list.
100+
101+
BacktestingEngine run <questdb-host>
102+
RPOP one Base64-encoded strategy from `strategy_queue` and execute it
103+
against the supplied QuestDB host.
104+
105+
BacktestingEngine run <questdb-host> <base64-config>
106+
Decode the supplied Base64 strategy and execute it directly, bypassing
107+
Redis.
108+
109+
BacktestingEngine -h | --help
110+
Show usage.
111+
```
112+
113+
Defaults are `127.0.0.1:6379` for the Redis endpoint and `strategy_queue` for the list key (see `include/redisRunner.hpp` and `include/redisLoader.hpp`).
80114

81115
### Run tests via terminal
82116

documents/flow.png

601 KB
Loading

0 commit comments

Comments
 (0)