Back to Home

Final Analysis Documentation

Learn how to use natural language to backtest trading strategies and analyze market probabilities.

Introduction

Final Analysis is a powerful tool that lets you backtest trading strategies using natural language. Simply describe your strategy in plain English, and the system will parse your query, extract the trading parameters, and run a comprehensive backtest on historical market data.

What You Can Do

  • Test trading strategies using technical indicators
  • Analyze probability of market conditions
  • Set entry and exit conditions with stop losses and take profits
  • Upload custom indicators for advanced analysis
  • View detailed performance metrics and trade history

Quick Start

Step 1: Write Your Query

Navigate to the Final Analysis page and enter your trading strategy in natural language. Be specific about:

  • The asset you want to analyze (e.g., BTC, ETH)
  • The timeframe (e.g., 1h, 4h, 1d)
  • Entry conditions (e.g., "RSI crosses above 50")
  • Exit conditions (e.g., "Stop loss 2%, Take profit 5%")
  • Time period (e.g., "last 30 days", "from 1/1/2024 to 3/31/2024")
Buy when RSI crosses above 50 and exit when RSI crosses below 50 for BTC 1D from 1/1/2024 to 3/31/2024

Step 2: Review Parsed Parameters

After clicking "Analyze Query", the system will parse your query and display the extracted parameters. You can:

  • Review the asset, timeframe, and time constraints
  • Check entry and exit conditions
  • Click "Edit Parameters" to modify any values before running the analysis

Step 3: Execute Analysis

Click "Execute Analysis" to run the backtest. The system will:

  1. Load historical market data for the specified period
  2. Calculate all required technical indicators
  3. Evaluate entry and exit conditions on each bar
  4. Simulate trades and calculate performance metrics

Step 4: Review Results

Once the analysis completes, you will see:

  • Performance metrics (win rate, profit factor, Sharpe ratio, etc.)
  • Interactive trading chart with entry/exit markers
  • Trade history table with detailed P&L
  • Equity curve showing account balance over time
  • Option to export results as JSON or CSV

Writing Natural Language Queries

The key to getting accurate results is writing clear, specific queries. Here are the essential components:

Required Information

ComponentDescriptionExample
AssetThe cryptocurrency to analyzeBTC, ETH, SOL
TimeframeChart timeframe1h, 4h, 1d, 1w
Entry ConditionWhen to enter a trade"RSI crosses above 50"
Exit ConditionWhen to exit a trade"Stop loss 2%", "Take profit 5%"
Time PeriodDate range for analysis"last 30 days", "from 1/1/2024 to 3/31/2024"

Pro Tips

  • Be specific: Include asset, timeframe, and date range for best results
  • Use clear language: "Buy when" is better than "if"
  • Specify exit conditions: Always include stop loss or take profit
  • Match timeframes: Use the same timeframe for indicators and backtest

Understanding Results

After running an analysis, you will see comprehensive results. Here is what each section means:

Performance Metrics

MetricDescription
Total Return (%)Overall percentage gain or loss
Win RatePercentage of winning trades
Profit FactorGross profit divided by gross loss (higher is better)
Sharpe RatioRisk-adjusted return measure
Max DrawdownLargest peak-to-trough decline
Expected ValueAverage expected return per trade

Trading Chart

The interactive chart shows:

  • Price candles: OHLC data for the selected timeframe
  • Entry markers: Blue markers showing when entry conditions were met
  • Exit markers: Green (profit) or red (loss) markers showing trade exits
  • Indicators: Technical indicators used in your strategy

Trade History

The trade history table includes:

  • Entry and exit dates/times
  • Entry and exit prices
  • Profit/loss in dollars and percentage
  • Number of bars held
  • Trade direction (long/short)

Editing Parameters

After your query is parsed, you can fine-tune the parameters before running the analysis. This is especially useful for:

  • Adjusting indicator periods
  • Changing threshold values
  • Modifying stop loss or take profit levels
  • Switching between long and short positions
  • Updating time constraints

How to Edit Parameters

  1. Click "Edit Parameters": After your query is parsed, you'll see an "Edit Parameters" button in the top right of the parsed query card.
  2. Expand conditions: Click on any entry or exit condition to expand it and see all its parameters.
  3. Modify values:
    • Use dropdowns to change indicators, operators, or types
    • Use input fields to adjust numeric values (periods, thresholds, etc.)
    • Use checkboxes for boolean options (like "Use ATR")
  4. Save changes: Click "Save Parameters" at the bottom of the card to save your changes.
  5. Execute: Click "Execute Analysis" to run the backtest with your updated parameters.

What You Can Edit

