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

[amibroker] Re: Pristine Trading Method testing



PureBytes Links

Trading Reference Links

Steve,

I started working on two of the guerilla plays, Gap-n-Snap and Gap 
Surprise.  I stopped working on them though so they might not be 
totally complete.  It might be better to test these out with the real-
time version of AB.

Here is the AFL code for both:

// Pristine Gap-n-Snap

redbars = 
 Ref(C,-3) < Ref(O,-3) AND Ref(C,-2) < Ref(O,-2) AND Ref(C,-1) < Ref
(O,-1)
 AND Ref(C,-1) < Ref(C,-2) AND Ref(C,-2) < Ref(C,-3) AND Ref(C,-3) < 
Ref(C,-4); // at least 3 red  bars

Buy =
 redbars
 AND Ref(C,-1) <= 1.2*Ref(L,-1) AND Ref(O,-1) >= 0.8*Ref(H,-1) // 
20/20 bar
 AND Ref(O,-1)-Ref(C,-1) >= 1  // with at least $1 range
 AND O <= Ref(C,-1)-0.5  // at least $0.50 gap down
 AND H >= 0.07+Ref(L,-1)  // confirmed, i.e. traded at least 0.05 
above prior day's low
 AND O < Ref(L,-1)-0.07 AND O < H
;

BuyPrice=0.07+ValueWhen(Buy, Ref(L,-1));
stopprice=ValueWhen(Buy, L)-0.07;

target2= H >= 2 + BuyPrice;
Days3 = BarsSince(Buy) == 2;
stopped = L <= stopprice;

Sell=
 target2
 OR Days3
 OR stopped
;

SellPrice=IIf(target2, 2+BuyPrice, IIf(stopped, ValueWhen(Buy,L)-
0.07, IIf(Days3, C, C)));

//////////////////////////////////////////


// Pristine Gap Surprise

redbars = 
 Ref(C,-3) < Ref(O,-3) AND Ref(C,-2) < Ref(O,-2) AND Ref(C,-1) < Ref
(O,-1)
 AND Ref(C,-1) < Ref(C,-2) AND Ref(C,-2) < Ref(C,-3) AND Ref(C,-3) < 
Ref(C,-4); // at least 3 red  bars

Buy =
 redbars
 AND Ref(C,-1) <= 1.2*Ref(L,-1) AND Ref(O,-1) >= 0.8*Ref(H,-1) // 
20/20 bar
 AND Ref(O,-1)-Ref(C,-1) >= 1  // with at least $1 range
 AND O >= Ref(C,-1)+0.5  AND O <= Ref(C,-1)+1 // a $0.50-$1 gap up
 AND O+0.05 < H
;

BuyPrice=O+0.05;
stopprice=ValueWhen(Buy, Ref(L,-1))-0.07;

target2= H >= 2 + BuyPrice;
Days3 = BarsSince(Buy) == 2;
stopped = L <= stopprice;

Sell=
 target2
 OR Days3
 OR stopped
;

SellPrice=IIf(target2, 2+BuyPrice, IIf(stopped, stopprice, IIf(Days3, 
C, C)));

Equity(1);

////////////////////////


HB


--- In amibroker@xxxxxxxxxxxxxxx, "stevemajors" <stevemajors@xxxx> 
wrote:
> Has any one written systems to test the "Pristine" trading styles 
> (Core, Swing, Gurrella etc.)?  Just checking if there if someone 
had 
> already coded these styles before I tried to code them.  Any 
comments 
> on there use would be appreciated.
> 
> Thanks


------------------------ 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/l.m7sD/LIdGAA/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/