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

Trading signal generated by a strategy. More...

#include <defs.h>

Public Member Functions

 Signal (int64_t ts=0, Side s=Side::NONE, double p=0.0, double v=1.0)
 Construct a new Signal object.

Public Attributes

int64_t timestamp
 Unix timestamp when signal was generated.
Side side
 Trade direction (BUY/SELL/NONE).
double price
 Price at which to execute the trade.
double volume
 Volume or size multiplier (default: 1.0).

Detailed Description

Trading signal generated by a strategy.

Represents a trading decision at a specific point in time. The timestamp represents a Unix timestamp (the scale - seconds, milliseconds, or microseconds - is determined by your data source).

Note
The volume field defaults to 1.0 and can be used for custom position sizing logic.

Constructor & Destructor Documentation

◆ Signal()

tzu::Signal::Signal ( int64_t ts = 0,
Side s = Side::NONE,
double p = 0.0,
double v = 1.0 )
inline

Construct a new Signal object.

Parameters
tsTimestamp (Unix time)
sTrade side (BUY/SELL/NONE)
pPrice
vVolume multiplier

Member Data Documentation

◆ price

double tzu::Signal::price

Price at which to execute the trade.

◆ side

Side tzu::Signal::side

Trade direction (BUY/SELL/NONE).

◆ timestamp

int64_t tzu::Signal::timestamp

Unix timestamp when signal was generated.

◆ volume

double tzu::Signal::volume

Volume or size multiplier (default: 1.0).


The documentation for this struct was generated from the following file: