WU Trading Library 0.2.0
A backtesting and trading strategy library
Loading...
Searching...
No Matches
runners.h File Reference
#include "portfolios.h"
#include "strategies.h"
#include "readers.h"

Go to the source code of this file.

Data Structures

struct  WU_Runner
 WU_Runner is a backtest runner that processes data from multiple readers, updates a strategy, and executes trades in a portfolio. More...

Macros

#define wu_runner_exec(runner, verbose)

Functions

WU_Runner wu_runner_new (WU_Portfolio portfolio, WU_Strategy strategy, WU_Reader readers[])
 Creates a new runner with multiple readers.
static WU_Runner wu_runner_new_single (WU_Portfolio portfolio, WU_Strategy strategy, WU_Reader reader)
 Convenience function for single-input strategies.
void wu_runner_free (WU_Runner runner)

Macro Definition Documentation

◆ wu_runner_exec

#define wu_runner_exec ( runner,
verbose )
Value:
((runner)->run((runner), (verbose)))

Definition at line 40 of file runners.h.

Function Documentation

◆ wu_runner_free()

void wu_runner_free ( WU_Runner runner)

Definition at line 137 of file runner.c.

◆ wu_runner_new()

WU_Runner wu_runner_new ( WU_Portfolio portfolio,
WU_Strategy strategy,
WU_Reader readers[] )

Creates a new runner with multiple readers.

Parameters
portfolioThe portfolio to execute trades in
strategyThe strategy to generate signals
readersArray of readers (one per strategy input)
Returns
New runner instance, or NULL on validation failure

Validation performed:

  • Number of readers determined from strategy->num_inputs
  • Each reader's data type must be compatible with strategy's input_types

Memory is dynamically allocated based on strategy input requirements.

Definition at line 95 of file runner.c.

◆ wu_runner_new_single()

WU_Runner wu_runner_new_single ( WU_Portfolio portfolio,
WU_Strategy strategy,
WU_Reader reader )
inlinestatic

Convenience function for single-input strategies.

Equivalent to wu_runner_new(portfolio, strategy, &reader, 1).

Definition at line 66 of file runners.h.