PureBytes Links
Trading Reference Links
|
Hey, who you calling a Redneck....:).....
Anthony
----- Original Message -----
From: "dingo" <dingo@xxxxxxxxxxxx>
To: "_amibroker_yahoo" <amibroker@xxxxxxxxxxxxxxx>
Sent: Saturday, January 31, 2004 8:21 PM
Subject: [amibroker] These #$%! Arrays are getting the best of me!
> Totally wrapped around the axle tonight and need some HELP!!
>
> I'm trying to figure out how to take a routine such as the simple one
below:
>
> --------------------------------8<----------------------------------------
-
>
> SetOption("InitialEquity", 100000 );
>
> function CMO(Price, Length)
> {
> CMOup = IIf(Price > Ref(Price, -1), Price - Ref(Price, -1), 0);
> CMOdn = IIf(Price < Ref(Price, -1), Ref(Price, -1) - Price, 0);
>
> CMOSumUp = Sum(CMOup, Length);
> CMOSumDn = Sum(CMOdn, Length);
>
> CMOx = 100 * (CMOSumUp - CMOSumDn) / (CMOSumUp + CMOSumDn);
>
> return (CMOx);
> }
>
> BuyPrice = SellPrice = ShortPrice = CoverPrice = Open;
> SetTradeDelays(1, 1, 1, 1);
>
> CmoSig = Cmo(C, 5);
>
> /* Test trigger levels and calc different metrics */
>
> for (CMOLevel = 10; CMOLevel < 50; CMOLevel++)
> {
> PositionSize = 1000;
>
> Buy = Cross(-CMOLevel, CmoSig);
> Sell = Cross( CmoSig, CMOLevel);
>
> Short = Sell;
> Cover = Buy;
>
> }
>
> NumColumns = 1;
>
> Filter = 1;
>
> --------------------------------8<----------------------------------------
-
>
> And add code in the for loop to figure out the following metrics:
>
> For each trigger level:
> Number of Shorts within the date range of the test.
> Number of Longs.
> Number of profitable Shorts
> Number of profitable Longs
> Avg Pft% per Bar of the shorts
> Avg Pft% per Bar of the longs
>
> Then I need to take the above and
>
> See if all of the triggers were profitable
> Pick the best trigger based on Total Pft % / Bar
> Pick the best trigger based on best Pct winners of Longs + Shorts
>
> Soooo, How 'bout some of you array savants give me some pointers before I
go
> to out to the pickup truck and get the gun outta the rack in the rear
window
> and make a big mess that the little woman'll have to clean up? (feeling
> very redneck tonight it seems..!!)
>
> TIA
>
> d
>
>
>
>
> 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:
> http://docs.yahoo.com/info/terms/
>
>
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.572 / Virus Database: 362 - Release Date: 1/27/2004
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/
|