1er
This commit is contained in:
12
backend/app/services/pricing.py
Normal file
12
backend/app/services/pricing.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def price_trend(prices: list[float]) -> str:
|
||||
if not prices:
|
||||
return "stable"
|
||||
first, last = prices[0], prices[-1]
|
||||
if last > first:
|
||||
return "up"
|
||||
if last < first:
|
||||
return "down"
|
||||
return "stable"
|
||||
Reference in New Issue
Block a user