Strategies

Starter strategies

Ready strategies to run as they are or change, grouped by what you want to do. Each is short Flowscript with its settings as knobs, and each backtests in one click.

Every starter is in the Strategies page's list (and in list_strategies over the API). Open one to read its code, change its settings, backtest it and run it. They are starting points: paper sizes and default settings, not advice.

Follow a trend#

StarterWhat it does
EMA crossoverBuys when the fast average crosses above the slow one; sells when it crosses back.
BreakoutBuys a close above the highest high of the lookback; sells a close below the lowest low of the exit window.
MomentumBuys when the price has risen at least the entry move over the lookback and is above its trend; sells when the move turns down or the price falls under the trend.
Perp trend, long and shortOn a perp: long while the fast average is above the slow one, short while it's below.
ML forecastA ridge regression trained on the market as it runs, on five features (recent moves, distance from two EMAs, RSI). Buys when the forecast clears the entry move, sells when it turns negative. Swap in lasso, SVM, logistic or k-NN in the code.

Buy dips, sell rips#

StarterWhat it does
RSI reversionBuys when RSI falls below the low line; sells when it rises above the high line.
Bollinger dipBuys a close below the lower band; sells at the middle band.
VWAP rotationOn BTC perps, 1m or 5m bars: fades failed pushes into the day's 2σ VWAP band back to the VWAP, skipping trending days, the first hour, Saturdays and moves too small to pay fees.

Earn from funding, books and spreads#

StarterWhat it does
Funding fadeOn a perp: short when longs pay high funding, long when shorts do, close once funding is back near zero.
Order book imbalanceLong when bids within 0.5% of the price outweigh asks by a ratio, short on the mirror, flat once the book evens out.
Microprice leanOn 1m bars: trades the microprice's lean toward the ask or the bid while the spread is tight and the book fresh.
Maker quotesRests a bid and an ask at the touch each bar, stepped back by an edge, to earn the spread and pay maker fees. On a live project they rest on the venue as post-only orders.
Depth-capped breakoutOn 15s bars: breaks out with the book behind it, each entry capped to what rests within a few bps of the middle.
Polymarket book pressureOn a Polymarket outcome: buys when dollars bid outweigh dollars offered on the top levels, while the spread is tight.

Order book strategies are covered in Order book strategies.

Options and liquidity#

StarterWhat it does
Options volatility, hedged on the perp bookSells a Derive strangle when implied volatility is rich against what ETH realizes, buys a straddle when it's cheap, and hedges the delta on Hyperliquid every bar.
Hedged range, width by session and volatilityHolds liquidity on a dollar pool (NVDA/USDG on Robinhood Chain), wider off the stock session and when it moves more, shorted on a perp.
Hedged LP: volatility range, perp shortLiquidity on ETH/USDG sized to how much ETH has moved, hedged with an ETH short on Lighter that follows what the range holds.
Overnight holdOn a stock token (SPY/USDG): buys in the last minutes of the NYSE session and sells on the next open, holding only overnight. Keeps the exchange's holidays and half days.

Launches#

These run well as stages of a workflow around a token launch.

StarterWhat it does
Staged buys, then exitBuys in tranches from the start, one every interval, then sells a share a delay later.
Dip buyBuys once when the market cap first falls to a ceiling.
Buy, then take profitsBuys at the start, then sells a share at each of up to three market caps.
DCA in a bandBuys on a fixed interval while the market cap sits inside a band.
Counter-tradeOn your own pool, inside a market-cap band: buys after a bar where sellers outweighed buyers and sells a share after one where buyers did.

Bring your own#

  • From Pine Script: paste a TradingView strategy and ftw.trade translates it to Flowscript and compiles it, or tells you which line it can't.
  • From your AI: describe the idea. The assistant (or Claude, ChatGPT and Codex through MCP) writes it, checks it and backtests it.
  • From the module library: every protocol and data module comes with a working example. See Modules.