📖 Welcome to Queyn

Queyn is a forex simulation platform that lets you create custom market scenarios and test trading strategies in realistic conditions.

💡 Tip: This documentation will guide you through all features and help you understand the platform.

1. Quick Start

Queyn simulates the EUR/USD currency pair, generating 1-minute (M1) candles with realistic price movements.

Main Concept

Get started in just a few steps:

  1. Set your Candle Limit — choose the full 1440 candles (24 hours) or a custom amount (2-1439 candles)
  2. Configure your Starting Balance to match your trading capital
  3. Adjust Market Parameters to shape your scenario (volatility, trends, liquidity stress)
  4. Click "Start Scenario" to begin the simulation
  5. Use the controls to Pause, Resume, or Regenerate your scenario
💡 Tip: Try adjusting one parameter at a time (like volatility or trend direction) to understand its direct impact on price action.

Queyn also includes a special template session that simulates the 4-hour NY/London overlap period (8:00-12:00 EST - 240 candles). This preset captures the realistic price dynamics of these peak trading hours.

Additional Features

Queyn provides comprehensive tools to test and refine your trading strategies:

Balance Management
Set and adjust your starting balance at any time during simulation
Position Management
Open long/short positions with risk controls, stop loss, take profit, margin monitoring, and portfolio risk limits
Technical Indicators
Add EMAs, RSI, MACD and Bollinger Bands to your charts
Drawing Tools
Plot trendlines, support/resistance levels, and custom annotations
Data Export
Download scenario data in CSV or JSON formats for analysis
Bot API
Stream real-time price data to your automated trading bots via WebSocket

2. Foundation

Simulation-Based Learning

Practice trading without real money risk in controlled environments. Test strategies, learn market dynamics, and build confidence before risking capital in live markets.

Parametric Market Control

Control market conditions rather than being subject to random real markets. Adjust volatility, trends, and liquidity stress to create specific scenarios for targeted strategy testing.

Realistic Market Dynamics

Practice on dynamic bid-ask spreads that widen and narrow based on liquidity stress levels. Spreads expand when liquidity stress increases and tighten when stress decreases.

Synthetic Data Generation

Generate synthetic market data to complement backtesting. Create custom scenarios for specific market conditions that may be rare or absent in historical datasets, and fill the gaps in your testing coverage.

Configurable Scenarios

Create scenarios with precise parameter configurations for targeted testing. Simulate diverse market conditions on demand to test your strategies across multiple environments and avoid overfitting to a single scenario type.

Stochastic Variation

Run the same parameters multiple times to generate varied price paths while maintaining consistent market dynamics. Test your strategy across statistically similar but unique outcomes to ensure robustness.

3. Scenario Builder

User-Defined Parameters

Candle Limit

Choose how many 1-minute candles your scenario will generate:

  • Maximum Limit: 1440 candles (24 hours)
  • Custom Limit: 2-1439 candles (customize duration)
📒 Note: In Queyn, each candle represents 1 minute of market data.

Speed Mode

Control how fast the scenario runs:

  • Real-Time (x1): One candle per minute
  • Fast Mode (x5): 5x faster generation
  • Ultra Fast (x10): 10x faster generation

Market Parameters

Liquidity Stress
Controls spread widening and market depth. Higher values create more challenging trading conditions with wider spreads.

Bullish Trend
Weight towards upward price movement. Higher values increase the likelihood of bullish candles.

Bearish Trend
Weight towards downward price movement. Higher values increase the likelihood of bearish candles.

Ranging (Auto-calculated)
Automatically calculated as: 100% - Bullish% - Bearish%
Represents sideways/consolidation market behavior.

Volatility
Controls price movement magnitude. Higher values create larger candle bodies and wicks.

Tick Frequency
Controls how many price ticks occur per candle. Higher values create more granular price action.

