My Bot's KPI: Trades 2 > Opportunities 1?! When Your Numerator and Denominator Don't Observe the Same Time.
Hey everyone, it's your friendly neighborhood "old man" developer here. I'm a 38-year-old part-time engineer, spending my evenings and weekends tinkering with AI bots. Today, I want to share a particular moment from my bot development log that had me face-palming – one of those "how could I make such a dumb mistake?" moments. In short, a KPI I built to measure my bot's performance started…
A developer, a 38-year-old part-time engineer, shared a challenging moment from his bot development journey. He had created a KPI to measure his bot's performance, but the KPI started spitting out logically impossible values, with the fulfillment rate exceeding 100%. This made no sense, as it implied two trades were executed when there was only one opportunity available.
The bot hadn't gone rogue, as the cause was a simple error in the KPI calculation logic. The issue stemmed from a mismatch in the observation time for calculating the numerator (trades) and denominator (opportunities). The denominator relied on trading opportunities as of the end of the month, while the numerator used trades from a specific period.
If trades were concentrated near month-end, the fulfillment rate would exceed 100%. To fix the issue, the developer aligned the observation points for the numerator and denominator by calculating both based on the actual entry date of the trade. This ensured that the numerator and denominator were based on the same observation time, providing an accurate fulfillment rate.
The developer emphasized that this type of mistake of misaligned aggregation criteria is common and can lead to false impressions about a bot's performance. He stressed the importance of always obtaining the numerator and denominator from the same observation point, definition, and playing field when calculating KPIs.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.