DNYL . SPACE

As motivation plays a crucial role in reaching these goals.

Tag Archive : out-of-sample (OOS)

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Topic-Based Filter VS. Mixed Criteria Filter #1

I apply a topic based filter here, sorting by the best IS, followed by the best OOs in that topic. The result is in the topic @Expert Advisor Performance Review Or do I apply a topic based filter by IS, followed by OOs that focus on something unrelated to the main topic? For example, filtering for the best Stability IS, followed by the second best Profits Factor or Cagr/dd%?
It sounds like you’re considering two different approaches to filtering your strategies. Here’s a breakdown of both methods:

  1. Topic-Based Filter:

    • Sort by the best IS (Importance Score) in a specific topic first, followed by sorting by the best OOs (Out-of-Sample performance) within that same topic.
    • This approach ensures that you focus on strategies that are not only well-ranked within the same criteria but also relevant to a specific trading theme or topic. It can help you build a coherent portfolio centered on a particular strategy style or market condition.
  2. Mixed Criteria Filter:

    • Filter by the best Stability IS, followed by the second-best Profit Factor or CAGR/Max DD% that may not necessarily relate to the initial Stability topic.
    • This approach allows for more diversification in your selection process, potentially leading to a more balanced portfolio. It could help in identifying strategies that excel in different areas, even if they are not directly related.

Recommendation:

  • If your goal is to create a focused portfolio centered on a specific trading philosophy or market condition, the first method (topic-based filter) is likely more effective.

  • If you aim to have a diverse portfolio with strategies excelling in various performance metrics, the second method (mixed criteria filter) would be beneficial.

Consider your overall strategy and objectives when deciding which filtering method to apply…

If you’re opting for the Mixed Criteria Filter with one selection for each filter, you can prioritize the metrics based on what is most critical for your trading strategy. Here’s a suggested approach:

  1. First Filter (IS): Choose the metric that aligns best with your trading goals and risk tolerance. Here are a few options:
    • Sharpe Ratio: This is a solid choice if you want to focus on risk-adjusted returns. A higher Sharpe Ratio indicates better returns for the level of risk taken.
    • CAGR/Max DD%: If you’re particularly concerned about long-term growth relative to drawdown, this metric provides insight into the strategy’s growth potential while considering drawdown risk.
    • Profit Factor: This metric helps to assess how much profit a strategy makes compared to its losses. It’s useful if you want to ensure the strategy is consistently profitable.

    Recommended Choice: Sharpe Ratio – It gives a comprehensive view of risk-adjusted performance, which is crucial for evaluating trading strategies.

  2. Second Filter (OOS): This filter will provide insights into the strategy’s out-of-sample performance. Choose the metric that best reflects your priorities for OOS evaluation:
    • Net Profit: This is straightforward and gives a clear view of overall profitability.
    • Consecutive Win/Loss: If you’re focused on stability and consistency, this metric can highlight how often the strategy wins or loses in succession, which might be important for managing psychological aspects of trading.

    Recommended Choice: Net Profit – It provides a clear indicator of how well the strategy performs in real-world conditions beyond backtesting.

Summary of Selections:

  • First Filter (IS): Sharpe Ratio
  • Second Filter (OOS): Net Profit

This combination should help you identify robust strategies that are not only effective in backtesting but also demonstrate solid performance in out-of-sample evaluations.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

SQX and FTMO setup #3 – Incorporate these elements

To incorporate these elements into your SQX setup for handling maximum drawdown effectively, here are the specific parameters and considerations:

1. Portfolio Diversification:

  • Multi-Strategy Approach: In SQX, build and test different strategies that target various market conditions (e.g., trend-following, breakout, mean-reversion). This diversification helps balance drawdowns since each strategy may perform differently during various market phases.
  • Asset Selection: Include other assets besides XAUUSD if feasible, such as major currency pairs, to spread risk and reduce correlation.
  • Correlation Analysis: Use SQX’s built-in tools to analyze the correlation between strategies. Select a mix with low correlations to ensure the portfolio’s drawdown is less affected by any single market movement.

2. Regular Monitoring:

  • Backtesting and Walk-Forward Analysis: Regularly backtest and run walk-forward optimization to see how drawdown patterns evolve over different timeframes. This ensures strategies are resilient and maintain drawdowns below the 10% threshold.
  • Out-of-Sample Testing: Test strategies with out-of-sample data to confirm they perform well beyond just in-sample data, helping to validate their robustness in managing drawdown.
  • Monte Carlo Simulations: Utilize Monte Carlo analysis in SQX to stress test strategies under various market conditions, identifying those with a consistent maximum drawdown below the desired level.

3. Adaptive Stop Loss:

  • ATR-Based Stop Loss: In SQX, configure adaptive stop losses based on a multiple of the ATR (e.g., 1.5x-2x). This makes the stop loss dynamic and better suited to market conditions, allowing trades to have room during high volatility while tightening in calm periods.
  • Trailing Stop Loss: Implement a trailing stop loss feature that follows the price as it moves in your favor. Use a percentage of the ATR or a fixed percentage (e.g., 1%) that updates as the price increases.
  • Break-Even Adjustments: Set rules for moving the stop loss to break-even after the trade has gained a certain number of pips or a percentage of the ATR. This reduces the risk of a profitable trade turning into a loss.

SQX Parameter Settings for Maximum Drawdown Control:

  • Maximum Drawdown Filter: Configure the “Max Drawdown” filter during strategy generation to discard any strategy that shows a drawdown over 10% in backtests.
  • Risk Control Rule: Add a rule that limits the number of open trades or caps exposure based on total equity or margin.
  • Trailing Stop Mechanism: Set up rules in the strategy logic for trailing stops that trigger once a predefined profit threshold is reached (e.g., trailing starts at 1 ATR profit).
  • Portfolio Drawdown Limitation: Use SQX Portfolio Master to set an equity stop for the portfolio, ensuring the combined strategies don’t push drawdown above 10%.