💡 Tip: For crash testing, set either Bullish or Bearish trend to ~100%, Volatility to ~100%, and Liquidity Stress to ~100% to simulate extreme market conditions.
💡 Tip: For calm market periods, set Liquidity Stress to ~0% and Volatility to ~0% to create stable, low-movement conditions.

Template Session

Queyn includes a special template session that simulates the 4-hour NY/London overlap period (8:00-12:00 EST - 240 candles). This preset captures the realistic price dynamics of these peak trading hours with increased volatility and liquidity.

Activation

The NY/London session can be activated before starting a scenario or applied during a running custom scenario. Once activated, all user-defined parameters become locked and cannot be manually adjusted.

Session Variability

Each activation generates a completely unique session. Stopping and restarting, regenerating, or resetting and reactivating will produce a different NY/London session with new price dynamics.

Real-Time Validation

The session displays real-time statistical indices (Skewness and Kurtosis) that validate the generated model's behavior during execution.

💡 Tip: Statistics may fluctuate during generation—this variability is natural and also observed in real market data.

Save Scenario

Save generated scenarios to review later and build your own library.

When Scenarios Are Saved

  • Candle Limit Reached: Automatic save prompt when scenario completes
  • Manual Stop: Save prompt appears when you stop or regenerate a running scenario
  • Switching: Option to save current progress before loading a saved scenario
⚠️ Warning: Refreshing the page, logging out, or closing the browser clears any unsaved scenario in progress.

Keyboard Shortcuts

Spacebar
Pause/Resume scenario
Shift + 1
Real-Time speed (x1)
Shift + 5
Fast Mode (x5)
Shift + 0
Ultra Fast (x10)
Scroll Wheel
Pan vertically (price)
Shift + Scroll
Pan horizontally (time)
Ctrl + Scroll
Zoom in/out
Arrow Keys
Navigate chart

4. Strategy Builder

Technical Indicators

Technical indicators are mathematical calculations based on price data that help identify trends, momentum, and potential entry/exit points.

Exponential Moving Average (EMA)

Weighted moving average that gives more importance to recent prices. Available periods: 5, 10, 20, and 50.

How it works: Takes the current price and the previous EMA value, then applies a weighting factor to emphasize recent price changes. Shorter periods (like EMA-5) react faster to price changes than longer periods (like EMA-50).

💡 Tip: When a faster EMA (like EMA-5) crosses above a slower EMA (like EMA-20), it often signals an upward trend beginning. When the fast EMA crosses below the slow EMA, it may signal a downward trend.

Relative Strength Index (RSI)

Momentum oscillator measuring the speed and magnitude of price changes. Values range from 0-100, with readings above 70 indicating overbought conditions and below 30 indicating oversold conditions.

How it works: Compares the average size of recent price gains to the average size of recent price losses over the last 14 candles. When gains consistently outweigh losses, RSI moves toward 100. When losses dominate, RSI moves toward 0.

MACD (Moving Average Convergence Divergence)

Trend-following momentum indicator showing the relationship between two moving averages. Consists of three components: MACD line, Signal line, and Histogram.

How it works: Compares a fast-moving average (12 periods) with a slow-moving average (26 periods). When the fast average crosses above the slow average, it signals upward momentum. The histogram shows the strength of this signal.

Bollinger Bands

Volatility indicator consisting of three lines that expand and contract based on price volatility. Includes a middle band (20-period average) with upper and lower bands.

How it works: The bands widen during volatile periods and narrow during calm periods. Price touching the upper band may indicate overbought conditions, while touching the lower band may indicate oversold conditions. Most price action occurs within the bands.

Drawing Tools

Visual analysis tools for marking key price levels and identifying patterns directly on the chart.

Why Use Drawing Tools?

Available Tools

Position Management

Execute and monitor trading positions with integrated risk controls and real-time profit/loss tracking.

Activation

Enable Position Management by activating Strategy Mode from the panel toggle. Once active, you can configure your trading setup.

Trading Configuration

Balance Options: Choose your starting capital from preset amounts: €1,000, €10,000, or €100,000.

