Double check your "initial equity" setting and make sure it is $100k 
and not $10k because your code works for me. I just plugged in 2 
simple formulas for A2 and B2 and it ran just fine, producing trades 
of 1 position at ~$100k each.  When I changed your PosSize param to 
2, then it produced 2 positions at ~$50k each.

--- In [email protected], "KBGlenn" <[EMAIL PROTECTED]> wrote:
>
> True,
> 
> If you do it they way you wrote it.  However, I'm beginning to 
wonder
> if something is corrupted in my Amibroker (or there's a setting I've
> accidentally changed that I can't find) .  Even on normal trades I'm
> getting this...and I have a "scale in/out" column in the results 
table
> I've never seen before (or never noticed)???
> 
> 
> --- In [email protected], "Ed Hoopes" <reefbreak_sd@> wrote:
> >
> > I think for PS in percent to work, it has to be a negative number 
like:
> > 
> >     PositionSize  = -100 / MaxPos;
> > 
> > 
> > --- In [email protected], "KBGlenn" <kbglenn@> wrote:
> > >
> > > I am trying to do a very simple rotational trading backtest 
where I am
> > > testing using the below code.  However, the position sizing is 
very
> > > messed up.  For example, I have the initial equity setting set 
at
> > > $100,000 and the first 8 trade of a series (all with the 
default of
> > > one position only and Buy/Close delays set at 0) taking 
positions of
> > > less than $10,000.  I've tried different toggling of the the 
allow
> > > position size shrinking and use previous bar for position 
sizing to no
> > > avail. Even fixing position size at a small value doesn't seem 
to
> help.
> > > 
> > > Help! 
> > > 
> > > A2 and B2 code here
> > > 
> > > Score = ((A2*.5) + (B2*.5))+10;//add 10 to prevent shorts
> > > 
> > > SetBacktestMode( backtestRotational );
> > > 
> > > WRH = Param("Worst Rank Held", 1, 1, 5, 1); 
> > > SetOption("WorstRankHeld",WRH);
> > > 
> > > HMB = Param("Hold Min Days", 7, 1, 21, 1);//or min bars
> > > SetOption("HoldMinDays", HMB);
> > > 
> > > PosSize = Param("Position Size", 1, 1, 5, 1 );
> > > //PosSize = Optimize("Position Size", 1, 1, 5, 1 );
> > > 
> > > SetOption("MaxOpenPositions", Possize ); 
> > > SetPositionSize( 100/PosSize, spsPercentOfEquity ); 
> > > //SetPositionSize( 10000, spsValue ); 
> > > 
> > > PositionScore = Score;
> > > //ApplyStop( 3, 1, 21, 1, volatile = False, ReEntryDelay = 0 );
> > >
> >
>


Reply via email to