By using these techniques and parameters, you create a structured approach to control drawdown effectively, ensuring strategies are optimized for real-world trading and compliant with risk management standards like those required for FTMO.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Use ranking in portfolio maser with Full data not IS, OOS

Yes, your approach is valid and makes sense. Here’s why using full data for ranking in Portfolio Master while focusing on good OOS performance during strategy selection is a balanced approach:

Why Rank with Full Data:

  • Comprehensive Performance Overview: Using full data (both IS and OOS combined) for ranking gives you an overall picture of how the strategy performs across all available data. This helps to ensure that the strategy isn’t just optimized for a specific period.
  • Balanced Metrics: Full data ranking helps capture metrics like profit factor, Sharpe ratio, and drawdown across the entire testing period, giving a more balanced evaluation of performance.
  • Portfolio Cohesion: Using full data provides a consistent basis for ranking strategies, which helps build a well-rounded portfolio.

Focusing on Good OOS Performance:

  • Robustness Check: Emphasizing good OOS performance ensures that the strategy has not been overfitted to the IS data and can perform well in unseen market conditions. This is crucial for assessing how the strategy is likely to behave in live trading.
  • Validation of Stability: OOS performance indicates the adaptability and stability of a strategy when exposed to new data. It acts as a test for the real-world viability of the strategy.
  • Reducing Overfitting Risk: Strategies that excel only in IS data may not perform well in live markets. By focusing on OOS, you’re filtering out those that might be overfitted and selecting those that are more robust.

Recommended Approach:

  1. Rank Using Full Data:
    • Rank strategies based on key metrics like Profit Factor, Sharpe Ratio, Ret/DD Ratio, etc., using the complete dataset.
    • This gives you a holistic view and helps identify strategies that perform well consistently across the entire backtest.
  2. Select Strategies with Strong OOS Performance:
    • After ranking, review the OOS performance of the top strategies to ensure they meet your criteria for robustness.
    • Prioritize strategies that maintain good metrics in the OOS period, such as reasonable drawdown, high Sharpe ratio, and stability.
    • Ensure that OOS results are consistent with the performance indicated by the full data to avoid surprises during live trading.

Conclusion:

Your approach of ranking with full data for an overall view, while focusing on good OOS performance during the final selection, is an effective method. It strikes a balance between comprehensive evaluation and ensuring real-world applicability. This process helps build a portfolio that is both diversified and resilient, minimizing the risks associated with overfitting and improving the likelihood of successful live trading performance.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

What does it mean to be too high in a bad way

When certain performance metrics are “too high” in a bad way, it could indicate potential issues with the strategy that may not be sustainable in live trading. Here’s what it means and what to watch out for:

1. Overfitting

  • Definition: Overfitting occurs when a strategy is too closely tailored to historical data, capturing noise and specific market idiosyncrasies that are unlikely to repeat in the future.
  • Symptoms:
    • Extremely high Profit Factor (e.g., significantly above 2.5–3) or Sharpe Ratio (e.g., above 3–4).
    • In-sample (IS) performance is excellent, but out-of-sample (OOS) or live trading results are inconsistent or poor.
  • Risk: Overfitted strategies may perform exceptionally well during backtests but fail when exposed to new market data or different conditions.
  • Solution: Verify with OOS testing and Walk-Forward Analysis. Include Monte Carlo simulations to ensure the strategy can handle variations.

2. Unrealistic Drawdown or Return Ratios

  • Definition: When metrics like CAGR/Max DD% or Ret/DD ratio are exceptionally high, they might reflect unrealistic expectations.
  • Symptoms:
    • A CAGR/Max DD% ratio much greater than 2 or a Ret/DD ratio significantly higher than 10 can be warning signs.
  • Risk: Such ratios may indicate that the strategy is leveraging risk in ways that won’t hold up under normal market conditions. It could signal a dependency on rare, high-profit events that are unlikely to occur consistently.
  • Solution: Reassess risk parameters and ensure that the strategy’s profitability isn’t driven by a few outlier trades.

3. Abnormally High Profit Factor

  • Definition: A profit factor that is too high (e.g., above 3 or 4) may signal that the strategy is excessively optimized for historical price patterns.
  • Symptoms:
    • The strategy might have extremely low drawdown and very high winning trades, which may not be sustainable.
  • Risk: This could mean that the strategy depends on perfect market conditions or specific historical events that may not happen again.
  • Solution: Test the strategy on different market conditions and instruments to ensure it isn’t tied to unique historical data quirks.

4. Excessive Win Rate

  • Definition: An abnormally high win rate (e.g., 90% or more) could suggest that the strategy has a small average win compared to its average loss or that it takes excessive risks to avoid losses.
  • Symptoms:
    • The win-to-loss ratio may be high, but the profit factor and Sharpe ratio may not align accordingly.
  • Risk: A high win rate strategy may suffer from large drawdowns or losses in the rare events when it does lose, affecting long-term sustainability.
  • Solution: Evaluate the risk-reward ratio of the strategy and ensure that it has a reasonable balance between average win size and average loss.

5. Low Drawdown with High Returns

  • Definition: While low drawdown with high returns is desirable, it can be a red flag if the drawdown is suspiciously low (e.g., <5%) while returns are exceptionally high.
  • Symptoms:
    • The strategy may appear almost too perfect, indicating that it could be optimized for very specific historical conditions.
  • Risk: This is often a sign of over-optimization where the strategy’s parameters have been excessively tailored to past data.
  • Solution: Introduce randomness using Monte Carlo analysis and run extensive OOS testing to ensure the strategy can adapt to different market conditions.

