market_tickOHLCV

Mock Jutsu HOW-TO | EN

The market_tick function within the mock-jutsu library serves as a robust tool for developers needing high-fidelity financial test data. This specific generator produces individual exchange trade ticks that mirror real-world market dynamics, including essential fields such as the ticker symbol, execution price, bid-ask spread, trade side, and lot size. By providing a realistic stream of transactional data, mock-jutsu enables engineers to simulate complex market environments without the overhead or cost of connecting to live exchange APIs. This is particularly useful during the early stages of fintech development where consistent and predictable mock data is required to validate trading logic, data ingestion pipelines, and real-time streaming services.

At its technical core, the market_tick generator adheres to industry-standard financial logic to ensure data integrity and realism. The function implements a variation of the Lee-Ready algorithm to determine the trade side, ensuring that the generated price consistently falls within a logical range relative to the quote. Specifically, it maintains a strict relationship where the bid price is less than the trade price, which is in turn less than or equal to the ask price, all while ensuring a positive spread remains present. This level of detail makes the test data suitable for backtesting execution algorithms or verifying that downstream systems correctly categorize buy and sell orders based on tick-level movements and sequence numbers.

Developers can leverage market_tick across various testing scenarios, ranging from simple unit tests to massive load testing for high-frequency trading platforms. Whether you are building a real-time price dashboard or a complex risk management system, having access to structured mock data ensures that your edge cases, such as rapid price fluctuations or varying lot sizes, are thoroughly covered. The function is easily accessible via the Python API using the jutsu.generate method or through the command-line interface with the mockjutsu generate market_tick command. Furthermore, its compatibility with JMeter via the mockjutsu function string makes it a versatile addition to any performance testing suite or CI/CD pipeline.

Ultimately, using mock-jutsu to generate financial market data significantly reduces the time spent on manual data preparation and cleansing. By automating the creation of valid, sequence-aware ticks, development teams can focus on optimizing their core trading algorithms and user interfaces rather than troubleshooting malformed data entries. The market_tick function bridges the gap between static, stale datasets and volatile live market feeds, providing a reliable, programmable, and scalable alternative for rigorous software quality assurance in the modern financial sector.

CLI Usage
mockjutsu generate market_tickmockjutsu bulk market_tick --count 10mockjutsu export market_tick --count 10 --format jsonmockjutsu export market_tick --count 10 --format csvmockjutsu export market_tick --count 10 --format sql
Python API
from mockjutsu import jutsujutsu.generate('market_tick')jutsu.bulk('market_tick', count=10)jutsu.template(['market_tick'], count=5)
JMeter
${__mockjutsu_ohlcv(market_tick)}# JMeter Function: __mockjutsu_ohlcv# Parameter 1: market_tick# Parameter 2: (not required for this function)
REST API
GET /generate/market_tick# → {"type":"market_tick","result":"...","status":"ok"}GET /bulk/market_tick?count=10POST /template {"types":["market_tick"],"count":1}

Other Languages