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

[amibroker] Re: Portfolio trade selection



PureBytes Links

Trading Reference Links

That works! Thanks.
I needed a script for random entries on a portfolio to test my exit 
strategies. Without using a random number in PositionSize only the 
first 4 shares were selected due to the alphabetical choice of 
amibroker. Now I have script that can do random entries on randomly 
selected shares of a portfolio. Maybe its helpful for somebody:

SetTradeDelays( 1, 1, 1, 1 ); 
SizePerTrade=Param("Position Size [% of Equity]",25,5,100,1);

SetPositionSize( SizePerTrade, spsPercentOfEquity ); 

PositionScore = 100*mtRandom(); // the highest absolute value gets 
selected first

Cond1= DayOfWeek()==1; //enter only on mondays
RandomEntry=mtRandom()*100;

Buy=Cond1 AND RandomEntry>50;
Sell=0;
Short=Cond1 AND RandomEntry<50;
Cover=0;

/* N-bar stop */ 
ApplyStop( stopTypeNBar, stopModeBars, 9, 1, 20,1 ));




--- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@xxx> 
wrote:
>
> That's correct.
> 
> (BTW: if you like random choice you can use Rand() or mtRand() :-)
> but I think it is rather poor idea)
> 
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message ----- 
> From: "mmike8090" <mmike8090@xxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Sunday, July 06, 2008 5:20 PM
> Subject: [amibroker] Re: Portfolio trade selection
> 
> 
> Thanks for the fast reply!
> I know from wealth-lab that trades are choosen radomly in the case 
of
> no available funds. I meanwhile read in the "AB Backtester
> Basics.doc" file from this group that if Positionscore is not set at
> all, then AB just chooses the available tickers alphabetically. Is
> this right?
> 
> Best Regards
> mmike
> 
> --- In amibroker@xxxxxxxxxxxxxxx, "Tomasz Janeczko" <groups@>
> wrote:
> >
> > Hello,
> >
> > It does not make difference. The same rules (PositionScore)
> > decide no matter if the limit is the number of open positions
> > or available cash.
> >
> > PositionSize variable (or SetPositionSize function) decides about
> the SIZE
> > (in shares or funds allocated).
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "mmike8090" <mmike8090@>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Sunday, July 06, 2008 4:11 PM
> > Subject: [amibroker] Portfolio trade selection
> >
> >
> > Hi,
> >
> > i have learned in the user guide how to use position score to 
decide
> > which trades should be entered if there are more entry signals on
> > different securities than maximum allowable number of open
> positions or
> > available funds. But I haven´t fount anything about what Amibroker
> > doesn when there are more ENTRY signals than available
> positions/cash
> > and nothing is declared to position score???
> >
> > Thanks for your help!
> >
> > Best Regards
> > mmike
> >
> >
> > ------------------------------------
> >
> > 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
> >
> 
> 
> 
> ------------------------------------
> 
> 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
>



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

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/