How to Address “Too High” Metrics:

  1. Use Cross-Market Testing: Run the strategy on different instruments to ensure it performs well outside its original dataset.
  2. Increase OOS Testing Periods: Lengthen OOS testing to ensure the strategy’s edge holds over diverse conditions.
  3. Reduce Parameter Sensitivity: Simplify the strategy’s rules or increase the parameter ranges to make the strategy less dependent on specific conditions.
  4. Monte Carlo Simulations: Perform these to simulate potential market conditions and check for performance consistency under random variables.
  5. Walk-Forward Matrix: Use a Walk-Forward Matrix to test the strategy’s adaptability over multiple forward periods.

Final Thought:

High performance metrics are not inherently bad, but when they reach extreme values, they could signal underlying weaknesses like overfitting or unrealistic optimization. To ensure the strategy is robust, it’s important to test thoroughly, maintain simplicity, and validate with realistic, forward-looking data.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Can i use filters like above for portfolio making

Yes, you can definitely use the filters you listed for building your trading portfolio. Applying these filters ensures that only the most robust and reliable strategies make it into your portfolio, creating a diversified and resilient set of strategies for trading. Here’s how to use these filters effectively when constructing a portfolio:

Steps for Using Filters to Create a Portfolio:

  1. Apply the Filters to Select Strategies:
    • Use your filters (e.g., Profit Factor > 1.4, Ret/DD ratio > 4, Sharpe Ratio > 1.5, etc.) to narrow down your list of strategies.
    • Apply these filters consistently across all testing stages (IS, OOS, and different data precisions) to ensure that the selected strategies are robust and well-suited for real trading.
  2. Select a Diverse Set of Strategies:
    • Mix Strategy Types: Include different types of strategies such as trend-following, mean reversion, breakout, and range trading to diversify your portfolio.
    • Multiple Timeframes: Ensure that your portfolio contains strategies that trade on different timeframes (e.g., H1, M30, M15, M5) to spread risk across various market conditions.
    • Trading Approaches: Include strategies with different entry and exit techniques (e.g., indicators, price action, volatility-based) for a balanced portfolio.
  3. Ensure Correlation Is Low:
    • Check for correlation between the selected strategies. Including highly correlated strategies may increase the overall risk as they might behave similarly during specific market conditions.
    • Aim for strategies that complement each other, so that if one performs poorly, others may compensate for it.
  4. Backtest the Portfolio:
    • Backtest the combined portfolio using your existing filters to evaluate the overall performance metrics such as profit factor, drawdown, Sharpe ratio, and stability.
    • Use a weighted approach for strategy allocation to balance exposure within the portfolio.
  5. Simulate Portfolio with Out-of-Sample (OOS) Data:
    • Run the portfolio through OOS testing and check the combined performance metrics.
    • Ensure that the portfolio maintains acceptable levels of maximum drawdown, stability, and profitability.
  6. Optimize Strategy Allocation:
    • Adjust the capital allocation for each strategy to balance the portfolio risk. For example, allocate more capital to strategies with a higher Sharpe ratio or a better Ret/DD ratio.
    • Ensure the overall portfolio drawdown stays within a risk-tolerant level that aligns with your trading goals.

Benefits of Using These Filters for Portfolio Creation:

  • Consistency: Applying these filters helps ensure that your portfolio strategies are consistently high-quality, reducing the risk of underperformance.
  • Robustness: By selecting strategies that meet your strict criteria across all stages of testing, your portfolio will be more adaptable to various market conditions.
  • Risk Management: Including maximum drawdown and stability filters keeps your portfolio within manageable risk levels.

Final Tips:

  • Monitor Portfolio Performance: After constructing your portfolio, continue to monitor its performance periodically and replace or adjust strategies as needed based on live or forward-test results.
  • Forward Test: Always forward test the portfolio in a demo or live environment with minimal risk to confirm that it behaves as expected.

Using your existing filters as a benchmark for selecting strategies ensures that you build a strong, diversified portfolio capable of sustaining various market conditions.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Ah yes i added these filters already in all step

ah yes i added these filters already in all step;

Profit factor (IS) > 1.4

Ret/DD ratio (full) > 4

Stability (is) > 0.6

open dd % (is) < 50%

cagr/max dd % (is) > 0.6

sharp ratio (is) > 1.5

max dd % (OOs) < 70%

 

Great! Including those filters across all steps is essential for narrowing down to the most robust strategies. Here’s how to use these filters effectively in your final review and comparison process:

Review of Applied Filters:

  1. Profit Factor (IS) > 1.4:
    • Ensures that in-sample (IS) strategies generate at least $1.40 in profit for every $1.00 of loss.
    • Review Tip: Verify that this is consistently met across all steps, especially in OOS (out-of-sample) testing.
  2. Ret/DD Ratio (Full) > 4:
    • A high return-to-drawdown ratio indicates strong risk-adjusted returns.
    • Review Tip: Ensure this holds up in OOS testing to confirm that the strategy isn’t just optimized for IS data.
  3. Stability (IS) > 0.6:
    • Indicates a steady equity curve without significant fluctuations.
    • Review Tip: Check if the stability in OOS testing remains above this threshold for long-term performance assurance.
  4. Open DD % (IS) < 50%:
    • Ensures that the strategy’s open drawdown doesn’t exceed 50%, which helps manage risk during active trades.
    • Review Tip: Confirm that OOS open drawdown remains under acceptable levels to avoid capital depletion in live trading.
  5. CAGR/Max DD % (IS) > 0.6:
    • A ratio showing that the compound annual growth rate (CAGR) is sufficiently high relative to the maximum drawdown.
    • Review Tip: Ensure the ratio holds in OOS testing to validate that the strategy’s returns are consistent with the risk taken.
  6. Sharpe Ratio (IS) > 1.5:
    • Confirms that the returns are substantial relative to the risk, indicating a strategy that compensates well for its volatility.
    • Review Tip: Compare this ratio in OOS to ensure that risk-adjusted returns are sustainable.
  7. Max DD % (OOS) < 70%:
    • Ensures that the maximum drawdown during OOS does not exceed 70%, which helps to manage potential large losses during unseen data.
    • Review Tip: Confirm that the maximum drawdown remains under control when exposed to new data sets to avoid potential large drawdowns in live trading.