Commission: Set the round-trip commission cost per lot. This represents the total cost to open and close a position.

Leverage: Select leverage ratio from 1:1 to 1:100, or trade without leverage. Higher leverage increases position size but also increases risk.

Opening Positions

Position Types:

Risk Configuration: Set your risk as a percentage of your current balance (0.1% - 5%). The system automatically calculates the appropriate lot size based on your risk percentage and stop loss distance.

Stop Loss (Required): Set your maximum loss in pips (5-500 pips). This determines your position size based on your risk percentage.

Take Profit (Optional): Set your profit target in pips (5-1000 pips). The system displays your reward:risk ratio when enabled.

📒 Note: Position opening is only available when a scenario is running.
📖 Lot Size & Margin: One standard lot is 100,000 units of base currency (notional value of the position). Margin is the amount of your balance reserved as collateral to keep the position open - it's not spent, just locked and must be available in your balance. Once you close the position, the margin is released back. Margin Required = (Lot Size × 100,000) ÷ Leverage. Example: 0.10 lot with 1:30 leverage requires €333 available margin.

Position Execution

When a position opens, two costs apply immediately:

Visual Indicators: Open positions display on the chart with colored markers showing entry price, stop loss level, and take profit level (if set).

💡 Tip: Shaded areas between entry and stop loss/take profit levels show your risk and reward zones. Overlapping positions create darker shading, helping you identify concentrated risk areas or high-reward zones at a glance.

Risk Rules

📖 Balance vs Equity: Balance = realized P&L only (closed positions). Equity = Balance + unrealized P&L (open positions). New position risk % uses balance; margin and portfolio limits use equity.

Per-Position Risk: Maximum 5% of your current balance per trade. Your risk percentage determines lot size: Risk Amount = Balance × Risk% ÷ Stop Loss Distance.

Portfolio Risk Limit: Total risk exposure across all open and pending positions cannot exceed 10% of your equity. Equity = Balance + Unrealized P&L of all open positions.

Margin Requirements: Each position requires margin based on leverage. Available Margin = Current Equity - Used Margin. New positions require sufficient available margin.

Position Modification

Open and pending positions can be modified to adjust stop loss and take profit. Lot size cannot be changed once a position is created. Entry price can only be modified for pending limit orders, and must follow limit order rules (Buy below Ask, Sell above Bid).

Modification Rules:

Balance Management

Dynamic Balance: Your balance updates only when positions close. Realized P&L (profits or losses) immediately affects your available balance for new positions.

Balance Floor: Balance can drop to €0 but never goes negative. At zero balance, position creation is disabled until you reconfigure.

📏 Note: The reconfigurable balance feature is designed for educational purposes, allowing you to practice with different capital levels and explore various risk management strategies.

Reconfiguration

Your trading configuration persists across sessions, allowing you to:

To modify your settings:

  1. Click "Reconfigure" to unlock your configuration
  2. Adjust balance, commission, or leverage as needed
  3. Lock the new configuration to apply changes
⚠️ Stopping a Scenario: When you stop a scenario with open positions, all positions close at current market prices and final P&L is applied to your balance.
⚠️ Session Interruptions: Logging out, refreshing the page, or deactivating Strategy Mode removes all open positions without closing them. Your balance and configuration revert to the last locked state.
💡 Best Practice: Always stop the scenario properly before logging out or refreshing to ensure positions close correctly and your balance updates accurately.

5. Data Export

Export scenario data as it generates in real-time, or download it after completion. Use it for AI training, backtesting, research, or whatever analysis you need.

Queyn focuses on market dynamics rather than absolute price levels.

Why Dynamics, Not Raw OHLC?

Queyn focuses on what actually matters for trading: dynamics, momentum, and rate changes. Raw OHLC prices add unnecessary complexity - you'll never see those exact price levels again in the market.

