The note explains which Interactive Brokers TWS historical data types to request when matching Yahoo Finance close fields. For a close adjusted for both stock splits and dividends, it recommends requesting ADJUSTED_LAST and using the returned Close field.…
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
16,761 documents
The document explores whether capital expenditure items could be treated as options: teams propose spending, but the company may defer or abandon purchases as needs, priorities, or circumstances change. This framing offers a possible explanation for why…
The document considers how to choose training and testing windows for walk-forward strategy optimization, how far to shift the windows, and how to select parameters across repeated fits. The response says there is no universally best window length: the…
The document outlines a basic workflow for backtesting an equity selection strategy in MATLAB. It forms a portfolio by applying a characteristic-based selection rule to a matrix of asset returns, then computes portfolio returns by averaging the returns of…
The document considers whether to estimate a return prediction model with a fixed-length rolling window or with all available historical observations. A shorter window can respond more quickly when the relationship changes, while a longer history may be more…
The document shows how to calculate a running net amount for a short-selling backtest when positions are added over time. The proposed recurrence updates the previous net amount by the next period's short-sale price change, then adds the value of any new…
The document compares storing market bars in separate arrays by field with storing each bar as an object. The column-oriented option keeps open, high, low, close, and volume values in separate arrays. One answer recommends this layout for time-series…
The document addresses why simulating a stock price over one year in one step may appear to produce different variation from simulating twelve successive monthly steps. Under geometric Brownian motion, each interval applies the same drift and volatility…
The document considers numerical valuation of American options when the underlying model has multiple sources of randomness, such as stochastic volatility. One response argues that lattice methods can remain preferable to least-squares Monte Carlo (LSMC)…
The document discusses whether machine learning models built from historical stock prices should use raw closing prices or adjusted closing prices. Adjusted closes account for corporate actions such as splits and dividends, which can make historical returns…
The document explains why averaging simple daily percentage returns can misrepresent compounded performance. A loss followed by a gain of the same percentage does not restore the starting value, even though the arithmetic average of those two returns is…
The document considers a stock log-return regression with a market log return and an earnings-announcement indicator. It highlights that coefficient interpretation depends on how returns are recorded: if both returns use decimal units, the market coefficient…
The document asks about open-source software for building a simulated stock exchange on a development server, with the goal of experimenting with trading strategies. Responses name three exchange or order-book projects and mention a small custom exchange…
The document explains how to construct put-option value curves at different times by repricing the option across a range of underlying spot prices. Under the stated assumptions of European exercise and no dividend or early-exercise concern, the Black-Scholes…
The document addresses calculating daily, weekly, or monthly returns from adjusted closing prices for several securities downloaded with quantmod in R. The central issue is that functions such as weeklyReturn are intended for a univariate series, while the…
The document describes difficulties backtesting a simple intraday pairs strategy on 30-minute bars. The author has calculated a spread, hedge ratio, and standard deviation, and uses spread thresholds to create long and short signals. Treating the spread…
The document asks how to choose mean and variance orders efficiently for a time series with both autocorrelation and changing volatility. It contrasts selecting an ARMA model first and then choosing GARCH orders with a joint search over all ARMA-GARCH…
The note outlines how to price a European put in a four-month binomial stock model where the share price changes by a fixed amount each month. The stock starts at 100, moves up or down by 10 per step, and the riskless bond compounds at a 5% annual rate. The…
The document considers how to identify orderly segments in market prices using net movement, path linearity, and duration, with the aim of informing machine-learning models or projecting prices. The answer challenges the idea that observed behavior can be…
The document raises a backtesting question: why Sharpe and Sortino ratios differ when calculated from daily, weekly, or monthly portfolio returns, and whether one interval is the industry standard. It reports that both measures rise as the return interval…
The document addresses how to calculate portfolio weights as they drift under buy-and-hold returns, an operation used in a Monte Carlo stress-testing workflow. It states the recursive update: each asset’s prior weight is multiplied by its gross return and…
The document describes a QuantLib curve-building problem involving overnight index futures. Bootstrapping fails because a required historical fixing is missing; adding a fixing for a Mexican public holiday then triggers an invalid-fixing error. The example…
The document asks how to determine whether a one-minute return forecasting model trained on trade prices has predictive value beyond bid-ask bounce. The proposed benchmark simulates normally distributed mid-price returns using observed volatility, adds an…
The document explores how to generate artificial asset-price paths when constant-volatility geometric Brownian motion does not fit the desired behavior. Its example modifies a GBM-style price update by drawing a separate volatility value at each time step…