Next Steps for Final Review:

  1. Cross-Check Consistency:
    • Verify that the filters are met in both IS and OOS testing. Highlight strategies that meet all criteria consistently across different testing steps.
  2. Compare Step Results:
    • For each strategy that passes your filters, compare key metrics across all three steps (Selected TF, 1-minute data tick, Real tick data) to ensure minimal deviations.
  3. Portfolio Diversification:
    • Build a final portfolio using strategies that pass your filters across all steps. Ensure that the portfolio includes a mix of strategy types, timeframes, and trading approaches to mitigate risk.
  4. Forward Test in Demo:
    • Run these selected strategies or portfolios in a demo environment for real-time performance evaluation. This helps validate that they align with their backtested and OOS results.

Summary:

Using these filters across all steps ensures that the strategies you select are robust, consistent, and suitable for live trading. Your criteria already set a high standard for selection, which will help you build a reliable and diversified trading portfolio.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Primary Filters for Portfolio Selection (Including IS and OOS)

Primary Filters for Portfolio Selection (Including IS and OOS)

When building portfolios in Portfolio Master and selecting strategies for long-term stability and profitability, you can use Primary Filters that incorporate both In-Sample (IS) and Out-of-Sample (OOS) testing. This approach will ensure that your portfolios are robust not only in the training phase but also in unseen market conditions.

Primary Filters for IS and OOS:

  1. CAGR/Max DD% > 1 (IS & OOS)
    • IS: Indicates good profitability relative to risk during the training phase.
    • OOS: Ensures the strategy maintains profitability and does not suffer from overfitting when exposed to new market data.
  2. Sharpe Ratio > 2 (IS & OOS)
    • IS: A Sharpe Ratio > 2 ensures that the strategy provides strong returns relative to the risk in the historical data.
    • OOS: A Sharpe Ratio > 2 in OOS testing confirms that the strategy is stable and continues to provide a good risk-to-return ratio when tested on new data.
  3. Profit Factor > 1.5 (IS & OOS)
    • IS: Profit Factor > 1.5 indicates that profitable trades outweigh losses during the in-sample test.
    • OOS: In OOS, this shows that the strategy maintains profitability when applied to unseen data, confirming its robustness.
  4. Stability > 0.8 (IS & OOS)
    • IS: Ensures the strategy is not prone to extreme fluctuations and behaves in a predictable manner during training.
    • OOS: Stability > 0.8 in OOS ensures that the strategy’s performance is consistent and not erratic in unseen conditions.
  5. Open Drawdown % < 15 (IS & OOS)
    • IS: Limiting Open Drawdown to < 15% reduces the risk of large temporary losses during the testing phase.
    • OOS: The same limitation in OOS testing ensures that the strategy remains resilient and avoids high-risk exposure when applied live.
  6. Max Drawdown % < 30 (OOS)
    • Focus on limiting the overall Max Drawdown to less than 30% in OOS. It will help maintain manageable risk levels in live trading conditions.

Ranking and Portfolio Creation Process:

  1. Filter IS Strategies:
    • Start by applying the above filters to your in-sample (IS) strategies to identify the top performers in your test period.
    • Select those strategies with the highest combined CAGR/Max DD%, Sharpe Ratio, and Profit Factor as the initial candidates for portfolio construction.
  2. Evaluate OOS Performance:
    • Once you have the IS candidates, reapply the same filters to assess their out-of-sample (OOS) performance.
    • Focus on Stability, Profit Factor, Sharpe Ratio, and Open Drawdown in OOS. This will confirm that the strategies maintain profitability and stability under new market conditions.
  3. Create Portfolios:
    • Create 4–6 portfolios with 4–8 strategies each, prioritizing those that perform well in both IS and OOS.
    • Ensure diversity in the portfolios, balancing strategies with high Profit Factor and those with low drawdowns.
  4. Remove/Reuse Strategies:
    • Once a portfolio is built, you can either remove those strategies from your selection pool and repeat the process for the next portfolio, or keep all strategies in the pool to maximize utilization.
    • This way, you can create up to 12 portfolios without overusing any single strategy, optimizing the distribution across your available 500 strategies.

By following this method, you’ll create well-balanced portfolios that are both highly profitable and resistant to market changes, ensuring long-term success.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Suggested for 1 Portfolio Creation with IS and OOS Filtering

Suggested Approach for Phase 1 Portfolio Creation with IS and OOS Filtering

In phase 1, the goal is to create several robust portfolios by filtering and ranking strategies to achieve high performance and stability, with a specific focus on their behavior in both in-sample (IS) and out-of-sample (OOS) testing.

  1. IS and OOS Filtering:
    • IS: Ensure strategies perform consistently during the in-sample period by prioritizing parameters like CAGR/Max Drawdown (DD%), Sharpe Ratio, and Stability. These metrics demonstrate the strategy’s profitability and risk management in the training phase.
    • OOS: Use filters that emphasize robustness and adaptability to unseen data. High values for metrics like Sharpe Ratio, Stability, and low OOS drawdowns indicate resilience. Also, analyze parameters such as Open DD% and consecutive losses to evaluate risk in live scenarios.
  2. Prioritize Key Performance Metrics for Filtering and Ranking:
    • CAGR/Max DD%: A high ratio here is essential for long-term profitability.
    • Sharpe Ratio: Select for a Sharpe Ratio > 2 in both IS and OOS to ensure that returns consistently outweigh risk.
    • Profit Factor: A Profit Factor > 1.5 across IS and OOS indicates that profitable trades outweigh losses.
    • Stability: Aim for Stability > 0.8, ensuring strategies are less likely to be overfitted.
    • Open DD% and Max DD%: Filter for Open DD% < 15% to limit real-time exposure to high drawdowns, with Max DD% providing an additional safeguard.
    • Net Profit and R-Squared (R²): These are supportive metrics, with higher values indicating stronger trends in profit generation.
  3. Portfolio Structuring:
    • From the filtered strategies, construct 4–6 portfolios, each containing 4–8 strategies that exhibit the highest OOS Sharpe Ratios, Stability, and low drawdowns. Ensure each portfolio balances a mix of high-return and stable strategies.
    • Once these portfolios are built, remove selected strategies from the list for the next round of portfolio creation, or, alternatively, create all portfolios from the initial list to maximize the use of all high-performing strategies without deletion.

