Hi Mikey -- Positive values of PositionScore are used to rank issues to enter long positions. Negative values are used to rank issues to enter short positions. Try transforming the random numbers so that they run from -0.50 to +0.50. That is, try:
PositionScore = random() - 0.50; MTRandom() is better than random(), so you may want to use it instead. You can read about it in the AmiBroker reference guide. Thanks, Howard On Wed, Jul 14, 2010 at 7:11 AM, mikk12345 <[email protected]> wrote: > > > Hi, This is what i want to do. I have 10 stocks in my ticker list. I want > to randomly select 5 long and 5 short each worth 100,000 and hold for 50 > days in the backtester. > > Ive tried the following:- > > Buy= 1; > Sell= 0; > Short=1; > Cover=0; > ApplyStop(stopTypeNBar,stopModeBars,50,1); > > PositionScore=Random(); > > PositionSize=100000; > > Ive put 1,000,000 in the equity box. > > This only returns long only. > > Best Regards, > > Mikey. > > >
