Urgent.News

What's breaking now, across thousands of outlets.

Tech

Every line of my recovery code was correct. It failed every single time."

I run an automated trading system on a paper account. Two pipelines, a handful of small single-purpose agents, no human in the loop once it starts. It places orders, sets stop-losses, and closes positions without asking anyone. One morning a position was sitting there with no stop-loss attached to it. Unprotected. The exact state the system has a whole self-healing routine designed to prevent.…

Every line of the recovery code was verified to be correct. However, the system failed each attempt to implement the fix. The system consisted of two pipelines and single-purpose agents that operated autonomously, placing orders, setting stop-losses, and closing positions without any human intervention. A position was left unprotected, despite the system's self-healing routine being active.

The recovery routine ran for hours but failed every time, and no error message was received to indicate the issue. The recovery process included four steps, all of which were executed correctly. Despite thorough testing and no apparent issues, the bug lay in the recovery code's retry mechanism, which generated the same client_order_id for each attempt, causing a permanent failure.

The system appeared structurally sound but was logically incorrect. The issue was discovered by manually triggering the sync command and examining the broker's raw error response. To prevent similar issues, five steps are recommended: include a unique identifier in each retry attempt, verify the logic within conditional branches against real failures, implement circuit breakers for repeated risky actions, minimize the exposure window by restoring the position immediately upon failure, and thoroughly examine all near-identical components for the same pattern.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

C# Singleton basics

Introduction The Singleton pattern ensures that a class has only one instance throughout an application and provides a single, globally accessible way to retrieve it.

NCC: Telecoms Revolution Has Enabled Connectivity as Way of Life

Emma Okonji The Executive Vice Chairman of the Nigerian Communications Commission (NCC), Dr. Aminu Maida, has said the 25 years of telecoms revolution in Nigeria has enabled connectivity as a

  • Dr. Aminu Maida, NCC Executive Vice Chairman, highlights 25-year telecom revolution in Nigeria.
  • Connectivity transformed into daily life, teledensity rises to 90%.
  • GSM services introduced in 2001, connecting 195 million subscribers.

Nested Arrays in JavaScript

Introduction When working with arrays in JavaScript, we usually start with a simple list of values. This works well when all the values belong to the same group.

  • Nested arrays contain multiple arrays within a single array
  • Access nested array values using multiple indices
  • Syntax: array[firstIndex][secondIndex]

Data Science vs. Data Engineering: Mana Jalur Karier yang Tepat untuk Kamu? - 20:50

Di era digital saat ini, data sering disebut sebagai 'minyak baru'. Namun, layaknya minyak mentah, data tidak akan berguna tanpa proses pengolahan yang tepat.

  • Data Science is interdisciplinary field using stats, algorithms to extract insights from data.
  • Data Engineering builds systems for large-scale data collection and utilization.
  • Collaboration between Data Science and Data Engineering is crucial for innovation.

More from Monday 28 September →