This approach ensures each portfolio is diversified in both strategy type and performance metrics, optimizing for long-term stability across various market conditions.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

whats a different about ‘Simple’ and ‘Walk-forward matrix’ in Optimizer?

In StrategyQuant’s Optimizer, the Simple and Walk-Forward Matrix optimizations serve different purposes and offer distinct methodologies for testing and optimizing strategies.

1. Simple Optimization

  • Description: Simple optimization tests different combinations of input parameters over a single, fixed in-sample (IS) period. It runs through all the possible parameter combinations within the selected range and finds the best-performing combinations based on the chosen criteria (e.g., profit factor, Sharpe ratio, etc.).
  • Purpose: It’s useful for understanding how specific parameters affect strategy performance and for finding optimal values within a fixed timeframe.
  • Process:
    • Runs on a fixed period of historical data (in-sample).
    • Tests all combinations of input variables (e.g., moving average length, stop-loss values).
    • Ranks the parameter sets according to the fitness function you’ve defined.
  • Limitation: Because it optimizes based on a single in-sample period, the results might be overfit and less robust when exposed to unseen data (out-of-sample).

2. Walk-Forward Matrix Optimization

  • Description: Walk-forward matrix optimization tests the strategy’s robustness by dividing the historical data into multiple in-sample (IS) and out-of-sample (OOS) segments, iterating through multiple forward steps to evaluate how the strategy performs in both seen and unseen data.
  • Purpose: This method helps validate that a strategy isn’t overfitted by testing it on unseen data (OOS), providing a better sense of how the strategy will perform in live trading. It’s used to determine the strategy’s adaptability to new market conditions.
  • Process:
    • The historical data is split into several consecutive segments.
    • For each segment, part of the data is used for optimization (in-sample), and the remaining is used for testing (out-of-sample).
    • The process is repeated across multiple segments to simulate how the strategy would behave in live market conditions.
    • This creates a matrix of results, allowing you to observe the consistency of the strategy’s performance across different market conditions.
  • Advantage: Walk-forward matrix optimization provides a more robust analysis by simulating live trading conditions and testing the strategy’s ability to adapt to new data. It helps avoid overfitting by evaluating how well the strategy performs outside the optimized period.

Key Differences:

  • Data Segmentation:
    • Simple uses a single period of data for optimization.
    • Walk-Forward Matrix splits data into several in-sample and out-of-sample segments for more robust testing.
  • Overfitting Risk:
    • Simple can lead to overfitting since it only focuses on one dataset.
    • Walk-Forward Matrix helps reduce overfitting by ensuring the strategy performs well on unseen data (OOS).
  • Use Case:
    • Simple is great for initial parameter testing and quick optimization.
    • Walk-Forward Matrix is essential for ensuring the robustness of a strategy, particularly when preparing it for live trading.

If your goal is to create a robust strategy that can adapt to live trading conditions and remain reliable over time, the Walk-Forward Matrix is typically a better choice for long-term performance stability.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Portfolio Creation IS/OOS.

For filtering strategies in In-Sample (IS) and Out-of-Sample (OOS) phases, here’s how you should approach it to ensure long-term stability:

Both IS and OOS performance are critical, as they provide insight into how the strategy performs in known market conditions (IS) and unseen market conditions (OOS). The goal is to ensure the strategy generalizes well beyond the backtested data.

Make sure your dataset has been divided into In-Sample (IS) and Out-of-Sample (OOS) parts. IS is used for training or optimization, while OOS is used to test the strategy’s robustness.

  • OOS performance is more important than IS because it demonstrates how the strategy handles real, unseen market conditions. Always filter strategies that have both IS and OOS results, but give more weight to OOS metrics to ensure robustness.

To set up your filters and ranking criteria for both IS and OOS, here’s how to prioritize:


1. Sharp Raio (OOS > IS)1. Sharpe Ratio (OOS > IS)

  • IS: Should be > 1.5. A high IS Sharpe Ratio indicates good performance in training data.
  • OOS: This should be your priority and should ideally be > 2. It shows strong performance with minimal volatility in unseen data.
  • Why: If OOS Sharpe is much lower than IS, the strategy may be overfit. The OOS Sharpe Ratio >2 confirms the strategy can handle real-world volatility.

2. CAGR/Max DD% (OOS > IS)

  • IS: Should be > 1, but OOS should be higher than IS.
  • OOS: Should be prioritized here as it shows the return achieved per unit of drawdown in unseen market conditions. Aim for > 1.
  • Why: Ensuring the OOS CAGR/Max DD% is strong proves that the strategy will continue to generate healthy returns with manageable risk.

  • IS: Look for > 1.5 to ensure profitability in known data.
  • OOS: Should ideally be close to IS performance. Aim for > 1.5, and if OOS is significantly lower, be cautious.
  • Why: Large gaps between IS and OOS profit factor indicate potential overfitting.

