PureBytes Links
Trading Reference Links
|
Thanks a lot, Anthony. That makes sense. My version was testing whether
today's high exceeds the highest high over the last HH days starting with
today's high, which would never happen. Your version tests whether today's high
exceeds the highest high over the last HH days starting the lookback
yesterday. It works now. I knew it would be something simple. Thanks
again.
AV
<BLOCKQUOTE
>
----- Original Message -----
<DIV
>From:
Anthony Faragasso
To: <A title=amibroker@xxxxxxxxxx
href="">amibroker@xxxxxxxxxxxxxxx
Sent: Saturday, November 02, 2002 9:21
PM
Subject: Re: [amibroker] Coding a
breakout system
Al,I believe it has something to do with
these
items:UpBreak=HHV(H,HH);BuyCond=Cross(H,UpBreak);change to
this: Buycond=Cross(H, ref(UpBreak,-1);and
this:DnBreak=LLV(L,LL);SellCond=Cross(DnBreak,L);change
to: Sellcond=Cross(ref(DnBreak,-1),L);After I made these changes to
your formula , it backtested.AnthonyAl Venosa
wrote:> Hi, All:>> Crack programmer I am not. I
am trying to code a simple breakout> system, but when I try to invoke
it in AA, I get no trades at all.> Obviously, something's wrong, but I
can't figure it out. The code I> wrote is given below. I want to buy
when the high exceeds the> highest high over the last HH periods and
then sell (exit) when the> low declines below the lowest low over the
last LL periods. I also> want to set a hard stop at 2*ATR(15) below my
entryprice, which> should remain fixed throughout the trade. Can
someone look over the> code below and tell me what is wrong? I'd really
appreciate it. It's> probably something very simple and
stupid.>> HH=Optimize("HH",20,20,60,4);>
LL=Optimize("LL",10,10,40,4);> pds=15;>
UpBreak=HHV(H,HH);> BuyCond=Cross(H,UpBreak);>
Buy=Ref(BuyCond,-1);> BuyPrice=Open;>
FixedBuyPrice=ValueWhen(Buy,Open);> Capital = 100000;>
Risk=0.01*Capital;>
PositionSize=Risk/(2*ATR(pds))*FixedBuyPrice;>
DnBreak=LLV(L,LL);> ApplyStop(0,2,2*ATR(pds),1);>
SellCond=Cross(DnBreak,L);> Sell=Ref(SellCond,-1);>
SellPrice=Open;> Short=0;Cover=0;> Buy=ExRem(Buy,Sell);>
Sell=ExRem(Sell,Buy);>> Thanks a lot, folks.>> Al
V.>>>
Yahoo! Groups
Sponsor
ADVERTISEMENT>> Post AmiQuote-related messages ONLYto:
amiquote@xxxxxxxxxxxxxxx> (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)>>
Check group FAQ at:> <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html>>
Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service.Post
AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx (Web page: <A
href="">http://groups.yahoo.com/group/amiquote/messages/)Check
group FAQ at: <A
href="">http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Your use of Yahoo! Groups is subject to the <A
href="">Yahoo! Terms of Service.
|