Special Relativity in Financial Modeling 1.0.0
Lorentz transforms, spacetime classification, and geodesic price paths for quantitative finance
Loading...
Searching...
No Matches
Public Member Functions | List of all members
srfm::event_bt::RelativisticStrategy Class Reference

#include <event_backtester.hpp>

Inheritance diagram for srfm::event_bt::RelativisticStrategy:
srfm::event_bt::Strategy

Public Member Functions

 RelativisticStrategy (double base_qty=1.0, double threshold=0.001) noexcept
 
void on_start () override
 Called at the start of the simulation before any events are dispatched.
 
std::optional< Order > on_trade (const BacktestEvent &event) override
 
std::optional< Order > on_bar (const BacktestEvent &event) override
 
int spacelike_rejections () const noexcept
 Number of events rejected due to spacelike interval.
 
int timelike_accepts () const noexcept
 Number of events accepted due to timelike interval.
 
- Public Member Functions inherited from srfm::event_bt::Strategy
virtual ~Strategy ()=default
 
virtual void on_end ()
 Called at the end of the simulation after all events are processed.
 

Detailed Description

A concrete Strategy that filters trades using SpacetimeInterval::classify().

On every Trade event the engine converts the current and previous event into SpacetimeEvents and computes their interval. Only TIMELIKE intervals (ds² < 0) are allowed to generate orders — SPACELIKE events are treated as causally disconnected noise and ignored.

This implements the causal-cone hypothesis: only market moves that respect the relativistic causal structure of financial spacetime are acted upon.

Definition at line 249 of file event_backtester.hpp.

Constructor & Destructor Documentation

◆ RelativisticStrategy()

srfm::event_bt::RelativisticStrategy::RelativisticStrategy ( double  base_qty = 1.0,
double  threshold = 0.001 
)
inlineexplicitnoexcept
Parameters
base_qtyQuantity to buy/sell on each qualifying signal.
thresholdFraction of equity change required to generate a signal.

Definition at line 253 of file event_backtester.hpp.

Member Function Documentation

◆ on_bar()

std::optional< Order > srfm::event_bt::RelativisticStrategy::on_bar ( const BacktestEvent &  )
overridevirtual

Called for every Bar-type event.

Returns
An Order to execute, or std::nullopt for no action.

Reimplemented from srfm::event_bt::Strategy.

Definition at line 254 of file event_backtester.cpp.

◆ on_start()

void srfm::event_bt::RelativisticStrategy::on_start ( )
inlineoverridevirtual

Called at the start of the simulation before any events are dispatched.

Reimplemented from srfm::event_bt::Strategy.

Definition at line 260 of file event_backtester.hpp.

◆ on_trade()

std::optional< Order > srfm::event_bt::RelativisticStrategy::on_trade ( const BacktestEvent &  )
overridevirtual

Called for every Trade-type event.

Returns
An Order to execute, or std::nullopt for no action.

Reimplemented from srfm::event_bt::Strategy.

Definition at line 250 of file event_backtester.cpp.

◆ spacelike_rejections()

int srfm::event_bt::RelativisticStrategy::spacelike_rejections ( ) const
inlinenoexcept

Number of events rejected due to spacelike interval.

Definition at line 266 of file event_backtester.hpp.

◆ timelike_accepts()

int srfm::event_bt::RelativisticStrategy::timelike_accepts ( ) const
inlinenoexcept

Number of events accepted due to timelike interval.

Definition at line 271 of file event_backtester.hpp.


The documentation for this class was generated from the following files: