The document answers whether Python trading libraries can support forex strategies. It describes three routes: combine plotting tools with a broker's REST API, use a backtesting framework that accepts OHLC data regardless of instrument, or run Zipline…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
9,660 documents
The document raises a market design question: could an exchange collect orders during fixed intervals and match them together at each interval’s end, instead of processing each incoming order immediately? It contrasts this proposed batch process with…
The document discusses how bid-ask spreads affect a minimum-variance portfolio of stock and options. It argues that transaction costs can shift the efficient frontier and change the optimal portfolio. For small trades, it offers an approximation based on the…
The document explains the options phrase “buy back a short strike” as purchasing an option previously sold, thereby closing that short position. The example describes placing an order to buy it back for five cents per contract, with a good-till-canceled…
The document describes the gap risk a broker can face when it immediately hedges a customer's leveraged spot FX trade with a liquidity provider. If the market jumps through a liquidation level, the customer may incur a negative balance that cannot be…
The document considers how to recover a limit order book after a process or machine failure. The proposed approach in the question is to save the full book state periodically, while the reply focuses on persisting the event stream so the system can rebuild…
The document explains how to design a normalized market data feed for algorithms consuming data from multiple providers. It recommends working backward from downstream strategy and operational needs: identify which fields applications actually use, then…
The document considers whether minute-level data for large NYSE stocks can reveal if a price move came from one participant or from many smaller orders. Its central lesson is that reliable attribution is difficult because a large trader may conceal activity…
The document clarifies whether market makers must trade when they are the only participants showing orders. It distinguishes designated market makers, whose exchange rules may require them to maintain two-sided quotes within a specified width for a certain…
The document explains how to estimate the units of a EUR/JPY spot short when the account balance is denominated in USD. The key step is to convert the available USD balance into the base currency, EUR, using the EUR/USD exchange rate. In the example,…
The document describes how a trading system can recover market-data messages lost while receiving a low-latency multicast feed. Because multicast commonly uses UDP, packets can be dropped, leaving a client’s order book incomplete unless it detects and…
The document argues that optimal trade size is not determined by a price forecast alone, even when leverage is treated as unlimited. Position changes should follow from an objective that balances expected alpha against portfolio risk and trading costs,…
The document explains how to represent and calculate returns for an equal-dollar long-short portfolio. Dollar neutrality means the current market values of the long and short sides have equal magnitude; a short position still has a market value even though…
The document explains how to assess an arbitrage across venues with different percentage-based and fixed transaction fees. Its suggested method is to adjust each venue’s bid and offer prices for the variable fee, evaluate the resulting arbitrage as usual,…
The document asks for an empirical market impact example and methods for estimating parametric impact functions. Its answer defines market impact in terms of how metaorder flow pressure affects price dynamics. Metaorders are large parent orders, commonly…
The document asks whether backtests of intraday strategies that start and end each day flat understate performance because a trader could stop trading after recognizing a poor market day. It notes that backtest results depend on assumptions about transaction…
The document surveys Python tools for strategy research, backtesting, portfolio analysis, and live trading. It describes backtrader in the most detail: it supports event-style and vectorized runs, multiple assets and strategies, varied data sources and…
The document explains why cumulative delta readings in the E-mini S&P 500 futures contract (ES) can differ sharply from those in its micro contract (MES). Cumulative delta records executed buying versus selling volume in a particular contract. Although the…
The document considers whether a fault at one exchange could create inconsistent trade records or apparent duplicate share sales, then discusses how exchanges and their supporting systems seek to preserve transaction integrity. The response uses the database…
The document explores how to backtest an Avellaneda–Stoikov style market-making strategy using historical limit order book data. The question describes estimating order-arrival intensities from synchronized order and book events, then asks how simulated…
The document poses an instrument-selection problem: how to hedge an interest-rate differential sensitivity produced by a statistical model of spot FX returns on an intraday basis. The author seeks low trading costs and near-continuous availability, with an…
The document discusses when FX spot value dates roll and whether NZD pairs follow a different schedule. It presents competing explanations: one answer says NZD pairs roll at the Auckland market’s opening while most other pairs use the New York close; another…
The document examines whether random trading has zero expected value before transaction costs, focusing on passive limit orders. If an uninformed trader posts bids and offers without managing execution, informed counterparties may be more likely to trade…
The document introduces the information available in a visible order book: current prices, displayed quantities, and the structure of supply and demand. Its question asks how that information could support arbitrage or manipulation, but the accepted answer…