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

[amibroker] PRSI



PureBytes Links

Trading Reference Links

Is there some way to get <Number Value> <at current bar> from <array>?
That would allow me to code what i want....(or maybe there's another 
way)....
I would like to redistribute any cash to new positions, while 
managing the relationship between maxopenpositions and positionsize 
as exampled below.
I am having problems with the need to use numbers rather than arrays 
to drive the values in maxopenpositions and positionsize.
What appears to happen (the way i have coded it anyway) is that if 
the same stock is re-entered it picks up its old equity value.
Is that what others experience?
If i use an array variable for either maxopenpositions or 
positionsize it doesn't work (at all or 'as i want it', in one case 
it's a bad argument, in the other case it appears to take the first 
value).
My idea is to set maxopenpositions to 1 position less than that 
implied by using up the position size value.
So if i have $1000x and positionsize is -5 (ie 5%..please ignore for 
now that it might be too high in general), i have maxopenpositions 
set to 19. This seems to redistribute cash over time the way i want, 
BUT i want to change maxopenpositions as portfolio equity changes.
IE, if i now have $2000x, i want it to rise to 39.
If i could code something like
  totalequity=foreign("~~~equity","c"); 
  psize=<some function of total equity> ;//as a number
  maxopen=(totalequity/psize)-1;// as a number
  psize=totalequity/(maxopen+1);
..then i could get the result i want.
Any ideas on how to accomplish that (or my intent) would be 
appreciated.
  



------------------------ 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 
Yahoo! Groups Links

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

<*> 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/