This model uses historical BTC/USD data, moving average strategies, and optional filters to find and optimise trading signals.
How Signals Are Calculated
This model combines technical indicators and risk management rules to generate buy and sell signals. Here’s a breakdown of how each component works:
1. Core Entry & Exit Signals
Moving Average (MA) Crossover: This is the primary signal. A **"Golden Cross"** (the short-term MA crosses above the long-term MA) is a buy signal, suggesting upward momentum. A **"Death Cross"** (short MA crosses below long MA) is a sell signal, indicating waning momentum.
Moving Average Envelope: This creates a channel around the Long MA. A buy signal occurs if the price drops a set percentage below the Long MA, indicating it might be oversold. A sell signal occurs if it rises a set percentage above, suggesting it might be overbought.
2. Risk Management (Highest Priority)
These rules are checked first and will override any other signal to close a position and manage risk.
Stop-Loss (Fixed): A basic but crucial rule. If enabled, a position is automatically sold if the price falls by a fixed percentage from its entry price. This limits potential losses on a trade.
Take-Profit (Fixed): The opposite of a Stop-Loss. It automatically sells a position when it reaches a fixed percentage of profit, ensuring gains are realised.
Trailing Stop-Loss: A dynamic way to protect profits. The sell trigger moves up as the price rises. The position is sold only if the price drops by the specified percentage from its *highest point* since the trade began.
Partial Sell on MA Cross: A hybrid approach. If the price crosses back below the Long MA after a buy, this rule sells 50% of the holding. This secures some profit while allowing the remaining half to potentially grow if the price recovers.
3. Optional Confirmation Filters
When enabled, these add extra conditions that must be met *at the same time* as a primary buy/sell signal for a trade to be executed. They help reduce false signals.
RSI (Relative Strength Index) Filter: A momentum oscillator. An RSI below 30 is often considered "oversold" (potentially a good time to buy), while an RSI above 70 is "overbought" (potentially a good time to sell). This filter ensures you aren't buying into an over-extended market or selling a potentially oversold one.
Bollinger Bands (BB) Filter: These bands create a volatility channel around the price. The middle band is a simple moving average. This filter acts as a 'reversion to the mean' check: a buy signal is only valid if the price is below the middle band, and a sell signal only if it's above.
Volume Filter: This filter confirms a signal with market interest. A trade is only executed if the trading volume on that day is higher than its recent moving average, suggesting stronger conviction behind the price move.
Date Range Selection
Use the slider for quick presets or select dates manually.
Strategy Parameters
This is the main control panel for your trading strategy. Adjust these values to define how the simulation should run.
Initial Investment: The starting amount in USD.
Tax/Service Fee: Percentages deducted from profits.
MA/RSI/BB/Volume Periods: The number of data points (days) used to calculate these indicators. Shorter periods are more sensitive to recent price changes.
Checkboxes: Enable or disable risk management and various indicator filters to see how they affect performance.
Run Simulation Button: Click this to execute a single simulation using the parameters you've set above. The charts below will update to reflect the results of this specific strategy.
Data Preview for Selected Range:
Current Strategy Simulation
This section visualises the performance of the strategy defined in the 'Strategy Parameters' section. The main chart shows the BTC price, moving averages, and buy/sell signals. The smaller charts below display the corresponding RSI and Volume data for the same period.
Fully-Filtered Strategy Simulation
This chart provides a direct comparison by running the exact same simulation as above, but with all filters (RSI, Bollinger Bands, Volume) forcibly enabled. This helps you quickly assess the impact of adding these confirmation layers to your base MA-crossover strategy.
Manual Strategy Optimisation
Instead of testing one strategy at a time, this tool lets you find the best performing Moving Average combination within a range you define. It will test every short MA period against every long MA period in the ranges below. The filters used for this optimisation are based on what is currently selected in the 'Strategy Parameters' section above.
Find Optimum Strategy Button: Click this to start the optimisation process based on the MA ranges you entered. The system will find the most profitable combination and display the results.
Optimum Strategy Chart
This chart visualises the performance of the best strategy found during the manual optimisation process.
Comprehensive Strategy Optimisation
This is the most powerful tool. It performs an exhaustive search by testing multiple combinations of parameters to find the absolute best-performing strategy. Select which filters to include in the optimisation below. The tool will test every on/off state for the selected filters, along with a range of MA periods and Trailing SL values.
Select filters to include in optimisation:
Find Comprehensive Optimum Strategy Button: Click to begin the intensive search. This may take a few moments. The results will include the best parameters, filter settings, performance metrics, and a detailed trade log.
Comprehensive Optimum Strategy Chart
This chart visualises the single best strategy found by the comprehensive optimisation. Below, you can get an AI analysis of this strategy and see a detailed log of every trade it made.
Analyse Optimum Strategy with AI Button: After finding the comprehensive optimum strategy, click this button to send the results to a generative AI. It will provide a qualitative analysis of the strategy's characteristics, potential strengths, and weaknesses based on its performance.
Advanced Analysis: Combining Patterns with Quantitative Signals
While this tool focuses on quantitative signals (mathematical calculations like moving averages), many traders combine this with qualitative analysis, such as identifying chart patterns. The theory is that since markets are driven by human psychology, emotional buying and selling can create recognisable, repeating shapes in the price chart.
Classic Chart Patterns (Fractal Analysis)
These are examples of recurring shapes that traders watch for. Use the dropdown below to see an idealised visualisation of each pattern.
Head and Shoulders: A bearish pattern that can signal a trend reversal from up to down.
Inverse Head and Shoulders: A bullish pattern suggesting a reversal from down to up.
Cup and Handle: A bullish continuation pattern that often signals a consolidation period followed by an upward breakout.
Double Top / Double Bottom: Reversal patterns that suggest a trend is losing momentum and may reverse.
Triangles (Ascending, Descending, Symmetrical): These often signal a period of indecision before the price breaks out, typically in the direction of the preceding trend.
A Powerful Combined Workflow
You can use this tool to add data-driven evidence to your visual pattern analysis:
Visual Identification: First, you visually identify a potential pattern (e.g., a "Cup and Handle") forming on a live chart. This forms your trading hypothesis.
Historical Validation: Find a past instance where a similar pattern occurred. Use the Date Range Selection in this tool to isolate that historical period.
Quantitative Analysis: Run the "Comprehensive Strategy Optimisation" for that specific historical timeframe. The tool will find the most profitable quantitative signals (MA periods, filters, etc.) that worked *during that specific pattern*.
Apply to the Present: You now have a concrete, data-backed strategy (e.g., "a 12/26 day MA crossover with a volume filter"). You can watch the current, live pattern and use the exact signals found by the tool as your confirmation to enter or exit a trade. This combines the "what" (the visual pattern) with the "when" (the data-driven signal).