This code walkthrough explains how a Dual Thrust strategy tracks each day’s opening price, high, and low. When a bar’s date differs from the prior bar’s date, it uses the accumulated previous-day range to set long and short entry levels around the new day’s…
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
This document explains a utility for assigning and recognizing magic numbers used by trading Expert Advisors. Magic numbers help an EA distinguish its trades from trades opened by other EAs, including when the same EA runs on the same symbol and timeframe…
This description explains a single-use trading robot that sets stop-loss and take-profit levels for positions on the current symbol. The user can choose which side of the market to target—buy, sell, or both—and specify the stop and target values. Once it…
This tutorial extends a multi-symbol cryptocurrency contract-spread monitor into a grid-based hedging strategy. It pairs longer-term contracts with perpetual contracts, tracks spread levels, and opens or closes offsetting positions when grid thresholds are…
This intraday DAX strategy applies an opening-range breakout on one-minute data. It records the high and low of the two-hour morning range, then places stop entries above or below those levels after the range ends. The rules restrict entry to before a stated…
This brief forum exchange addresses a live-trading timestamp anomaly in which a morning tick appears to be assigned a late-night time. The response points to bar construction rather than necessarily a timezone conversion problem: the bar synthesizer uses the…
This document describes an Expert Advisor that opens trades at a configured time and can close them at another configured time. Users can enable buy orders, sell orders, or both, and set the entry time, entry window duration, trade volume, stop loss, and…
The article explains why automated trading needs explicit order-state management. A signal does not guarantee a fill: an order may remain open, fill partially, be canceled, or require a replacement. The program should track the action it submitted and wait…
This example describes an expert advisor that uses Heiken Ashi candles on two timeframes to signal entries. Its bullish condition looks for a current candle with a rising close and open at the low, preceded by another rising candle whose open is not at the…
This short forum exchange asks how to change a running strategy’s parameter without stopping it. The example is a strategy operating without a user interface that has a close flag initially disabled; another program would set the flag so the strategy can…
This document presents Hans123_Trader as an expert advisor intended for EUR/USD on an hourly chart. It lists two trading-session windows and configurable values for trailing stop, take profit, and initial stop loss. The session windows divide the day into…
GG-RSI-CCI is described as a trend indicator that assigns colors to market states: blue bars indicate potential long entries, pink bars indicate potential short entries, and gray bars indicate a flat position. The page positions it as a tool for deciding…
A crypto ATM is a physical kiosk for buying cryptocurrency with cash or a card, and some machines also let users sell crypto for cash. For purchases, the customer provides a wallet address and the machine sends the cryptocurrency directly to that wallet.…
This trading-system description uses the XFatlXSatlCloud indicator to signal a change in trend direction. A trade signal is generated at bar close when the indicator cloud changes color. The document concerns an Expert Advisor setup, requiring the compiled…
The document describes an MQL5 implementation of an associative array built on collection classes. It uses FNV-1a hashing and provides typed Set and Get operations for primitive values, with examples using strings and doubles. It also permits storing…
The document explains gnome sort as a simple, stable array-sorting method that orders items through adjacent comparisons and swaps. It resembles insertion sort in processing one element at a time, while using swaps to move out-of-order items into place. The…
This document describes a non-directional automated trading expert advisor that can open trades using several modes, including simultaneous long and short positions, random side selection, alternating sides, swap-aware direction, or one-sided trading. It…
The forum thread asks whether VeighNa version 4.4 can use MiniQMT for live order placement. Replies state that the xttrader interface is not supported for trading in VeighNa and that the vnpy_xt integration provides data access only. They suggest connecting…
This document describes a MetaTrader 5 account-level risk manager intended for proprietary trading evaluations. It monitors all positions, regardless of whether an expert advisor or manual trading opened them, and can close positions and remove pending…
This brief forum exchange concerns stop orders in VeighNa 4.3 when running multiple processes or strategies. A user reports that stop orders for exits refresh as expected with one process and one instrument strategy, but stop orders no longer appear after…
This post reports an intermittent runtime error in a live trading script when code attempts to read a position’s price field. The author asks whether the cause could be a null custom field or missing price data, and whether wrapping the position query in a…
This MetaTrader utility evaluates whether splitting a position into multiple exits improved the outcome relative to holding the full position until the final exit. It reads closing-deal records from a CSV and reports three measures: value added versus that…
This utility displays an instrument’s swap values on a chart, using different text colors for positive and negative values. It also shows the instrument name and the date and time at which the values were captured. Because swap rates can change, the…
The document describes a liquidity mining scheme for compensating market makers according to how much liquidity they provide. Rewards are divided across regular order book snapshots, so a participant must have orders present at a snapshot to earn from it.…