PureBytes Links
Trading Reference Links
|
<FONT face=Arial color=#0000ff
size=2>Thanks Pal,
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Arial color=#0000ff
size=2>Andrew pointed out my problem, if you like to try it make add the two
arguments to the SetForeign():
<FONT face=Arial color=#0000ff
size=2>
You 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); (Andrew)
<FONT
face="Courier New">
<FONT face=Arial color=#0000ff
size=2>btw, the trading system is just a dummy system to make the
example work. Substitute your own system to see what it
does.
<FONT face=Arial color=#0000ff
size=2>
<FONT face=Arial color=#0000ff
size=2>take care,
<FONT face=Arial color=#0000ff
size=2>herman
<FONT face=Tahoma
size=2>-----Original Message-----From: palsanand
[mailto:palsanand@xxxxxxxxx]Sent: December 13, 2003 2:55
PMTo: amibroker@xxxxxxxxxxxxxxxSubject: [amibroker] Re:
Problem calculating Sum of Equities for
WatchlistPreviously I had set Range to "All
quotations" in AA which resulted in negative values for equity. I
changed it to 8/15/03 to 12/15/03 which resulted in some positive values
for equity.rgds, Pal--- In amibroker@xxxxxxxxxxxxxxx, "palsanand"
<palsanand@xxxx> wrote:> I ran this code in an exploration in AA
and got all negative values > for the equity and 0.00 for WLSumEquity
columns for each ticker. > Back test produced some positive
results. Sorry, couldn't be of > further help.> >
rgds, Pal> --- 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
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.
|