← Changelog

SuperTrend Maker, Correctness Audit

Patch7 June 2026· per-strategy

Audit / Issue Found

A deep review of every variable in this strategy turned up two real bugs that had been quietly affecting it on every cycle.

Before the patch

The first bug was in the diagnostic line the strategy prints once per cycle. The code mutated a small object that was never actually declared, which threw an error every cycle. That error was silently caught by an outer guard, so the per-cycle diagnostic line never printed. You were running blind on it.

The second bug was in entry-price tracking. When the strategy opens a position it places a post-only buy that fills at the bid. The code was recording the entry as the ask instead. Because ask is higher than bid, the recorded average cost was inflated by the full spread. That fed into every later calculation that compared current price to the entry, so winning trades looked smaller and losing trades looked bigger than they really were.

After the patch

The diagnostic object is now declared at the start of the cycle-line block and merged into the diagnostic payload, so the cycle line prints reliably with its orchestration fields.

The entry-price tracking now records the bid as the cost basis, matching the actual fill price of the post-only order. The dollar-cost-averaging layers and the average-cost calculation now build from the honest starting point.

Bottom line

You now get the per-cycle diagnostic the strategy was designed to print, and your reported average entry, win-loss record, and running profit no longer carry the silent half-spread bias.