Entry Conditions

  • • Indicator type
  • • Indicator period
  • • Operator (above, below, crosses, etc.)
  • • Threshold value
  • • Direction (long/short)

Exit Conditions

  • • Exit type (stop loss, take profit, etc.)
  • • Percentage or ATR-based values
  • • ATR multiplier
  • • Risk/reward ratio

Parsed Query Attributes Reference

When your query is parsed, the system extracts various attributes that define your trading strategy. This reference explains every attribute you can view and edit in the parsed query display.

General Parameters

AttributeTypeDescription
AssetStringThe cryptocurrency symbol to analyze (e.g., "BTC", "ETH", "SOL")
TimeframeStringChart interval: 1m, 5m, 15m, 1h, 4h, 1d, 1w
Market TypeString"spot" or "futures" - determines which market data to use
Query TypeStringType of analysis: "backtest", "probability", or "analysis"
Execution TypeStringWhen trades execute: "bar_close" (default) or custom execution price

Time Constraint

AttributeTypeDescription
TypeString"relative" (e.g., "last 30 days") or "absolute" (specific dates)
ValueStringTime period description (e.g., "30 days", "3 months")
Start DateDateBeginning of the analysis period (calculated or specified)
End DateDateEnd of the analysis period (default: today)
DaysNumberNumber of days in the period (for relative constraints)

Entry Conditions Sequence

Controls how multiple entry conditions work together

AttributeTypeDescription
SequentialBoolean
false (AND logic): All conditions must be true simultaneously on the same bar
true (THEN logic): Conditions must occur in sequence order within timeout window
Sequence TimeoutNumberMaximum bars between sequential conditions (default: 50)

Entry Condition Attributes

Each entry condition can have the following attributes:

AttributeTypeDescription
IndicatorStringThe technical indicator to evaluate (e.g., "rsi", "ema", "macd", "price")
OperatorStringComparison type: "above", "below", "crosses_above", "crosses_below", etc.
ThresholdNumberValue to compare against (e.g., RSI threshold of 50)
Threshold TypeString"absolute" (fixed value) or "percentage" (relative value)
PeriodNumberIndicator calculation period (e.g., EMA-20 uses period=20)
DirectionString"long" (buy signal) or "short" (sell signal)
Compare To IndicatorStringFor cross comparisons (e.g., "price above ema" → compareToIndicator="ema")
Compare To PeriodNumberPeriod of the comparison indicator (e.g., EMA-50 → compareToPeriod=50)
Sequence IndexNumberOrder in sequence (0, 1, 2...) - only set when Sequential=true
Needs Reference PointBooleanWhether this condition requires a reference price/point to evaluate

Exit Conditions Sequence

Controls how multiple exit conditions work together

AttributeTypeDescription
SequentialBoolean
false (OR logic): First condition to trigger exits the trade
true (THEN logic): Conditions must trigger in order (e.g., "MACD crosses above 0 then back below 0")
Sequence TimeoutNumberMaximum bars between sequential exit triggers (default: 50)

Exit Condition Attributes

Each exit condition can have the following attributes:

AttributeTypeDescription
TypeString"stop_loss", "profit_target", "indicator_signal", "time_exit"
IndicatorStringFor indicator-based exits (e.g., "price", "rsi", "macd")
OperatorStringComparison type for indicator exits
Value/ThresholdNumberFor percentage SL/TP: percentage value (e.g., 2 for 2%). For indicator exits: threshold value
Use ATRBooleanWhether to use ATR (Average True Range) for dynamic SL/TP
ATR MultiplierNumberMultiplier for ATR-based SL/TP (e.g., 2 for 2×ATR)
ATR PeriodNumberPeriod for ATR calculation (default: 14)
Risk/Reward RatioNumberFor TP: multiple of stop loss distance (e.g., 3 for 3:1 RR)
Preceding BarsNumberFor SL based on recent price action (e.g., "lowest low of 3 preceding candles")
Position DirectionString"long" or "short" - which position type this exit applies to
Reference PointStringPrice reference for dynamic exits (e.g., "entry_price", "swing_high")
Sequence IndexNumberOrder in sequence (0, 1, 2...) - only set when Sequential=true
Lookforward BarsNumberTime-based exits: close position after N bars (rarely used)

Quick Reference Examples

Non-Sequential Entry (AND):

"Price above EMA-50 AND RSI above 50" → Both must be true on same bar

Sequential Entry (THEN):

"Price crosses above EMA-50 THEN RSI crosses above 50" → Must happen in order within 50 bars

Non-Sequential Exit (OR):

"Stop loss 2% OR Take profit 5%" → First to trigger exits the trade

