[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Re: Rotational Trading and Position Sizing Problem



PureBytes Links

Trading Reference Links

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 amibroker@xxxxxxxxxxxxxxx, "KBGlenn" <kbglenn@xxx> 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 amibroker@xxxxxxxxxxxxxxx, "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 amibroker@xxxxxxxxxxxxxxx, "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 );
> > >
> >
>



------------------------------------

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/