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

[amibroker] portfolio trading - poor man's scoring



PureBytes Links

Trading Reference Links

Tomasz helped me out (thanks again) with reading the manual (4.42 
beta readme).
I had wanted to use existing code with minimal change to take 
advantage of the new portfolio scoring feature, and thereby see how 
position size and the other parameters affected drawdown.

The code below now works for long only trades (doesn't go short).
The trick for me was that a score of zero disqualifies scoring and 
results in exit from a long position. The buy/sell criteria below are 
not recommended!

/*CB-PB*/
PositionSize=-2;
Hhb=HHVBars(H,19)<=12;
Lowp=L<=LLV(L,7);
Buy=Hhb AND Lowp;
Sell= HHV(H,12)<=H ;

/*poor man's scoring*/
Somebuy=Flip(Buy,Sell);
PositionScore=IIf(somebuy,somebuy,0);

regards 
Gerry



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