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

RE: [amibroker] Re: Problem calculating Sum of Equities for Watchlist



PureBytes Links

Trading Reference Links




<FONT face=Arial color=#0000ff 
size=2>Thank you Andrew!!! 
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>You made my day :-) it now works 
marvelously!
<FONT face=Arial color=#0000ff 
size=2> 
<FONT face=Arial color=#0000ff 
size=2>herman.

  <FONT face=Tahoma 
  size=2>-----Original Message-----From: Andrew 
  [mailto:a.perrin@xxxxxxxxxxxxxxx]Sent: December 13, 2003 2:06 
  PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re: 
  Problem calculating Sum of Equities for 
  WatchlistHermanYou need to set tradeprices=True 
  as opposed to default of false.SetForeign( ticker, fixup = True, 
  tradeprices = False ) to perform correct equity(0) calculations.  
  ie.  SetForeign(Ticker,True,True); HTHAndrew--- In 
  amibroker@xxxxxxxxxxxxxxx, "Herman vandenBergen" <psytek@xxxx> 
  wrote:> Hello,> > I need an Exploration that calculates 
  the sum of equities for a watchlist.> This has to be an looping 
  solution because I want to do this on the fly> while dynamically 
  changing system parameters, I cannot use composites.> > 
  Below is a simplification of what I have but the sum of Equities in the 
  last> column keeps changing because the individual equities (based 
  on> SetForeign()) keep changing. I confirmed this with DebugView. 
  Something is> out of sync... Can somebody tell me where I went 
  wrong?> > Many thanks for any help you can give,> 
  herman> > Buy=Sell=Short=Cover=0;> 
  Filter=Status("LastBarInTest");> > // system's code, executed 
  for each stock in Exploration> Buy=Cross( MACD(), Signal() );> 
  Sell = Cross( Signal(), MACD() );> Short = Sell; Cover = Buy;> E 
  = Equity(0);> AddColumn(E,"Equity",1.2);> > // Same code, 
  calculate sum of Equity for watchlist> List = 
  GetCategorySymbols(categoryWatchlist,8);> > Et = 0;> for( 
  n=0; (Ticker=StrExtract( List, n))!= ""; n++)>    
  {>    Ticker=StrExtract( List, 
  n);>    SetForeign(Ticker);>    
  Buy=Cross( MACD(), Signal() );>    Sell = Cross( 
  Signal(), MACD() );>    Short = Sell;   Cover 
  = Buy;>    E1 = Equity(0);>    Et 
  = Et + E1;>    //_TRACE(List+"  "+Ticker+"  
  "+NumToStr(n)+"  "+NumToStr(E1));>    
  AddColumn(E1,Ticker,1.2);>    
  RestorePriceArrays();>    }> 
  AddColumn(Et,"WLSumEquity",1.2) ;Send 
  BUG REPORTS to bugs@xxxxxxxxxxxxxSend SUGGESTIONS to 
  suggest@xxxxxxxxxxxxx-----------------------------------------Post 
  AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A 
  href="">http://groups.yahoo.com/group/amiquote/messages/)--------------------------------------------Check 
  group FAQ at: <A 
  href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 







Yahoo! Groups Sponsor


  ADVERTISEMENT 









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 the Yahoo! Terms of Service.