import { between, random } from './random.js';
export function generateMockMarketData(length, seed, startPrice = 100, startTime = Date.now()) {
    const gen = random(seed);
    const candles = [];
    const interval = 15 * 60 * 1000; // 15 minutes in ms
    let lastClose = startPrice;
    for (let i = 0; i < length; i++) {
        const time = startTime + i * interval;
        const open = lastClose;
        // small random move for close relative to open (in currency units)
        const move = between(gen, -200, 200) / 100; // -2.00 .. +2.00
        const close = Math.max(0.01, +(open + move));
        // ensure high is at least max(open, close) and low is at most min(open, close)
        const baseHigh = Math.max(open, close);
        const baseLow = Math.min(open, close);
        const extraHigh = between(gen, 0, 100) / 100; // up to +1.00
        const extraLow = between(gen, 0, 100) / 100; // up to -1.00
        const high = +(baseHigh + extraHigh);
        const low = Math.max(0.01, +(baseLow - extraLow));
        candles.push({ time, open, close, low, high });
        lastClose = close;
    }
    return candles;
}
