Hi Joseph --
There are many uses of Monte Carlo in the fields of 
  econometrics and financial analysis and modeling. But the three described 
  below are the most applicable to trading systems development. Some are easy to 
  implement in AmiBroker, others are more difficult. Some are useful, others are 
  not useful or poor practice.
1. Use Monte Carlo techniques to study the 
  robustness of a trading system to small changes in the data. Small, random 
  amounts of noise can be added to the open, high, low, close, and volume to see 
  if the trading system is sensitive to noise in the data. This is easily done 
  and useful. There is a more detailed explanation, including code, in my book, 
  Quantitative Trading Systems.
2. Use Monte Carlo techniques to study 
  the robustness of a trading system to small changes in values of parameters. 
  When an optimization is performed, the value of an objective function is 
  calculated for every set of parameter values tested. The best set of 
  parameters is the set that give the highest value of the objective function. 
  If we consider a two dimensional optimization, say the lengths of two moving 
  averages, then we can imagine and visualize the objective function as a 
  surface above (or below) the plane defined by the two variables. If the 
  highest value of the objective function is an isolated peak, then the system 
  is sensitive to changes in the relationship between the model and the data 
  being modeled, and even small changes in the characteristics of the data will 
  cause a shift in the position of the optimal solution. That is, the system is 
  not robust relative to changes in the values of the parameters. If, on the 
  other hand, the highest value of the objective function is a broad plateau, 
  then the system is relatively insensitive to changes in the relationship 
  between the model and the data and small changes in the characteristics of the 
  data will not result in significant changes in the profitability of the 
  system. That is, the system is robust relative to changes in the values of the 
  parameters. 
Monte Carlo techniques can be used to study the 
  sensitivity of the system by adding random noise to the values of the 
  parameters, testing solutions near the optimal solution. There are many subtle 
  issues that arise when performing this type of study, making general solutions 
  very difficult. Specific solutions are easy to code by running a second set of 
  optimizations that look at the solution space near the previously selected 
  optimum. Additionally, some of the optimization methods included with current 
  releases of AmiBroker (such as the non-exhaustive method known as cmae -- 
  Covariance Matrix Adaptation Evolutionary Strategy) have a robustness 
  component that is used with no need for additional coding by the trading 
  system developer.
3. Monte Carlo techniques can be used to study the 
  risk profile of a sequence of trades. 
Your question prompts me to ask 
  how the tests you are running are defined. If the universe of stocks being 
  tested is comprised of the 3000 stocks that are the current members of the 
  Russell 3000 index, and the test period is the past ten years, then there is a 
  considerable survivorship bias in the test runs. That is, the 3000 companies 
  that are in the index now have survived the past ten years, but those 
  companies that disappeared during that period are not included in the tests. 
  That bias strongly affects the test results. In some of my research, I have 
  compared two studies:
1. Use the list of stocks currently in an 
  index.
2. Use the lists of stocks that were in an index at the start of 
  each year and run tests one year at a time, with lists reconstructed at the 
  beginning of each year.
The results of the first study are always 
  significantly better than the results of the second study. Ignoring the 
  survivorship bias will cause the trading system developer to significantly 
  over-estimate the likelihood that the system will be profitable in the 
  future.
Norgate Premium Data (http://www.premiumdata.net/) is an excellent source of 
  end-of-day data for the US and Australian markets, including data for issues 
  that have been delisted. They are in the process of developing historical 
  lists of components of major indexes which will be very valuable for study of 
  the effects of survivorship. 
Your question also raises a related issue 
  about how trades are selected. Some developers run a general test using a 
  large universe of possible issues to trade, which results in a number of 
  potential positions to enter that is greater than the funds available to take 
  those positions. They then consider using Monte Carlo techniques to analyze 
  what might happen if different combinations of issues are purchased. This is 
  an inappropriate use of Monte Carlo analysis and is poor trading system 
  development practice. I do not know of a single trader or trading company who 
  runs a test or report, generates a list of signals, sees that it has more 
  signals than he or she has money, and rolls dice to determine which of the 
  signals to actually take. The trader will always have a secondary set of 
  conditions that are used to rank-order the list of signals so that the best 
  candidates can be purchased. If the secondary set of conditions comes from non 
  technical analysis data, rankings from Investor's Business Daily for example, 
  then it will be difficult to incorporate the ranking in any trading system 
  development platform, including AmiBroker. If, however, the secondary set of 
  conditions comes from technical analysis, recent relative strength of price 
  for example, then it is easy to calculate a ranking score and use it so that 
  the signals generated do not exceed the funds available and there is no need 
  for application of a Monte Carlo technique. In AmiBroker, this secondary set 
  of conditions is stored in the reserved variable PositionScore. It is, in 
  effect, a tie-breaking component of the objective function.
Returning 
  to the question of reordering trades to study the risk associated with the 
  trading system. Use of Monte Carlo analysis in this area is very valuable. It 
  is best done using a program that accepts a list of closed trades and performs 
  the risk analysis. Equity Monaco, available free (http://www.tickquest.com/product/equitymonaco.html), 
  is a good one to start with. And Market Systems Analyzer (http://adaptrade.com/) has 
  more capability and a trial version.
I hope this has been 
  helpful.
Thanks for listening,
Howard 
  
On Sun, Jan 24, 2010 at 4:38 AM, Joseph Occhipinti 
  
<joseph_occhipinti@yahoo.com> 
  wrote:
  
  
    
    
    
    
    
    Does anyone know how to use this function in amibroker?
    
    Ie. when i "backtest" a system on all of the trades that would have 
    occurred in all / any of the stocks that make up the rusell3000 over the 
    past 10 years, does that backtest result only give ONE course of action, or 
    is it giving me the results of say 10,000 courses of action (or histories, 
    or whatever the correct term is)
    
    I am assuming it is only the ONE as I am not seeing any standard 
    deviations or confidence levels in the results summary. 
    
    1. please advise on whether this function exists 
    2. where such a fucntion can be located on the program
    
    thank you
    
     
    
    See what's on at the movies in your area. 
Find out now.