Our code silently replaced our own $50 daily loss limit with $142
说明与用途
代码将硬性每日亏损限额$50悄悄替换为更宽松的$142限额,导致每日亏损高达$100。修复后,系统将执行更严格的限额。
问题
A hard daily loss limit of $50 was silently overridden by a looser automatic cap of ~$142, allowing losses up to $100 without triggering the guard.
结果
The bug allowed daily losses up to $100.26 over 42 trading days, with the $50 limit never firing. After fixing, the stricter cap rule now prevents such losses.
工作流
- Read risk rule file at startup
- Compute automatic cap as 1.5% of balance each tick
- Unconditionally overwrite config cap with automatic cap
- Stop trading when cap reached
证据
we set a hard daily loss limit of $50. For at least the 42 trading days we can measure, the number actually running was about $142.
Every tick, the bot computes a day cap from the account balance: 1.5% of the balance, which on a roughly $9,500 account is about $142. Then it assigned that value to the variable that holds the cap.
That assignment was unconditional. It did not compare the two numbers. It did not ask which one was stricter. It just wrote over whatever was there — including the $50 that our own rule file had just supplied.
The change is two lines long and the principle is one sentence: when a rule and a default disagree, take the stricter one.
Five days below a limit that was supposedly live is not a subtle discrepancy. It is a contradiction, and it had been sitting in our own data the whole time.
- 记录日期: 2026-10-09T01:41:08.701Z