tzutrader
A composable C++ backtesting library for trading strategies (experimental)
Loading...
Searching...
No Matches
tzu.h File Reference

Main header file for the tzutrader library. More...

#include "tzu/runners.h"
#include "tzu/timeutils.h"

Go to the source code of this file.

Detailed Description

Main header file for the tzutrader library.

Include this header to access all components of the tzutrader backtesting library.

Introduction

tzutrader is a composable C++ backtesting library that processes market data in a streaming fashion. The library is designed around small, focused components that can be combined to create custom backtesting systems.

Core Components

  • Data Types (defs.h): Fundamental structures like Ohlcv, Signal, Tick
  • Indicators (indicators.h): SMA, EMA, RSI, MACD, and more
  • Strategies (strategies.h): Trading signal generation
  • Portfolios (portfolios.h): Position and risk management
  • Streamers (streamers.h): Data input and parsing
  • Runners (runners.h): Backtest orchestration

Quick Example

#include "tzu.h"
using namespace tzu;
int main() {
RSIStrat strategy(14, 30, 70);
BasicPortfolio portfolio(100000.0, 0.001, 0.10, 0.20);
Csv<Ohlcv> csv(std::cin);
portfolio, strategy, csv
);
runner.run(false);
return 0;
}
Definition portfolios.h:35
Definition runners.h:32
Definition streamers.h:176
Definition strategies.h:68
Definition defs.h:20
Main header file for the tzutrader library.

Links

Note
This is an experimental project. The API may change as the design evolves.
Author
Jaime Lopez