WU Trading Library 0.2.0
A backtesting and trading strategy library
Loading...
Searching...
No Matches
runner.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "wu.h"

Go to the source code of this file.

Functions

static bool validate_input_type (WU_DataType reader_type, WU_DataType expected_type)
static WU_DataType get_reader_data_type (WU_Reader reader)
static void run_backtest (WU_Runner runner, bool verbose)
WU_Runner wu_runner_new (WU_Portfolio portfolio, WU_Strategy strategy, WU_Reader readers[])
 Creates a new runner with multiple readers.
void wu_runner_free (WU_Runner runner)

Function Documentation

◆ get_reader_data_type()

WU_DataType get_reader_data_type ( WU_Reader reader)
static

Definition at line 19 of file runner.c.

◆ run_backtest()

void run_backtest ( WU_Runner runner,
bool verbose )
static

Definition at line 27 of file runner.c.

◆ validate_input_type()

bool validate_input_type ( WU_DataType reader_type,
WU_DataType expected_type )
static

Definition at line 6 of file runner.c.

◆ 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.