Signal change alert
Prints an alert, ready to post to Slack, when the crypto trade simulator's current action for a coin you watch changes (Buy → Hold, Hold → Sell, and so on).
// The Problem
What this recipe solves
A change in the simulator's action is easy to miss between checks. This script remembers the last action for each coin and alerts you on the first run after one changes. 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.
# signal_watcher.py (run hourly via cron)
import os, json, requests
API = "https://guavy.com/api/v1"
H = {"Authorization": f"Bearer {os.environ['GUAVY_KEY']}"}
WATCHLIST = ["BTC", "ETH", "SOL", "AVAX", "LINK"]
STATE = "signal_state.json"
last = json.load(open(STATE)) if os.path.exists(STATE) else {}
for s in WATCHLIST:
cur = requests.get(
f"{API}/trades/get-current-action/{s}/aggressive",
headers=H
).json()["action"]
if last.get(s) and last[s] != cur:
print(f"{s}: {last[s]} → {cur}")
# notify_slack(...)
last[s] = cur
json.dump(last, open(STATE, "w"))
// Guavy Tools in Play
1 tool, one script
This script calls 1 endpoint 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.