This document implements a directional crossover strategy using fast and slow exponential moving averages on hourly bars. It calculates the averages from closing prices, discards the latest bar if it has not yet closed, and signals a long position when the…
Knjižnica znanja
Povzetki in ključne ideje knjig, razprav, člankov in kode, ki jih berejo naši agenti UI, pripravljeni s Stratmillovim raziskovalnim agentom. Na vsaki strani je povezava do izvirnika.
Iskanje po knjižnici
157 dokumentov
The document shows a simple workflow for evaluating two futures strategies together. It runs separate historical simulations for an ATR-RSI strategy on an equity index contract and a Bollinger channel strategy on a metal contract. Each run specifies its own…
This document describes data structures for tracking option contracts, underlying instruments, and option chains in a portfolio. It updates positions from trades and holdings, derives mid prices from top of book quotes, and connects options with pricing…
The document outlines an event-driven trading system designed for cryptocurrency strategies, including market making and higher-frequency activity. It describes an asynchronous event loop for processing work and a message queue that connects separate market…
This document explains how to build a multi-contract strategy using synchronized bar data, per-leg targets, and order management. Its example computes the spread between two weighted contract prices, updates a rolling window, and uses Bollinger Bands to…
The document describes a two-leg spread strategy built around Bollinger Bands. It calculates a weighted price difference between two contracts, samples the spread on a five-minute schedule, and compares it with a rolling mean and standard deviation. A move…
This guide explains how to use a Python wrapper around multiple cryptocurrency exchanges through a mostly consistent interface. It shows initialization with an exchange name and credentials, then describes calls for market status, candlesticks, order books,…
This example retrieves historical minute bars for a cryptocurrency symbol from a trading database, using an exchange, interval, and date range as query parameters. It then extracts each bar’s timestamp and closing price and plots the resulting price series…
This document explains a workflow for collecting live market data for selected instruments. After connecting to a market interface and starting the recorder, a user adds tick or bar recording tasks. The recorder subscribes to the required instruments, stores…
This guide explains execution algorithms that divide large orders, react to market prices, and adjust positions on a grid or across a spread. It describes time-weighted execution, iceberg orders, a tick-driven sniper approach, conditional orders, and…
This strategy uses a fast and a slow moving average to trade long and short. It detects a bullish crossover when the fast average moves above the slow average, and a bearish crossover when it moves below. When a signal opposes an open position, the code…
This lesson explains how Python functions return values and how that differs from printing output. It covers explicit returns, the implicit None result when no value is returned, how a return ends the current function, and how multiple returned elements are…
This document is a daily candlestick dataset for the BTC/USDT market during 2019. Each row records a timestamp and the open, high, low, and close prices, together with traded volume. The visible entries span portions of the year, including early-year…
The document describes an options volatility trading module built around live pricing, portfolio risk tracking, and execution. It outlines three pricing models for different exercise styles and underlyings, with routines to calculate theoretical prices and…
The document contains hourly open, high, low, close, and volume observations for the ADA-USDT market. The visible records begin in early May 2018 and continue through the end of December 2018, with gaps in the displayed sequence. The fields support basic…
This strategy seeks directional breakouts on one-hour bars. A long entry requires positive CCI and an intraday bid above the upper Bollinger Band and the previous bar’s high; a short entry requires negative CCI and an ask below the lower band and previous…
This document explains the structure of a historical trading strategy backtester. It loads bar or tick records over a selected date range, initializes a strategy with a warm-up period, then replays the remaining data. The engine tracks simulated orders and…
The strategy applies a long-only moving average crossover to daily bars for a single stock. After enough bars are available to calculate both averages, it treats an upward cross of the shorter average over the longer one as an entry signal and buys when…
This multi-instrument strategy updates bars from incoming ticks and calculates ATR and RSI for each instrument. It only considers new entries when the latest ATR is above its recent average. RSI levels set around the midpoint then determine direction: a high…
This document describes a graphical interface for defining and monitoring spread trades. Users can create standard or flexible spreads, specify leg instruments and directions, set a pricing formula, identify an active leg, and enter minimum trade volume. The…
This example outlines a multi-timeframe analysis workflow for Bitcoin-dollar price data. It loads minute history over a stated date range, configures a transaction-rate assumption and a rolling analysis window, and assigns technical indicators to several…
The document explains utilities for turning incoming trades into one-minute OHLCV bars and combining minute bars into larger time windows. It tracks price extremes, closing price, volume changes, and open interest, then sends completed bars through…
This code tracks long and short holdings, separating each side into today’s and prior-day positions. It updates those amounts from position snapshots and trades, and it keeps active orders so that quantities committed to closing positions are treated as…
This strategy forms a spread from two instruments’ bar closes, weighted by configurable leg ratios. It updates the spread at five-minute intervals, keeps a rolling history, and calculates a moving average with upper and lower bands based on the spread’s…