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

[amibroker] testing signal correlation



PureBytes Links

Trading Reference Links

In message # 52495, giggollo99 describes a technique of translating his
broker's transaction data into AFL statements and then backtesting to
get statistics, etc.

He says:

One interesting way I have started using the new Portfolio
Backtester is to track my own live trading performance. Here's how:

1. Extract transactions list from my brokerage's "Transactions" page
2. Write a small script to convert Transactions list into AFL
buy/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 window
5. Add following line:

PositionSize=Buysize*BuyPrice;

6. Run Portfolio Backtester


This is straining my understanding of the array and database processing
of AB, unfortunately.  I can not see how the code lines above,
replicated many times for many trades, can hold and keep track of all of
the trade data that would be used.

If giggollo99 is reading, or anyone else who understands this, can help
me out, I would like to try this.

To me, it seems one has to use some massive amount of IF or IIF
statements to separate the different dates; otherwise, in the above
code, the Buysize and BuyPrice arrays get replaced for each use of the
assigned variable.

So

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);

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);

Etc

PositionSize=Buysize*BuyPrice;


I guess the place I am confused is when more than one security is
purchased on a single day (as shown above).  It seems like BuySize (and
BuyPrice) gets overwritten each time (because there can only be one
value for either of these on a single bar).

Has anyone tried this?  Can anyone help me see the light?

Ken




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 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
---------------------------------------------------------------------~->

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/