All scenarios start at normalized prices around 1.08500. Instead of absolute prices, you get the metrics that capture real market behavior: percentage returns, volatility swings, and spread fluctuations. These patterns repeat across different price levels and time periods.

By removing the complexity of absolute pricing, you can focus on recognizing behavioral patterns that are actually tradable and reusable in your strategies.

Export Metrics

Export Formats

CSV Format

Clean tabular data for spreadsheets and analysis tools:

Timestamp,PriceReturn,PriceSwing,Spread,SpreadChange
            2025-01-15T09:00:00.000Z,0.000234,0.000156,0.89,0.0234
            2025-01-15T09:01:00.000Z,-0.000187,0.000203,0.92,0.0337
            2025-01-15T09:02:00.000Z,0.000145,0.000178,0.88,-0.0435
            ...

JSON Format

Structured data with metadata for programmatic processing:

{
            "metadata": {
                "exportTime": "2025-01-15T12:34:56.789Z",
                "recordCount": 1440,
                "columns": ["timestamp", "priceReturn", "priceSwing", "spread", "spreadChange"],
                "description": "Price and spread dynamics from QuenFX scenario",
                "version": "1.0"
            },
            "data": [
                {
                "timestamp": "2025-01-15T09:00:00.000Z",
                "priceReturn": 0.000234,
                "priceSwing": 0.000156,
                "spread": 0.89,
                "spreadChange": 0.0234
                },
                ...
            ]
            }

How to Export

  1. Complete a scenario or view a saved scenario
  2. Open the Strategy Builder panel in the right sidebar
  3. Click "Export Data"
  4. Choose your format: CSV or JSON
  5. Download begins automatically
📖 Use Cases: Train machine learning models, backtest trading strategies, analyze spread patterns, study volatility clustering, build statistical arbitrage systems, or conduct academic research on market microstructure.

6. Bot API

Connect your trading bots or algorithmic systems to receive real-time price data via WebSocket. The Bot API streams live tick data and candle updates as scenarios generate.

API Key Management

Generating API Keys

  1. Click "Connect Trading Bot" in the right panel
  2. Click "+ Generate New API Key"
  3. Enter a descriptive name (e.g., "Python Trading Bot")
  4. Click "Generate"
  5. Copy and save your API key immediately - it won't be shown again
🔒 Security: Never share your API keys publicly. Store them in environment variables or secure credential managers. Anyone with your key can access your data stream.

Subscription Tiers

Free Tier
  • 300 candles per day (resets every 24 hours)
  • 300 candles per scenario
  • 3 saved scenarios
  • 1 bot API key
  • 1 concurrent bot connection
Pro Tier

Starting at $19.99/month or $199/year (pricing varies by region)

  • Unlimited candles per day
  • 1,440 candles per scenario
  • 30 saved scenarios
  • 3 bot API keys
  • 5 concurrent bot connections

Upgrade in Settings → Billing

Revoke unused keys to generate new ones if you reach your limit.

Key Status

WebSocket Connection

Connect to the WebSocket endpoint with your API key:

wss://api.queyn.com/bot?key=YOUR_API_KEY

Message Format

The server streams real-time price updates in JSON format:

{
            "type": "tick",
            "data": {
                "bid": 1.08534,
                "ask": 1.08544,
                "spread": 1.0,
                "timestamp": 1697123456789
            }
            }

Python Example

Basic WebSocket client using the websocket-client library:

import websocket
            import json

            def on_message(ws, message):
                data = json.loads(message)
                if data['type'] == 'tick':
                    bid = data['data']['bid']
                    ask = data['data']['ask']
                    print(f"Bid: {bid}, Ask: {ask}")

            def on_error(ws, error):
                print(f"Error: {error}")

            def on_close(ws, close_status_code, close_msg):
                print("Connection closed")

            def on_open(ws):
                print("Connected to Queyn Bot API")

            # Replace YOUR_API_KEY with your actual key
            ws = websocket.WebSocketApp(
                "wss://api.queyn.com/bot?key=YOUR_API_KEY",
                on_message=on_message,
                on_error=on_error,
                on_close=on_close,
                on_open=on_open
            )

            ws.run_forever()

