For developers building financial applications, generating realistic market data is a persistent challenge. The ohlcv_candles function within the mock-jutsu library provides a robust solution for synthesizing high-quality test data that mimics real-world asset price movements. By producing a series of 10 to 30 candlestick data points, this tool allows engineers to simulate market behavior across various timeframes, including one-minute, five-minute, fifteen-minute, hourly, four-hour, and daily intervals. This flexibility ensures that whether you are developing a high-frequency trading algorithm or a long-term portfolio tracker, you have the necessary mock data to validate your logic effectively.
What sets the ohlcv_candles generator apart is its adherence to financial modeling standards and mathematical consistency. The function utilizes Geometric Brownian Motion (GBM) to calculate price fluctuations, ensuring that the resulting series reflects the stochastic nature of actual liquid markets. Furthermore, the mock-jutsu library enforces strict logical constraints: the high price is always greater than or equal to the maximum of the open and close, while the low price remains less than or equal to the minimum. To maintain continuity throughout the series, each candle’s opening price is automatically synced to the previous candle's closing price. This mathematical rigor prevents the "jagged" or impossible data points often found in simpler random generators.
Integrating this functionality into your development workflow is seamless, regardless of your preferred environment. Developers can invoke the function via the Python SDK using jutsu.generate('ohlcv_candles'), execute it directly from the command line for quick prototyping, or even use the JMeter plugin for large-scale performance testing. This versatility makes mock-jutsu an essential asset for unit testing charting libraries, stress-testing database ingestion pipelines, or verifying the accuracy of technical indicators. By using realistic ohlcv_candles test data, engineering teams can identify edge cases in their financial software early in the development lifecycle, leading to more resilient and reliable production deployments.
mockjutsu generate ohlcv_candlesmockjutsu bulk ohlcv_candles --count 10mockjutsu export ohlcv_candles --count 10 --format jsonmockjutsu export ohlcv_candles --count 10 --format csvmockjutsu export ohlcv_candles --count 10 --format sqlfrom mockjutsu import jutsujutsu.generate('ohlcv_candles')jutsu.bulk('ohlcv_candles', count=10)jutsu.template(['ohlcv_candles'], count=5)${__mockjutsu_ohlcv(ohlcv_candles)}# JMeter Function: __mockjutsu_ohlcv# Parameter 1: ohlcv_candles# Parameter 2: (not required for this function)GET /generate/ohlcv_candles# → {"type":"ohlcv_candles","result":"...","status":"ok"}GET /bulk/ohlcv_candles?count=10POST /template {"types":["ohlcv_candles"],"count":1}