4. Return/Drawdown Ratio (Ret/DD) (OOS > IS)

  • IS: Should be > 2.
  • OOS: Should be comparable or better than IS, ideally > 2. If OOS Ret/DD drops too much compared to IS, the strategy may not generalize well.
  • Why: This helps you assess the balance of returns versus risk in unseen conditions. Favor strategies where OOS Ret/DD is consistent with IS.

  • IS: Should be > 0.8 to indicate a stable equity curve in the training data.
  • OOS: Should be close to IS. Significant drops here mean the strategy is less reliable in real conditions.
  • Why: High stability in OOS ensures the strategy performs smoothly without wild fluctuations in live trading.

  • IS: Set the threshold < 15% to limit exposure in known conditions.
  • OOS: This should be the same or lower than IS to ensure the strategy doesn’t take on too much risk when live. Prioritize < 10-12% for OOS.
  • Why: You want to reduce risk in live markets, so OOS drawdown should ideally be lower than IS.

  • IS: Set a threshold < 20-25%.
  • OOS: Should be the same or lower than IS to avoid risk spikes in live trading. < 20% is preferable.
  • Why: Keeping OOS max drawdown low is critical to ensuring the strategy doesn’t suffer big losses in real-world conditions.

  • IS: Look for solid net profit but not at the expense of risk.
  • OOS: Should be close to IS. If OOS profit is significantly lower than IS, this could be a sign of overfitting.
  • Why: The goal is to ensure consistent profitability across both IS and OOS phases.

  • IS: Look for R² to indicate a strong trend, but don’t prioritize it too heavily.
  • OOS: Should be close to IS values. Large differences could signal instability in the equity curve.
  • Why: R² helps in assessing whether the strategy maintains its trend in unseen data.

10. Consecutive Win/Loss Trades (OOS > IS)

  • IS: Avoid strategies with large streaks of losses.
  • OOS: Should be comparable to IS, and you want to avoid any strategies where the number of consecutive losses is much higher in OOS.
  • Why: A strategy that maintains its win/loss consistency across IS and OOS will be more robust.

  1. Sharpe Ratio (OOS > IS)
  2. CAGR/Max DD% (OOS > IS)
  3. Return/Drawdown Ratio (Ret/DD) (OOS > IS)
  4. Profit Factor (OOS close to IS)
  5. Stability (OOS close to IS)
  6. Open Drawdown % (OOS < IS)
  7. Max Drawdown % (OOS < IS)
  8. Net Profit (OOS close to IS)
  9. Consecutive Win/Loss Trades (OOS > IS)
  10. R-Squared (R²) (OOS close to IS)

When filtering and ranking strategies, OOS performance should take precedence over IS, as it reflects the strategy’s performance in live, unseen market conditions. Always ensure that OOS metrics are close to or better than IS to confirm the robustness of your strategy, particularly Sharpe Ratio, CAGR/Max DD%, and Ret/DD.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

IS and OOS.

Added ability to filter by IS and OOS in each topic to see which IS/OOS should be used.

When adding the ability to filter by In-Sample (IS) and Out-of-Sample (OOS) performance in each metric or topic, it becomes critical to differentiate between the two phases of strategy testing. The IS data is used to develop and optimize the strategy, while the OOS data tests the strategy on unseen, untouched market conditions to assess its robustness.

Here’s how to approach filtering each metric for IS and OOS:

  • In-Sample (IS): The period used for building and optimizing the strategy. High IS performance may indicate overfitting if OOS performance is poor.
  • Out-of-Sample (OOS): The unseen data used to test the robustness of a strategy. Good OOS performance indicates that the strategy generalizes well to unseen market conditions.
  1. Profit Factor
    • IS Target: Should be > 1.5.
    • OOS Target: A good profit factor in OOS should remain above 1.3 or higher to show that the strategy is profitable without overfitting.
    • Purpose: This shows how well the strategy is balancing profits against losses both in-sample and out-of-sample.
  2. CAGR/Max DD%
    • IS Target> 1 (This indicates returns are higher than the risk during optimization).
    • OOS Target: Should ideally remain above 0.8 in OOS. If the value dips significantly, it might indicate over-optimization in the IS phase.
    • Purpose: It helps compare growth to risk over the strategy’s life cycle. Stability in this metric across IS and OOS is important for long-term performance.
  3. Sharpe Ratio
    • IS Target> 2 (This shows good risk-adjusted performance in-sample).
    • OOS Target: Should remain above 1.5 in OOS. Sharpe ratios dropping significantly in OOS may indicate risk or volatility problems in unseen data.
    • Purpose: This measures the strategy’s ability to handle risk consistently, and OOS results are crucial to validate its stability in live trading.
  4. Return/Drawdown Ratio (Ret/DD)
    • IS Target> 2 (Shows solid returns in comparison to risk).
    • OOS Target: Ideally, you want this to stay above 1.5 to confirm stability.
    • Purpose: A high Ret/DD ratio in IS shows good returns relative to risk, but if the OOS version drops sharply, it indicates the strategy may not handle risk well in real market conditions.
  5. Stability
    • IS Target> 0.8 (A smooth, consistent equity curve).
    • OOS Target: Stability should remain > 0.7 in OOS. A significant drop indicates the strategy’s performance may become inconsistent in live conditions.
    • Purpose: High stability across IS and OOS ensures a smooth equity curve, avoiding sharp performance drops in real trading.
  6. Open Drawdown %
    • IS Target< 15% (Keeps risk exposure in check during optimization).
    • OOS Target: Should remain below 20% in OOS testing. If OOS drawdowns significantly exceed the IS values, the strategy may struggle in volatile or unseen markets.
    • Purpose: Managing open drawdowns is critical for risk control, and seeing how this behaves OOS ensures you’re not taking on excessive risk in real trading.
  7. Max Drawdown %
    • IS Target< 20% (Manages maximum peak-to-valley losses).
    • OOS Target: Should not exceed 25% in OOS. Drawdown stability between IS and OOS indicates the strategy is capable of handling stress.
    • Purpose: This metric helps manage risk, ensuring that no single market condition causes extreme losses.
  8. Consecutive Win/Loss Trades
    • IS Target> 2 (Aims for win streaks without significant drawdowns).
    • OOS Target: Should be similar to IS results, or show a smooth transition. Long losing streaks in OOS can be a warning sign.
    • Purpose: This shows how often you can expect consecutive wins or losses. Stability between IS and OOS is a good indicator of robustness.
  9. Net Profit
    • IS Target: Positive net profit in IS with steady growth.
    • OOS Target: Should maintain a positive net profit. If OOS performance is significantly lower, this indicates overfitting.
    • Purpose: Maintaining positive net profit in both IS and OOS is crucial for real trading profitability.
  10. R-Squared (R²)
    • IS Target> 0.8 (A high R² shows smooth, predictable growth).
    • OOS Target: Should remain above 0.7 to avoid overfitting. A significant drop in OOS means the strategy is inconsistent.
    • Purpose: This metric helps you find strategies that perform smoothly without high volatility in their returns.
  11. Sortino Ratio
    • IS Target> 1.5 (Indicates good risk-adjusted returns considering only downside volatility).
    • OOS Target: Above 1.2 in OOS. A sudden drop in Sortino indicates the strategy is exposing itself to more downside risk than it did during optimization.
    • Purpose: This is a good alternative to Sharpe Ratio, focusing on negative risk rather than total risk. Stability in OOS is critical for downside protection.
  1. First pass with IS filters:
    • During the initial build/optimization phase, filter strategies based on high values for key metrics in the IS data. Use Profit Factor > 1.5CAGR/Max DD% > 1Sharpe Ratio > 2Ret/DD > 2, and Stability > 0.8.
  2. Second pass with OOS filters:
    • After IS optimization, evaluate the strategies in the OOS phase. Set slightly lower but still acceptable values: Profit Factor > 1.3Sharpe Ratio > 1.5CAGR/Max DD% > 0.8Ret/DD > 1.5, and Stability > 0.7.
  3. Compare IS and OOS performance:
    • Discrepancies between IS and OOS are normal, but they should not be drastic. If a strategy performs well in IS but poorly in OOS, it’s likely overfitted. Favor strategies with consistent metrics across both phases.

