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

Re: [amibroker] Using Portfolio Backtester To Track Performance - Need Pyramiding



PureBytes Links

Trading Reference Links

Hello,

This is a very interesting finding of using AB portfolio tester.

I am struggling to code it in AFL to do the opposite of pyramiding e.g. I
bought 10 contracts initially then I sold 5 contracts when the price reach a
2 to 1 reward/risk ratio, then I sold another 3 when the price reach a 3 to
1 r/r ratio or hit the trailing stop then I sold the remaining when the
price hit my trailing stop.

BTW, is it your script will generate a long list of the following based on
number of trades you made ? If possible, would you mind to share the script
?

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

Tks
KK

----- Original Message -----
From: "giggollo99" <giggollo@xxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, November 20, 2003 1:26 PM
Subject: [amibroker] Using Portfolio Backtester To Track Performance - Need
Pyramiding


> 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
>
> and Voila!...i get a plethora of metrics telling me how well i am
> doing, i get account equity curves, trade equity curves, i get trade
> by trade P/L and MAE info and much more!...This is extremely useful
> information to have if you are a discretionary (or semi-
> discretionary trader). It is interesting to start looking at your
> own discretionary trading as a system, because in the end it all
> boils down to buy/sell signals and you can see what areas you need
> to work on..Even if you are trading a system (or trying to :) ),
> using this approach can provide valuable information regarding the
> difference between perceived theoretical performance of your system
> and actual measured performance. It can show you where your actual
> results are deviating from the theoretical expectations.
>
> Through this post I also would like to draw attention to the fact
> that implementing pyramiding is an essential step towards the
> maturing of the portfolio backtester. Right now, for example,
> Portfolio backtester gets the P/L wrong on some trades just because
> pyramiding is not yet implemented. It retains the share size of the
> first trade even if i bought the same security multiple times before
> selling. I do not know of a way to get around this except to wait
> patiently for pyramiding to be implemented (i am open to
> suggestions?)
>
> I thank Tomasz for providing such a nice tool and continuing to
> improve the product with great momentum. I am *really* looking
> forward to seeing pyramiding implemented in the near future.
>
> Thanks and Best regards to all
> g
>
>
>
> 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 http://docs.yahoo.com/info/terms/
>
>
>


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

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 http://docs.yahoo.com/info/terms/