The ohlcv_candles function is a sophisticated tool within the mock-jutsu library designed for developers and QA engineers who require realistic financial market mock data. This function generates time-series candlestick data, which is fundamental for building and testing trading platforms, portfolio trackers, and financial analysis tools. By producing high-quality test data on demand, it allows technical teams to simulate market movements and price action without the need for expensive or rate-limited live market data providers.
At its core, ohlcv_candles employs the Geometric Brownian Motion algorithm to simulate price fluctuations. This mathematical model ensures that the generated prices mirror the stochastic nature of real-world markets rather than appearing as simple random noise. The function adheres to strict financial data integrity rules: 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. Furthermore, it maintains sequence continuity by setting the opening price of each candle to the closing price of the previous one, ensuring a seamless and logical price flow throughout the series.
Developers can customise the output by selecting from standard timeframes, including one minute, five minutes, fifteen minutes, one hour, four hours, and one day intervals. Each execution returns a series of 10 to 30 candles, providing a sufficient data window for testing complex chart visualisations or validating technical analysis indicators. The resulting JSON structure is comprehensive, containing the asset symbol, the chosen interval, and a detailed list of candles that include the timestamp, open, high, low, close, and volume metrics.
Integration is a key strength of the mock-jutsu ecosystem. The ohlcv_candles function can be accessed via the Python API using the jutsu.generate method, through the command-line interface for rapid data generation, or even within performance testing suites like JMeter. This versatility makes it an invaluable asset for various testing scenarios, from stress-testing backend trading engines to validating the rendering logic of front-end charting components.
The primary benefit of using ohlcv_candles for your mock data requirements is the perfect balance between mathematical realism and developer control. By generating consistent, logically sound test data, software teams can identify edge cases in their financial applications early in the development lifecycle. Ultimately, mock-jutsu empowers developers to build more robust and reliable fintech solutions by providing accessible, high-fidelity market simulations.
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}