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

Re: [amibroker] Re: Help With "MaxOpenPositions"



PureBytes Links

Trading Reference Links

Hello,

The code from read me used constant for posqty.

Again: 
SetOption("MaxOpenPositions", 30 ) <-- This has to be constant

It is NOT the number of positions taken at given bar but
absolute maximum allowable ever. You just say to yourself
"I don't want to trade more than 30 stocks at once ever".

As to what you want to achieve (varying number of open positions
PER BAR) you need to use PositionSize for that.

But first you would need to iterate through your watch list
(using GetCategorySymbols) and find how many symbols
have the same top rank (it requires sorting) This is possible using Osaka plugin
http://www.amibroker.net/3rdparty.php.

Then depending on how many symbols have the same top rank
you would be able to set position size accordingly:

PositionSize = -100/ howmanystockwiththesamerank.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "msc626" <msc626@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, October 25, 2003 1:07 AM
Subject: [amibroker] Re: Help With "MaxOpenPositions"


> Yes, TJ, I misspoke.
> My code is from the Help file:
> 
> posqty=x;
> SetOption("MaxOpenPositions",posqty);
> PositionSize=-100/posqty;
> 
> I want to vary posqty so that posqty=1 when there is only one stock 
> with the top PositionScore; 
> posqty = 2 when there are two stocks with the same top PositionScore; 
> and so forth.
> 
> dale b
> 
> > Hello,
> > 
> > MaxOpenPositons is just that: absolute MAXIMUM number of open 
> positions.
> > It is 'set and forget' kind of settings.
> > 
> > To vary number of positions taken you should use PositionSize
> > instead since it can be set per symbol and per bar.
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "msc626" <msc626@xxxx>
> > To: <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Saturday, October 25, 2003 12:24 AM
> > Subject: [amibroker] Help With "MaxOpenPositions"
> > 
> > 
> > > Could anyone suggest a method to vary "MaxOpenPositions" 
> dynamically 
> > > based on PositionScore?
> > > The problem that I am attempting to solve is what to do when 
> several 
> > > stocks in my watchlist have the identical PositionScore. 
> > > For example:
> > > if two stocks have the same top score, then I would like 
> > > MaxOpenPositions = 2;
> > > if three stocks have the same top score, then I would like 
> > > MaxOpenPositions = 3;
> > > ...and so on.
> > > Thanks for your help.
> > > 
> > > dale b
> > > 
> > > 
> > > 
> > > Send BUG REPORTS to bugs@xxxx
> > > Send SUGGESTIONS to suggest@xxxx
> > > -----------------------------------------
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > --------------------------------------------
> > > Check group FAQ at: 
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> > > 
> > > Your use of Yahoo! Groups is subject to 
> http://docs.yahoo.com/info/terms/ 
> > > 
> > > 
> > >
> 
> 
> 
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
> 
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 
> 
> 
> 

------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

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