By maintaining these IS/OOS targets in SQX, you can ensure your strategies are robust and able to handle live trading without deteriorating due to overfitting.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

If i dont want to use ADX MACD RSI ATR.

If you prefer not to use ADXMACDRSI, or ATR, we can build the strategy using other signals from your available list in SQX. Below is an alternative setup using simpler, yet effective indicators:

  • Candle Patterns: For price action and reversal detection.
  • Bollinger Bands: To capture volatility and breakout opportunities.
  • Moving Averages: For trend direction and entry triggers.
  • Fractals: To identify local highs/lows for breakouts or retracements.

1. Entry Signals

  • Candle Pattern: Use bullish or bearish reversal candle patterns (like engulfinghammer, or doji) as entry triggers.
  • Moving Average Crossover:
    • Buy when a faster-moving average (e.g., 10-period) crosses above a slower-moving average (e.g., 50-period).
    • Sell when the faster MA crosses below the slower MA.
  • Bollinger Bands: If the price closes above the upper band, consider a buy (bullish breakout). If it closes below the lower band, consider a sell (bearish breakout).
  • In Entry Conditions, use the Candle Pattern indicator for reversal patterns.
  • Add Moving Average Crossover as a trend confirmation filter.
  • Include a condition using Bollinger Bands to detect breakouts and confirm volatility.
  • Fractal Exit: Exit positions when the price hits a recent fractal high (for buy trades) or a fractal low (for sell trades).
  • Bollinger Bands Reversal: Close the position if the price reverses and closes inside the Bollinger Bands after breaking out.
  • Time-based Exit: Close all positions after 5 days to limit the holding period.
  • Friday Close: Automatically close all trades at 23:30 on Fridays to avoid weekend risk.
  • In Exit Conditions, use the Fractal Indicator to detect recent highs and lows for exit points.
  • Set up a rule to exit when the price re-enters the Bollinger Bands after a breakout.
  • Define a Time-based Exit rule to close trades after 5 days or on Friday.
  • Fixed Lot Size: Trade with 0.01 lots per $100 of the account balance.
  • Risk Management: Set a fixed percentage of risk per trade (e.g., 1% of the total account).
  • Grid Layer (Optional): Place pending buy/sell orders at intervals (e.g., 10 pips) from the current price to capture retracements or price movements.
  • In Money Management, set your fixed lot size and risk percentage.
  • If you want a grid, use the Pending Orders functionality to create a grid around the current price.
  1. Duplicate Trades: Enable multiple trades to open in the same direction.
  2. Break-Even: Move the stop loss to break-even once the trade has moved in your favor by a certain distance (e.g., a fixed pip value or after hitting a fractal level).

  1. Backtest: Run your backtests using M1 data over 20 years.
  2. Optimize: Adjust moving average periods, Bollinger Band deviations, and fractal periods to find the best combination.
  3. OOS Testing: Validate the strategy’s performance on out-of-sample data.

By removing ADXMACDRSI, and ATR, this setup focuses more on price action with simple indicators that track volatility and trend strength.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Simple Trend Momentum Grid Strategy..

Let’s simplify things by using the signals you already have in your system. Here’s a strategy you can set up with your available indicators:

This strategy will capture both trend-following and breakout moves with simple signals, using indicators already present in SQX.

  1. Primary Indicators:
    • ADX: For confirming strong trends.
    • MACD: For detecting momentum and direction.
    • RSI: To help with overbought/oversold levels.
    • ATR: For volatility-based risk management.