Sequential Exit (THEN):

"MACD crosses above 0 THEN back below 0" → Second cross only exits if first happened within 50 bars

Built-in Indicators

The system supports a wide range of technical indicators. Here is a complete reference:

IndicatorDefault PeriodDescriptionCommon Usage
RSI14Relative Strength Index (0-100)Oversold (<30), Overbought (>70)
EMA20Exponential Moving AverageTrend following (9, 12, 21, 50, 200)
SMA20Simple Moving AverageTrend following (5, 10, 20, 50, 200)
MACD12,26,9Moving Average Convergence DivergenceMomentum and trend changes
Bollinger Bands20,2Volatility bandsOverbought/oversold levels
ATR14Average True RangeStop loss/take profit sizing
Supertrend14,3.0Trend-following indicatorTrend direction and reversals
Williams %R14Momentum oscillatorOverbought/oversold conditions
VWAP14Volume Weighted Average PriceIntraday support/resistance
Swing High/LowN/APrice structure levelsBreakout/breakdown detection
FibonacciN/ARetracement levelsSupport/resistance, price targets
Volume ProfileN/AVolume distributionPOC, Value Area High/Low
PriceN/ACurrent pricePrice comparisons and breakouts
VolumeN/ATrading volumeVolume analysis
Open InterestN/AFutures open interestMarket sentiment analysis

Operators

Operators define how indicators are compared. Here are the available operators:

Comparison Operators

OperatorDescriptionExample Query
Above / Greater ThanValue is greater than threshold"RSI above 50"
Below / Less ThanValue is less than threshold"RSI below 30"
EqualsValue equals threshold"RSI equals 50"
Not EqualsValue does not equal threshold"RSI not equals 50"

Crossing Operators

OperatorDescriptionExample Query
Crosses AboveValue crosses above threshold"RSI crosses above 50"
Crosses BelowValue crosses below threshold"Price crosses below EMA 20"

Note: Crossing operators detect actual crosses by comparing the current bar to the previous bar. This ensures accurate signal detection.

Special Operators

OperatorDescriptionExample Query
Deviation AbovePercentage above indicator"Price 10% above EMA"
Deviation BelowPercentage below indicator"Price 5% below SMA"
Divergence BullishBullish divergence pattern"RSI bullish divergence"
Divergence BearishBearish divergence pattern"RSI bearish divergence"
Touches Upper/LowerTouches band (Bollinger Bands)"Price touches upper Bollinger Band"
ReachesPrice reaches indicator value (for exits)"Take profit at swing high"

Note: The "reaches" operator is specifically used for exit conditions when you want to take profit or stop loss at a dynamic indicator level.

Entry & Exit Conditions

Entry Conditions

Entry conditions define when to enter a trade. You can specify multiple conditions, and they will be combined with AND logic (all must be true).

Buy when RSI crosses above 50 AND price breaks out of swing high for BTC 1D

This creates two entry conditions that must both be met simultaneously.

Sequential Conditions

You can also create sequential conditions that must happen in order using keywords like "then", "after", or "wait for":

First RSI crosses above 50, then price breaks above EMA 20 before entering long

Sequential conditions have a timeout (default 50 bars) to prevent waiting indefinitely.

Exit Conditions

Exit conditions determine when to close a position. Multiple types are supported:

TypeDescriptionExample
Stop LossPercentage or ATR-based loss limit"SL 2%" or "SL 2 ATR"
Take ProfitPercentage or ATR-based profit target"TP 5%" or "TP 3 ATR"
Risk/Reward RatioTake profit based on stop loss distance"TP 3RR" (3:1 risk/reward)
Indicator-Based ExitsStop/profit at indicator value"stop below ATR trailing stop"
Indicator SignalExit based on indicator condition"Exit when RSI crosses below 50"

Risk/Reward Ratio (RR)

Use Risk/Reward ratios to automatically calculate profit targets based on your stop loss distance:

How it works:

Take Profit = Entry ± (Stop Loss Distance × RR Ratio)

Buy BTC when RSI > 30, SL 2%, TP 3RR for last 30 days

If entry is $50,000 with 2% SL ($1,000 risk), TP will be at $53,000 (3× $1,000 = $3,000 reward).

Indicator-Based Exits

Set your stop loss or take profit at dynamic indicator values that move with the market:

Stop Loss at Indicator:

Buy when RSI > 50, stop below ATR trailing stop

Stop loss trails the ATR trailing stop indicator value.

Take Profit at Indicator:

Buy BTC, take profit at swing high

Exit when price reaches the swing high level.

