Daily trade journal
Writes a dated markdown journal entry each day: the crypto trade simulator's action and the latest sentiment for each coin, plus the market summary.
// The Problem
What this recipe solves
A trading journal is easy to start and easy to let slip. This script writes a structured entry from Guavy's data every day, so you keep a record of what the signals and sentiment said at the time. Trade signals are crypto only.
// The Script
Copy, run, ship
Drop this script into your project and run it locally or on a
cron. Set GUAVY_KEY in your
environment, swap the symbols, and go.
# journal.py (run at 5pm daily via cron)
import os, requests
from datetime import date
API = "https://guavy.com/api/v1"
H = {"Authorization": f"Bearer {os.environ['GUAVY_KEY']}"}
WATCHLIST = ["BTC", "ETH", "SOL", "AVAX", "LINK"]
today = date.today().isoformat()
entry = [f"# Trade Journal: {today}\n"]
# Signals
entry.append("## Signals")
for s in WATCHLIST:
a = requests.get(f"{API}/trades/get-current-action/{s}/aggressive", headers=H).json()
entry.append(f"- {s}: {a['action']}")
# Sentiment shifts
entry.append("\n## Sentiment")
for s in WATCHLIST:
d = requests.get(
f"{API}/sentiment/get-sentiment-history/{s}",
headers=H, params={"limit": 2}
).json()["sentiment"]
if not d:
entry.append(f"- {s}: no sentiment yet")
continue
entry.append(f"- {s}: pos={d[0]['positive']} neg={d[0]['negative']}")
# Market tone
tone = requests.get(f"{API}/newsroom/get-market-summary", headers=H).json()
entry.append(f"\n## Market Tone\n{tone.get('summary', 'N/A')}")
os.makedirs("journal", exist_ok=True)
with open(f"journal/{today}.md", "w") as f:
f.write("\n".join(entry))
print(f"Journal entry written: journal/{today}.md")
// Guavy Tools in Play
3 tools, one script
This script calls 3 endpoints from the Guavy REST API. Every data point maps back to the endpoint it came from.
// Keep Exploring
Related recipes
Same API key, a different job.
// Get started
Run this recipe on the free plan
Grab a free API key, set it as an env var, and run the script. Free sandbox forever.