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

Re: [amibroker] Re: SetForeign() again



PureBytes Links

Trading Reference Links




Dimitris,
 
Actually it happens for the very last bar because of the 
following change described in the read me:
 

changed handling of open positions in old backtester to match with portfolio 
backtester and equity plot:-  open positions are closed always at CLOSE 
price (previously were closed at trade price)
Due to oversight it is close price of current symbol always. 
Will be fixed in next beta.
 
Temporary workaround: close positions at the last 
bar:
 
lastbar = BarIndex()==Lastvalue(BarIndex());
Buy=Cross(StochD(),30);Sell=Cross(StochD(),80);Short=Sell;Cover=Buy;
 
Sell = Sell OR Lastbar;
Cover = Cover OR 
lastbar;e1=Equity(1,0);Plot(e1,"STOCK",5,1); list = 
GetCategorySymbols( categoryWatchlist, 8 );for( i = 0; ( sym = StrExtract( 
list, i ) ) != ""; i++ ){SetForeign(sym,True,True);global Buy;global 
Sell;global Short;global 
Cover;Buy=Cross(StochD(),30);Sell=Cross(StochD(),80);Short=Sell;Cover=Buy;
Sell = Sell OR Lastbar;
Cover = Cover OR lastbar;
e2=Equity(1,0);Plot(e2,sym,i+1,8);}
 
 
 
Best regards,Tomasz Janeczkoamibroker.com
<BLOCKQUOTE 
>
  ----- Original Message ----- 
  <DIV 
  >From: 
  Dimitris 
  Tsokakis 
  To: <A title=amibroker@xxxxxxxxxxxxxxx 
  href="">amibroker@xxxxxxxxxxxxxxx 
  Sent: Tuesday, December 02, 2003 11:48 
  AM
  Subject: [amibroker] Re: SetForeign() 
  again
  
  Tomasz,I have a small WL8 with 
  BRCM, CPWR, FLEX, JDSU.The <FONT 
  face="Courier New">
  Plot(StochD(),"STOCK",5,1); list = GetCategorySymbols( 
  categoryWatchlist, 8 );for( i = 0; ( sym = StrExtract( list, i ) ) != ""; 
  i++ 
  ){SetForeign(sym,True,True);e2=StochD();Plot(e2,sym,i+1,8);}<FONT 
  face="Times New Roman">
  and the
  Buy=Cross(StochD(),30);Sell=Cross(StochD(),80);Short=Sell;Cover=Buy;e1=Equity(1,0);Plot(e1,"STOCK",5,1); 
  list = GetCategorySymbols( categoryWatchlist, 8 );for( i = 0; ( sym = 
  StrExtract( list, i ) ) != ""; i++ 
  ){SetForeign(sym,True,True);global Buy;global Sell;global 
  Short;global 
  Cover;Buy=Cross(StochD(),30);Sell=Cross(StochD(),80);Short=Sell;Cover=Buy;e2=Equity(1,0);Plot(e2,sym,i+1,8);}are 
  plotted.The last Equity value is quite strange and different from stock to 
  stock.[My initial equity is 10000 and the min.shares is 0.01]Something 
  is going on with the last bar[s], the 4 equity values are correct [and 
  unchanged] from the beginningup to two/three bars before the end.
  The result ?? All my Inspection Points graphs are useless now !!
  The Dec2 session is an Inspection bar for one of them...Please 
  advise.Dimitris Tsokakis
   
   
  Hello,It is not broken. But 
  please note that Equity() now uses MINSHARES setting.It is mentioned 
  in the Read Me but I want to remind that "MinShares" setting (now 
  available in Auto-analysis -> Settings, "General" page )affects ALL 
  backtesters now. This includes Equity() function.So for example if you 
  are trying to display equity for say DJIAbut the initial equity is less 
  than (say) 9000 then no trade will be entered ifMinShares is set to 
  1.You would need to enter 0.0001 in "MinShares" to allow very small 
  fractionalquantities.Hope this helps.Best 
  regards,Tomasz Janeczkoamibroker.com----- Original Message ----- 
  From: "DIMITRIS TSOKAKIS" <<A 
  href=""><FONT 
  face="Courier New">TSOKAKIS@xxxx<FONT 
  face="Courier New">>To: <<A 
  href=""><FONT 
  face="Courier New">amibroker@xxxxxxxxxxxxxxx<FONT 
  face="Courier New">>Sent: Tuesday, December 02, 2003 8:02 
  AMSubject: [amibroker] SetForeign() again> Tomasz,> 
  In 4.44 you introduced the > SetForeign( ticker, fixup = True, 
  tradeprices = False) > and this allowed Equity() to work well with 
  SetForeign.> Unfortunately with 4.50 it is down again. Can you fix it, 
  please.> Dimitris TsokakisSend 
  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.