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

[amibroker] Re: "Moving Linear Regression Line"



PureBytes Links

Trading Reference Links




<FONT face=Arial 
color=#0000ff size=2>the key to it working is that the bars are only affected 
when the date and ticker match.  
<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>He's forcing buy signals on those bars with the 
OR.  Remember that AB processes the formula for 
each symbol.  
<FONT face=Arial 
color=#0000ff size=2><FONT 
face=Arial color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>and other 2 lines load the size and price only on those 
bars other wise (the false part of the IIF just leaves what what was in 
there.  
<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>And you are correct - it will take a LOT of  
code unless you figure out a way to have a CSV file with Ticker, 
Date, Buysize, buyprice per line and then have a script routine to use the 
Filesystem object to read it in and load up some arrays then do the 
processing.  That way you wouldn't have to build a lot of code - just the 
CSV file.
<FONT face=Arial 
color=#0000ff size=2> 
<FONT face=Arial 
color=#0000ff size=2>d


From: Ken Close [mailto:closeks@xxxxxxxx] 
Sent: Tuesday, January 20, 2004 7:18 PMTo: AmiBroker 
ListSubject: [amibroker] Analyzing Actual Trades with AB 
Backtest
In message # 52495, giggollo99 describes a technique of 
translating hisbroker's transaction data into AFL statements and then 
backtesting toget statistics, etc.He says:One interesting 
way I have started using the new PortfolioBacktester is to track my own live 
trading performance. Here's how:1. Extract transactions list from my 
brokerage's "Transactions" page2. Write a small script to convert 
Transactions list into AFLbuy/sell signals...e.g....Buy=Buy OR 
(DateNum()==1031118 AND Name()=="URMP");Buysize= IIf(DateNum()==1031118 AND 
Name()=="URMP",6000,buysize);BuyPrice=IIf(DateNum()==1031118 AND 
Name()=="URMP",0.225,BuyPrice);...4. Copy/Paste the AFL code into AA 
window5. Add following line:PositionSize=Buysize*BuyPrice;6. 
Run Portfolio BacktesterThis is straining my understanding of the 
array and database processingof AB, unfortunately.  I can not see how 
the code lines above,replicated many times for many trades, can hold and 
keep track of all ofthe trade data that would be used.If giggollo99 
is reading, or anyone else who understands this, can helpme out, I would 
like to try this.To me, it seems one has to use some massive amount of 
IF or IIFstatements to separate the different dates; otherwise, in the 
abovecode, the Buysize and BuyPrice arrays get replaced for each use of 
theassigned variable.SoBuy=Buy OR (DateNum()==1031118 AND 
Name()=="URMP");Buysize= IIf(DateNum()==1031118 AND 
Name()=="URMP",6000,buysize);BuyPrice=IIf(DateNum()==1031118 AND 
Name()=="URMP",0.225,BuyPrice);Buy=Buy OR (DateNum()==1031118 AND 
Name()=="MSFT");Buysize= IIf(DateNum()==1031118 AND 
Name()=="MSFT",1000,buysize);BuyPrice=IIf(DateNum()==1031118 AND 
Name()=="MSFT",26.00,BuyPrice);EtcPositionSize=Buysize*BuyPrice;I 
guess the place I am confused is when more than one security ispurchased on 
a single day (as shown above).  It seems like BuySize (andBuyPrice) 
gets overwritten each time (because there can only be onevalue for either of 
these on a single bar).Has anyone tried this?  Can anyone help me 
see the light?KenSend 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 


Yahoo! Groups Links
  To visit your group on the web, go to:<A 
  href="">http://groups.yahoo.com/group/amibroker/  

  To unsubscribe from this group, send an email to:<A 
  href="">amibroker-unsubscribe@xxxxxxxxxxxxxxx  

  Your use of Yahoo! Groups is subject to the <A 
  href="">Yahoo! Terms of Service. 



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