forex software

Create and Test Forex Strategies

forex software

eas-guide:monte-carlo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
eas-guide:monte-carlo [2021/01/08 11:29] ilaneas-guide:monte-carlo [2025/09/12 07:22] (current) – Corrected "Randomize start bar" Miroslav Popov
Line 4: Line 4:
 Monte Carlo is the best tool for testing the strategy robustness. When you create a strategy, you see its backtest statistics. However, the strategy might be over-optimized (curve fitted). The goal of the Monte Carlo tool is to verify that the strategy is not over-optimized. This tool allows you to apply random changes to the market data, the execution of the strategy and the numeric parameters of the strategy indicators. Monte Carlo is the best tool for testing the strategy robustness. When you create a strategy, you see its backtest statistics. However, the strategy might be over-optimized (curve fitted). The goal of the Monte Carlo tool is to verify that the strategy is not over-optimized. This tool allows you to apply random changes to the market data, the execution of the strategy and the numeric parameters of the strategy indicators.
  
 +
 +{{youtube>Wsqh3n6LfqI?medium|}}
  
 If you make minor changes to the strategy and its environment, and the strategy continues to have good profits, this means that the strategy has a good chance of making money on the real market. If you make minor changes to the strategy and its environment, and the strategy continues to have good profits, this means that the strategy has a good chance of making money on the real market.
Line 13: Line 15:
 When you run the Monte Carlo tool, you actually do not run just a single test but 20 (by default) tests. Each test is random. It can use one or more simulations. When you run the Monte Carlo tool, you actually do not run just a single test but 20 (by default) tests. Each test is random. It can use one or more simulations.
 </WRAP> </WRAP>
 +
  
 ===== Simulations ===== ===== Simulations =====
Line 18: Line 21:
 Here you can choose the simulations that will be used in the Monte Carlo tests. You select optional parameters for each simulation from the **Options** tab. Here you can choose the simulations that will be used in the Monte Carlo tests. You select optional parameters for each simulation from the **Options** tab.
  
-{{ :eas-guide:monte-carlo-simulations.jpg?nolink |}}+{{:eas-guide:monte-carlo-simulations.png?nolink|}}
  
 **Market variations** **Market variations**
  
     * **Randomize history data** - The tool will take a certain number of random bars and change their range. It can change the bar's Low and High values in both directions. This will result in having higher or shorter bars.      * **Randomize history data** - The tool will take a certain number of random bars and change their range. It can change the bar's Low and High values in both directions. This will result in having higher or shorter bars. 
-    * **Randomize spread** - If this option is enabled EA Studio can set the spread to a different value. It might vary within the limits set in Options.+    * **Randomize spread** - If this option is enabledEA Studio can set the spread to a different value. It might vary within the limits set in Options.
  
  
 **Execution problems** - These are related to problems when executing the signals sent from the Expert Advisor to the broker. **Execution problems** - These are related to problems when executing the signals sent from the Expert Advisor to the broker.
  
-    * **Randomize slippage** - Slippage is present on marketswhere the prices change quickly. There may be a situation where the price changes by one or two ticksbefore the the order gets to the broker and gets executed. If you enable this option, Monte Carlo will sometimes add a slippage in a direction contrary to the direction of the position. In the Options you can set how often to use slippage and how much the slippage should be.+    * **Randomize slippage** - Slippage is present on markets where the prices change quickly. There may be a situation where the price changes by one or two ticks before the order gets to the broker and gets executed. If you enable this option, Monte Carlo will sometimes add a slippage in a direction contrary to the direction of the position. In the Optionsyou can set how often to use slippage and how much the slippage should be.
     * **Randomly skip position entry** - Will skip opening some of the positions. This sometimes happens in the real world. It might occur due to problems on the broker's side, Internet connection issues or slowness in the machine executing the Expert Advisor.     * **Randomly skip position entry** - Will skip opening some of the positions. This sometimes happens in the real world. It might occur due to problems on the broker's side, Internet connection issues or slowness in the machine executing the Expert Advisor.
