Macrotrends-style price chart + stats. Paste a price series (one number per line or comma-separated) and the Python kernel — rolling MA, max drawdown, CAGR — is transpiled to native Mojo by mojosub and verified against CPython on first call.
def rolling_mean_last(prices: list[float], window: int) -> float:
total = 0.0
start = max(0, len(prices) - window)
for i in range(start, len(prices)):
total += prices[i]
return total / (len(prices) - start)
def max_drawdown(prices: list[float]) -> float:
peak = prices[0]; worst = 0.0
for i in range(len(prices)):
if prices[i] > peak: peak = prices[i]
if peak > 0.0: worst = max(worst, (peak - prices[i]) / peak)
return worst
No imports needed beyond math, no numpy, no
database. The accel filter needs a loop + typed annotations; that is the
whole contract.