1. Entry Signals

  • MACD Crossover: Enter a buy when the MACD line crosses above the signal line, and enter a sell when the MACD line crosses below the signal line.
  • ADX > 25: Confirm that the market is trending before allowing an entry.
  • RSI Confirmation:
    • If RSI > 70, avoid buying (overbought signal).
    • If RSI < 30, avoid selling (oversold signal).
  • In SQX, use Entry Conditions with MACD crossover as the trigger.
  • Add an additional filter where ADX > 25 to confirm trend strength.
  • Add RSI as a filter to avoid extreme market conditions.
  • Take Profit and Stop Loss: Use ATR-based levels. For example:
    • Take Profit: 2x ATR(14).
    • Stop Loss: 1x ATR(14).
  • Trailing Stop: Trail the stop loss based on ATR, moving the stop higher/lower as the trend progresses.
  • Exit by Time: Close all positions every Friday at 23:30 to avoid weekend gaps.
  • In Exit Conditions, define take profit and stop loss levels based on ATR values.
  • Use the Trailing Stop function with ATR.
  • Set a rule in Exit Conditions to close all trades at a specific time on Friday.
  • Use Lot Size: 0.01 lots per $100 of the account balance.
  • Risk %: Define risk management to ensure that no more than a specific percentage (e.g., 1%) of the total capital is risked on each trade.
  • In SQX, use the Money Management tab to set the lot size and risk percentage.
  • If you want a grid layer to capture additional profits, set up pending orders at regular intervals around the current price (e.g., every 10 pips) with small lot sizes.
  • You can also adjust the grid based on market volatility using ATR.

  1. Backtest: Use your M1 data over the 20-year range to evaluate how the strategy performs.
  2. Optimize: Fine-tune the parameters like ATR multiples, grid intervals, and trailing stops for the best results.
  3. Out-of-Sample Testing: Ensure that your strategy performs well in unseen data to confirm robustness.

This simpler approach will help you use the signals you’re familiar with while maintaining solid trend-following and risk management.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

Out-Of-Sample (OOS) performance.

OOS Testing: More importantly, assess the performance during out-of-sample testing to ensure the strategy is robust in unseen market conditions. Strategies with a high OOS Sharpe ratio and low OOS drawdowns are more likely to perform well in live trading.

this OOS should be > ?

 

When assessing out-of-sample (OOS) performance, the following benchmarks can help determine if a strategy is robust enough for live trading:

1. OOS Sharpe Ratio:

  • A Sharpe ratio greater than 1 indicates that the strategy has delivered excess returns relative to its volatility.
  • A Sharpe ratio of greater than 2 is considered excellent, suggesting strong performance and favorable risk-adjusted returns.

2. OOS Drawdown:

  • Aim for a maximum drawdown of less than 15%. This benchmark helps ensure that the strategy does not experience severe losses that could jeopardize the trading account.
  • Additionally, the recovery time from drawdown is important; faster recovery is generally preferable.

3. Profit Factor:

  • A profit factor greater than 1.5 is generally favorable. This means that the strategy makes 1.5 times more profit than it loses.

4. Consistency:

  • Look for consistency in OOS performance metrics, such as stable returns and low volatility, over a sufficient sample size (e.g., at least 6-12 months of trading).

Summary:

  • OOS Sharpe Ratio > 1 (ideally > 2)
  • Maximum OOS Drawdown < 15%
  • Profit Factor > 1.5

Meeting these benchmarks can indicate that the strategy is likely to perform well in live trading.

Gold Award Graphic Background And Gradient Colors. Elegant Glowing Shine Lines. Luxury Premium Corporate Abstract Design Template, Classic Shape Post, Central Screen Visual

300 ea in Portfolio

To filter and select the best strategies from your 300+ strategies in Portfolio Master, follow a systematic approach that aligns with your ranking criteria and ensures that only the most robust and stable strategies are included in the final portfolio. Here’s a step-by-step guide to filtering:

Use the criteria you’ve already set for ranking individual strategies: – CAGR/Max DD% > 1 – Sharpe Ratio > 2 – Profit Factor > 1.5 – Stability > 0.8 – Open DD% < 15%

This initial filter should remove many strategies that don’t meet the baseline performance requirements.

  • IS Testing: Review the performance of each strategy during the in-sample period to ensure that it was optimized correctly.
  • OOS Testing: More importantly, assess the performance during out-of-sample testing to ensure the strategy is robust in unseen market conditions. Strategies with a high OOS Sharpe ratio and low OOS drawdowns are more likely to perform well in live trading.
  • Use correlation analysis to ensure that strategies in your portfolio are not highly correlated. Highly correlated strategies expose you to similar risks across multiple strategies, increasing the chances of simultaneous drawdowns.
  • Keep strategies with low or negative correlation in your portfolio to achieve diversification and reduce risk.
  • Perform Monte Carlo stress tests on your selected strategies to assess how they handle market noise and randomness. Strategies that consistently perform well under Monte Carlo simulations are more robust.
  • Focus on strategies with a low chance of ruin and those that maintain good metrics like Sharpe ratio and Profit Factor in the simulated results.
  • Look for strategies that maintain consistent trade frequency and avoid excessive overtrading, which can increase transaction costs and slippage.
  • Ensure that strategies follow a balance of trend-following, breakout, and swing trading methodologies (as you’ve chosen) to reduce dependency on a single market condition.
  • Evaluate how fast each strategy recovers from drawdowns. Strategies that recover quickly are generally more reliable for long-term use. Use the drawdown recovery time as an additional filter.
  • Take your top strategies and conduct a small-scale forward testing or paper trading to see how they behave in current market conditions. Live market dynamics often differ from historical data, so this step is crucial for final validation.
  • After narrowing down the best-performing strategies, use Portfolio Master to combine them into an optimized portfolio with diverse market exposures and timeframes (H1/H4, M15/H4, etc.).
  • Make sure the combined strategies adhere to your risk management rules, such as RRR > 1:3duplicate ordersclosing positions on Fridays, and break-even trailing stops.
  • Continue to monitor the performance of your portfolio once it’s live, making adjustments only if necessary. Pay attention to how strategies perform during different market phases (trending, ranging, volatile) to ensure long-term stability.

By following this structured filtering process, you’ll be able to select a portfolio of strategies that not only meet your criteria but are also robust, diversified, and ready for live trading.