-    * **Randomly skip position exit** - Will sometimes skip closing the position. This one of course can be very destructive to the strategy. **Not** opening a position is not so bad since we won't lose any money. But **not closing** a position might result in a loss.  +    * **Randomly skip position exit** - Will sometimes skip closing the position. This oneof coursecan be very destructive to the strategy. **Not** opening a position is not so bad since we won't lose any money. But **not closing** a position might result in a loss.  
-    * **Randomly close position** - This happens only occasionally. Your broker might close your position for some reason. Of course brokers who close your positions when they decide to are not brokers you should be trading with.+    * **Randomly close position** - This happens only occasionally. Your broker might close your position for some reason. Of coursebrokers who close your positions at their discretion are not the ones you should be trading with.
  
  
Line 37: Line 40:
  
  
-    * **Randomize indicator parameters** - EA Studio comes with this option off by default. This is because usually strategies do not change. If enabled EA Studio will choose some of the indicators in the strategy and change their numeric values by a certain percentage (only for the test). If you have an over-optimized strategy, even minor changes in its parameters will make the profits drop significantly or the strategy may even lose money. +    * **Randomize indicator parameters** - EA Studio comes with this option off by default. This is because usually strategies do not change. If enabledEA Studio will select some indicators in the strategy and adjust their numeric values by a certain percentage (only for the test). If you have an over-optimised strategy, even minor changes in its parameters will make the profits drop significantlyor the strategy may even lose money. 
-    * **Randomize backtest starting bar** - will randomize starting bar of the test. Sometimes starting at a different point in time might bring your account to zero in very short period.+ 
 +**Backtest start** 
 + 
 +We call "order chain" the sequence of executed orders. As we have winning and losing positions, the total performance of the backtest depends on the starting point. 
 + 
 +For example, if we start the test on a local performance high, then the following losing period may cause a significant drawdown. 
 + 
 +The opposite case is also possible - if we start the test on a local low, the subsequent gains may show overestimated results. 
 + 
 +    * **Randomize backtest starting bar** - searches for a following opposite direction signal and starts the test from thereIt causes the backtest to begin with an opposite trade. This simulation aims to identify cases where initiating with an opposite trade compromises strategy performance. If the count of the shadowed opposite orders is lower than the selected count of tests, Monte Carlo uses random starting bar.
  
  
 ===== Simulations chart ===== ===== Simulations chart =====
  
-{{ :eas-guide:monte-carlo-simulations-chart.jpg?nolink |}}+{{:eas-guide:monte-carlo-simulations-chart.jpg?nolink|}}
  
 By the default running the Monte Carlo tool will run 20 tests with randomized data. The randomization of the data will be done according to the **Simulations** checklist and the values in the **Options** tab. By the default running the Monte Carlo tool will run 20 tests with randomized data. The randomization of the data will be done according to the **Simulations** checklist and the values in the **Options** tab.
Line 51: Line 63:
 ===== Confidence table ===== ===== Confidence table =====
  
-{{ :eas-guide:monte-carlo-confidence-table.jpg?nolink |}}+{{:eas-guide:monte-carlo-confidence-table.jpg?nolink|}}
  
 This table shows different statistics from the testing. This table shows different statistics from the testing.
Line 69: Line 81:
  
  
-===== Options =====+===== Settings =====
  
-{{ :eas-guide:monte-carlo-options.jpg?nolink |}}+{{:eas-guide:monte-carlo-settings-2.png?nolink&800|}}
  
   * **Count of tests** - choose how many tests you want to run.   * **Count of tests** - choose how many tests you want to run.
Line 102: Line 114:
 ===== Validation ===== ===== Validation =====
  
-{{ :eas-guide:monte-carlo-validation.jpg?nolink |}}+{{:eas-guide:monte-carlo-validation.jpg?nolink|}}
  
-When running the [[eas-guide:reactor|Reactor]] or [[eas-guide:validator|the Validator]] Monte Carlo testing is present in the Robustness testing section. +When running the [[eas-guide:reactor|Reactor]] or [[eas-guide:validator|the Validator]]Monte Carlo testing is present in the Robustness testing section. 
  
 The **Validated tests** setting uses the **Validation** settings in the Monte Carlo tool here. The **Validated tests** setting uses the **Validation** settings in the Monte Carlo tool here.
  
-{{ :eas-guide:reactor-validator-monte-carlo.jpg?nolink |}}+{{:eas-guide:reactor-validator-monte-carlo.jpg?nolink|}}
  
 These are very similar and work in the same way as the general [[eas-guide:acceptance-criteria|Acceptance Criteria]] for the [[eas-guide:collection|collection]] works. These are very similar and work in the same way as the general [[eas-guide:acceptance-criteria|Acceptance Criteria]] for the [[eas-guide:collection|collection]] works.
  
-In the above example a strategy will be considered to have passed the Monte Carlo validation only if at least 80% of the tests pass.+In the above examplea strategy will be considered to have passed the Monte Carlo validation only if at least 80% of the tests pass.
  
-~~DISQUS~~