Back to Work

Systems Study / Trading Infrastructure / 2026

Chronara

Algorithmic Trading Engine

Work in Progress

Chronara is a modular trading engine built for strategy research, risk-constrained backtesting, and staged paper execution. The project focuses on a shared execution path across research and live-style workflows, separating signal generation, position sizing, and stateful trade management into clear system components.

Shared Execution Core

Research and live-style modes feeding one decision core

Chronara shared execution core diagram

Shared Execution Pipeline

Signal flow from enriched inputs to stateful position management

Chronara shared execution pipeline diagram

Execution Logic

_compute_exit_fill

Gap-aware exit logic distinguishes between overnight gaps and intrabar touches, producing more realistic fill behavior than naive stop-loss simulation.

core/portfolio/position_manager.py416-458
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
def _compute_exit_fill(self, pos: Dict[str, Any], bar: Dict[str, Any]) -> Tuple[Optional[float], Optional[str]]:
"""
If OPEN gaps through level → fill at OPEN (worst side).
Else if intrabar touch → fill at the level.
Stop has precedence over TP.
"""
side = pos["side"]
stop = pos.get("stop_loss")
tp = pos.get("take_profit")
o = float(bar["open"])
h = float(bar["high"])
l = float(bar["low"])
if side == "long":
if stop is not None and not pd.isna(stop):
stop = float(stop)
if o <= stop:

Sizing Logic

_affordable_size

Position sizing accounts for opening costs before execution, preventing avoidable over-allocation at the cash boundary.

core/portfolio/position_manager.py463-471
463
464
465
466
467
468
469
470
471
def _affordable_size(self, entry_price: float, requested_size: float) -> float:
"""Cash-only affordability (includes opening fee) with a small tolerance."""
if entry_price <= 0.0 or requested_size <= 0.0:
return 0.0
denom = entry_price * (1.0 + self.fee_rate)
if denom <= 0.0:
return 0.0
size_cap = self.cash / denom
return min(requested_size, max(0.0, size_cap) * (1.0 - max(self._eps_abs, self._eps_rel)))

Next Project

Flowtal