Stéphane

Stéphane

Lesson 6 — Backtesting & analysis (Jupyter)

Skip to content Lesson 6 — Backtesting & analysis (Jupyter) Use Jupyter to replay historical market data, simulate order execution and compute P/L and performance metrics. We’ll build small, testable backtest components you can evolve into more advanced systems. Estimated…

Lesson 5 — Webhooks & alerts

Skip to content Lesson 5 — Webhooks & alerts Receive TradingView alerts via a secure webhook, verify the HMAC signature, map the alert to a Betfair market/selection and trigger an idempotent order placement in the sandbox. Estimated time: 45–60 minutes…

Lesson 4 — Order placement (sandbox)

Skip to content Lesson 4 — Order placement (sandbox) Place BACK and LAY orders safely in the Betfair sandbox, handle partial/unmatched fills, cancellations, idempotency and retries. This lesson focuses on safe order logic and interpreting API responses. Estimated time: 60…

Lesson 3 — Market lookup & selections

Skip to content Lesson 3 — Market lookup & selections Learn how to discover markets, parse runners and build selection filters so your bot can target the right markets programmatically. Estimated time: 45 minutes • Skill level: Beginner → Intermediate…

Lesson 2 — Authentication & API basics

Skip to content Lesson 2 — Authentication & API basics Implement secure authentication for the Betfair API, handle token/session flows, store secrets safely and create a resilient request helper with retries and exponential backoff. Estimated time: 45–60 minutes • Skill…

Lesson 1 — Environment & sandbox setup

Skip to content Lesson 1 — Betfair: Environment & sandbox setup Get your Python environment ready, create a Betfair sandbox/test account, and run a short smoke test. This lesson prepares you to follow the Betfair track tutorials. Estimated time: 30–45…

Backtest notebook — Jupyter

Annotated notebook pattern for loading ticks, building signals and exporting trade logs for bot replay (ideal for Binder/Colab). Jupyter Category: Code Library  •  Tags: jupyter, backtest, pandas  •  Published: PUBLISH_DATE Notebook snippet (pandas) Copyimport pandas as pd df = pd.read_csv(‘ticks.csv’,…

Webhook handler — Flask

Minimal, secure Flask handler pattern for TradingView webhooks: verify HMAC signature and enqueue processing. Python (Flask) Category: Code Library  •  Tags: python, webhook, flask  •  Published: PUBLISH_DATE Handler — copyable code Copyfrom flask import Flask, request, abort import hmac, hashlib,…

Pine Script — Alert → Webhook

TradingView Pine v5 example and recommended webhook payload for automation pipelines (include a secret in the alert). Pine Script Category: Code Library  •  Tags: pine, tradingview, webhook  •  Published: PUBLISH_DATE Pine v5 example Copy// @version=5 indicator(“Simple Alert Example”, overlay=true) sma…

Green‑up helper — JavaScript

Simplified helper to compute hedge stakes to green up existing positions — adjust for fees and increments before production use. JavaScript Category: Code Library  •  Tags: javascript, hedging, greenup  •  Published: PUBLISH_DATE Code — copyable Copy// positions: [{ price, stake,…