Supported indicators: ATR Trailing Stop, SuperTrend, Swing High/Low, EMA/SMA, Fibonacci, and custom indicators.

ATR-Based Exits

Using ATR (Average True Range) for stop loss and take profit adapts to market volatility:

Buy when price breaks out of swing high SL 2 ATR TP 3RR for BTC 1D

This means: Stop loss at 2× ATR below entry, Take profit at 6× ATR above entry (3:1 risk/reward ratio).

Custom Indicators

You can upload your own custom indicators via CSV files. This allows you to use proprietary indicators or indicators not available in the built-in list.

CSV Format

Your CSV file should have one of these formats:

Format 1: Timestamped (Recommended)

timestamp,value
2024-01-01T00:00:00Z,45.2
2024-01-01T04:00:00Z,48.3
2024-01-01T08:00:00Z,52.1

Format 2: Multi-plot (for indicators with multiple values)

timestamp,histogram,macd_line,signal_line
2024-01-01T00:00:00Z,12.5,245.6,233.1
2024-01-01T04:00:00Z,15.2,248.3,235.2

Format 3: Index-based (no timestamps)

value
45.2
48.3
52.1

Using Custom Indicators

  1. Reference your custom indicator in your query using its name (e.g., my_custom_signal)
  2. After parsing, the system will detect the custom indicator and prompt you to upload a CSV file
  3. Upload your CSV file with a name matching the indicator name in your query
  4. The system will align your CSV data with market data timestamps and use it in the analysis
Enter long when my_custom_signal crosses above 50 for BTC 1D last 30 days

Limitations

  • Maximum file size: 10MB per CSV
  • Maximum files: 5 per request
  • Format: CSV only
  • Timestamp alignment tolerance: 1 minute

Examples

Example 1: Simple RSI Strategy

Buy when RSI crosses above 50 and exit when RSI crosses below 50 for BTC 1D from 1/1/2024 to 3/31/2024

This strategy enters long when RSI crosses above 50 and exits when RSI crosses back below 50.

Example 2: Breakout with Stop Loss

Buy when price breaks out of swing high and RSI is above 50 SL 2 ATR TP 3RR for BTC 1D starting from 1/1/2024 to march 2024

Enters on breakout above swing high with RSI confirmation. Uses ATR-based stop loss and 3:1 risk/reward ratio for take profit.

Example 3: EMA Crossover

Buy when 12 EMA crosses above 21 EMA for BTC 1H last 30 days

Classic moving average crossover strategy on 1-hour timeframe.

Example 4: Sequential Conditions

When EMA 12/21 crossover happens, then price moves 2 ATR away, then retest EMA 12 before entering long

Three sequential conditions: first crossover, then price movement, then retest before entry.

Example 5: Probability Analysis

What is the probability of BTC making a new high after RSI drops below 30 in the last 90 days?

Analyzes the probability of a specific market outcome rather than executing trades.

Monte Carlo Analysis

Monte Carlo simulation enhances backtest results by running thousands of randomized simulations to understand the probability distribution of possible outcomes.

What is Monte Carlo Simulation?

When you run a backtest with 10 or more trades, the system automatically performs Monte Carlo analysis by:

  1. Resampling your actual trades in random order (1000 simulations)
  2. Calculating equity curves for each simulation
  3. Generating confidence intervals and risk metrics
  4. Identifying worst-case and best-case scenarios

Key Metrics Explained

MetricDescription
Probability of RuinPercentage chance of losing 50% or more of your capital
95% Confidence IntervalRange where 95% of all simulation outcomes fall
5th Percentile ReturnWorst-case scenario (95% of outcomes are better than this)
95th Percentile ReturnBest-case scenario (95% of outcomes are worse than this)
Max Consecutive Losses (95th %ile)Worst-case streak of losing trades you might experience
Max Drawdown (95th %ile)Largest peak-to-trough decline in 95% of simulations

Interpreting the Equity Curve Chart

The Monte Carlo equity chart displays:

  • Dark band (25th-75th percentiles): Where 50% of simulation outcomes fall
  • Light band (5th-95th percentiles): Where 90% of simulation outcomes fall
  • Median line (50th percentile): The most likely outcome

Pro Tip: A wide confidence interval suggests higher variance in results. Strategies with tighter bands are more predictable.

When Monte Carlo Runs

Monte Carlo simulation automatically runs when your backtest generates 10 or more trades. If you have fewer trades, you'll see a message explaining that more trades are needed for meaningful statistical analysis.

Advanced Exit Conditions

Beyond basic percentage-based stops and targets, you can use advanced exit conditions including Risk/Reward ratios and indicator-based exits.

Risk/Reward Ratios (RR)

