Hello,

You were using Microsoft's random in the formula you posted.
Random() AFL function uses Microsoft rand() function from the C run time 
library.
mtRandomA uses Mersene Twister algorithm which is way superior and specifically 
designed
for use in Monte-Carlo applications. Consult the manual 
http://www.amibroker.com/f?mtrandom for more details.

To plot histogram, you need to:
a) copy paste results to Excel (Ctrl+C in AA window, then Ctrl+V in Excel)
b) in Excel one can easily create distribution chart of any system metric using 
Tools->Data Analysis, "Histogram" option.

(Assumes that you have Data analysis add-on installed in Excel - it can be 
found on Office CD-ROM/DVD)

Best regards,
Tomasz Janeczko
amibroker.com
  ----- Original Message ----- 
  From: Keith McCombs 
  To: [email protected] 
  Sent: Thursday, January 22, 2009 8:27 PM
  Subject: Re: [amibroker] Re: Using Optimizer with PositionScore=Random()


  TJ --
  "PositionScore SHOULD be an array." -- Thank you.

  "Microsoft's random" -- Who mentioned Microsoft's random? 
  I suggested exporting to a spread sheet for further analysis.  For example, I 
like to plot a histogram of the returns and scatter diagrams of different 
metrics.

  -- Keith 


  Tomasz Janeczko wrote: 

    That is incorrect. PositionScore SHOULD be an array. Also use mtRandomA()
    instead. Mersene Twister is way way way better than Microsoft's random.

    Best regards,
    Tomasz Janeczko
    amibroker.com
      ----- Original Message ----- 
      From: Keith McCombs 
      To: [email protected] 
      Sent: Thursday, January 22, 2009 7:13 PM
      Subject: Re: [amibroker] Re: Using Optimizer with PositionScore=Random()


      Richard --
      runs = 1000;  // Number of runs using random scores
      TotalRuns = Optimize("TotalRuns", 1, 1, runs, 1);
      PositionScore = LastValue(Random());  // need value, not array
      -- Keith

      richpach2 wrote: 
        Keith,

        How would you use Random() to set up an optimization to run say 1000
        iterations overnight?

        Regards
        Richard

        --- In [email protected], Keith McCombs <kmcco...@...> wrote:
        >
        > Curt --
        > IMO, it makes a whole lot of sense. 
        > 
        > Notice that if your strategy could select many stocks to trade, if 
you 
        > do not use Random(), the system is biased to those stocks whose 
symbols 
        > are near the front of the alphabet.
        > 
        > You can use Random() to set up an optimization to run say 1000 
        > iterations overnight. Export the results to your favorite spread 
sheet 
        > and see a more realistic distribution of returns you might expect.
        > -- Keith
        > 
        > Curt wrote:
        > >
        > > --- In [email protected]
        <mailto:amibroker%40yahoogroups.com>, 
        > > "Curt" <crcmcc@> wrote:
        > > >
        > > > Does it make sense to try to use the optimizer if PositionScore
        is set
        > > > to Random()? For example:
        > > >
        > > > OptimizerSetengine("cmae");
        > > > PositionScore = Random();
        > > >
        > > I should clarify that by setting PositionScore=Random(), runs with
        > > exactly the same parameters will not produce the same results. This 
is
        > > because, in the cases where the portfolio becomes fully invested, a
        > > different set of stocks will populate the portfolio each run.
        > >
        > >
        >



   

Reply via email to