Revoking Keys

To revoke an API key:

  1. Open the Bot API panel
  2. Find the key you want to revoke
  3. Click "Revoke Key"
  4. Confirm the action

Revoked keys are moved to a separate "Revoked Keys" section and cannot be reactivated. Any bots using a revoked key will be disconnected immediately.

💡 Tip: Use descriptive names for your keys to easily identify which bot or system each key is used for. This makes management easier when you have multiple keys active.
📖 Integration Use Cases:
  • Real-time strategy testing with live data
  • Training reinforcement learning models
  • Building custom trading indicators
  • Market microstructure analysis

7. Frequently Asked Questions

How realistic is the price data?

Queyn simulates EUR/USD market dynamics including responsive spreads, momentum patterns, and volatility clustering that mirror the pair's statistical behavior. Each scenario generates unique price sequences that capture key forex behaviors - spreads widen during stress, volatility clusters naturally, and prices show both momentum and mean reversion.

The value is in generating diverse training conditions instantly. Professional traders wait years to encounter rare market scenarios. Queyn lets you create volatility spikes, liquidity crises, and trend reversals on demand, then test how your strategy responds.

Like all synthetic data, it's designed to supplement, not replace historical testing. Use it to stress-test strategies across conditions that may not exist in your historical dataset, train pattern recognition on varied regimes, and avoid overfitting to specific past sequences.

💡 Professional Workflow: Generate diverse scenarios continuously as you develop and refine your strategy. Test each iteration against varying volatility, liquidity stress, and trend conditions to ensure robustness across market regimes - not just fitting to historical patterns.

Why use synthetic data when historical data exists?

Historical data has limitations for training and testing:

How do I validate if my generated data is realistic?

Here are some validation strategies:

The NY/London Overlap template session is validated against empirical forex behavior using:

Where:

Real-time statistics display these metrics during generation, confirming data quality against established forex patterns.

💡 Best Practice: Generate multiple scenarios with varied parameters, then compare their statistical properties to your historical data. Good synthetic data should show similar distributions without perfectly matching specific historical sequences.

How do I train my algorithm using Queyn data?

Technical Approach

  1. Generate Training Scenarios: Create scenarios with different parameter combinations (varying volatility, trend strength, liquidity stress)
  2. Export Data: Download CSV or JSON exports with dynamics metrics (returns, swings, spreads)
  3. Feature Engineering: Use the exported metrics (priceReturn, priceSwing, spreadChange) as model features or create derived features
  4. Split Data: Use 70% of scenarios for training, 30% for validation
  5. Cross-Validation: Test your model across different volatility regimes to ensure robustness

Strategic Approach

📖 Training Philosophy: Don't aim to predict specific price levels. Instead, train your algorithm to recognize behavioral patterns: how momentum builds, how volatility clusters, how spreads respond to stress, and how markets mean-revert. These dynamics transfer from synthetic to real data.

Can I use this for live trading signals?

No. Queyn is designed for educational purposes, strategy development, and testing—not for generating live trading signals. The data simulates realistic market behavior but cannot predict actual future price movements.

Use Queyn to:

Once your strategy shows promise in Queyn testing, validate it thoroughly with historical data and paper trading before considering live deployment.

⚠️ Important: Synthetic data performance does not guarantee real market results. Always validate strategies with actual historical data and never risk capital without proper testing.

How often should I regenerate training data?

Continuously throughout your development process. Think of Queyn as a testing lab, not a one-time data download.

Regeneration Schedule:

The goal is iterative validation. Each strategy modification should face new market conditions to ensure robustness rather than overfitting to previously generated data.

💡 Best Practice: Keep a log of which parameter combinations you've tested. This prevents repeatedly testing similar conditions and helps identify which market regimes your strategy hasn't faced yet.