Instead of specifying exact take profit percentages, you can use Risk/Reward ratios to automatically calculate profit targets based on your stop loss distance.

How it Works:

  • Set your stop loss (e.g., "SL 2 ATR" or "stop loss 2%")
  • Specify RR ratio (e.g., "TP 3RR" means 3:1 risk/reward)
  • System calculates: Take Profit = Entry ± (Stop Loss Distance × RR Ratio)
Buy BTC when RSI > 30, SL 2%, TP 3RR for last 30 days

If entry is $50,000 with 2% stop loss ($1,000 risk), take profit will be at $53,000 (3× the $1,000 risk = $3,000 reward).

Long when MACD crosses above 0, SL 2 ATR, TP 2RR

ATR-based stop loss with 2:1 risk/reward ratio for take profit.

Indicator-Based Exits

Set your stop loss or take profit at dynamic indicator values that move with the market.

Stop Loss at Indicator

Place stop loss below/above an indicator value:

Buy when RSI > 50, stop below ATR trailing stop

Stop loss will trail the ATR trailing stop indicator value.

Long when price breaks swing high, SL below SuperTrend

Stop loss placed at the SuperTrend indicator level.

Short when EMA 12 crosses below EMA 21, stop above EMA 50

For short positions, stop is placed above the EMA 50.

Take Profit at Indicator

Exit when price reaches an indicator level:

Buy BTC, take profit at swing high

Exit when price reaches the swing high level.

Long when RSI crosses 50, TP at fibonacci 0.618

Take profit at the 0.618 Fibonacci retracement level.

Buy on breakout, SL 2 ATR, take profit at EMA 200

Combines ATR-based stop with indicator-based profit target.

Supported Indicators for Exits

  • ATR & ATR Trailing Stop
  • SuperTrend
  • Swing High / Swing Low
  • EMA / SMA (any period)
  • Fibonacci Levels
  • Custom Indicators (from uploaded CSV)

Combining Exit Strategies

You can mix different exit types for sophisticated risk management:

Buy when RSI > 50 and MACD crosses above 0, stop below ATR trailing stop, TP 3RR for BTC 4H last 60 days

Indicator-based trailing stop with RR-based profit target.

Strategy Sharing

Share your successful strategies with beautiful, branded strategy cards that showcase your backtesting results.

What's Included in Strategy Cards

When you export a strategy, the generated image includes:

Performance Metrics

  • • Total Return %
  • • Win Rate
  • • Number of Trades
  • • Profit Factor
  • • Sharpe Ratio
  • • Max Drawdown

Strategy Details

  • • Asset & Timeframe
  • • Entry Conditions
  • • Exit Conditions
  • • Testing Period
  • • Text-to-Quant Branding

How to Share Your Strategy

  1. Run Your Analysis: Complete a backtest with your trading strategy
  2. View Results: Navigate to the analysis results page or history drawer
  3. Click Share: Look for the "Share Strategy" button near your results
  4. Download or Share:
    • Download as PNG image
    • Share directly to social media
    • Copy to clipboard

Best Practices for Sharing

Share on the Right Platform:

Twitter/X and Discord are great for trading strategy discussions

Add Context:

Include a brief description of your strategy's logic when sharing

Acknowledge Limitations:

Mention that past performance doesn't guarantee future results

Disclaimer

Strategy cards are for educational and discussion purposes only. Always include appropriate disclaimers when sharing trading strategies on social media. Strategy performance is based on historical data and does not guarantee future results.

Best Practices

Query Writing Tips

  • Be specific: Always include asset, timeframe, and date range for accurate results
  • Use clear language: "Buy when" is clearer than "if" or conditional statements
  • Always specify exit conditions: Include stop loss or take profit to manage risk
  • Match timeframes: Use the same timeframe for indicators and backtest period
  • Test incrementally: Start with simple strategies and add complexity gradually

Interpreting Results

  • Win rate alone isn't enough: Consider profit factor, Sharpe ratio, and max drawdown
  • Look for consistency: Check if results are consistent across different time periods
  • Review individual trades: Examine the trade history to understand when the strategy works and when it doesn't
  • Consider market conditions: Results may vary in different market environments (trending vs. ranging)

Common Mistakes to Avoid

  • ❌ Forgetting to specify exit conditions (leads to unrealistic results)
  • ❌ Using mismatched timeframes (e.g., daily indicators on hourly data)
  • ❌ Over-optimizing on a single time period (test on multiple periods)
  • ❌ Ignoring transaction costs and slippage in your analysis
  • ❌ Not reviewing the actual trade execution on the chart

Need help? Contact support or check the FAQ section.