PureBytes Links
Trading Reference Links
|
HI,
OK there is a typpo in my AFL in the earlier mail, it should be OR instead
of AND. BUT the 1st condition still not working. Following is the explore
list. Pay notice to a short was happened on 1/30/03 but only cover on
2/14/03 ???
Thanks
KK
NASCOM 1/2/03 1384.85 1384.85 0.00 1.00 5.00 0.00 1.00
NASCOM 1/17/03 1376.19 1376.19 1.00 0.00 0.00 0.00 0.00
NASCOM 1/23/03 1388.27 1388.27 0.00 1.00 3.00 0.00 1.00
NASCOM 1/24/03 1342.14 1342.14 1.00 0.00 0.00 0.00 0.00
NASCOM 1/29/03 1358.06 1358.06 0.00 1.00 3.00 0.00 1.00
NASCOM 1/30/03 1322.35 1322.35 1.00 0.00 0.00 0.00 0.00
NASCOM 2/14/03 1310.17 1310.17 0.00 1.00 11.00 0.00 1.00
NASCOM 2/19/03 1334.32 1334.32 1.00 0.00 0.00 0.00 0.00
NASCOM 2/21/03 1349.02 1349.02 0.00 1.00 2.00 0.00 1.00
NASCOM 2/24/03 1322.38 1322.38 1.00 0.00 0.00 0.00 0.00
NASCOM 2/28/03 1337.52 1337.52 0.00 1.00 4.00 0.00 1.00
NASCOM 3/3/03 1320.29 1320.29 1.00 0.00 0.00 0.00 0.00
NASCOM 3/13/03 1340.77 1340.77 0.00 1.00 8.00 0.00 1.00
NASCOM 3/31/03 1341.17 1341.17 1.00 0.00 0.00 0.00 0.00
NASCOM 4/2/03 1396.72 1396.72 0.00 1.00 2.00 0.00 1.00
NASCOM 4/9/03 1356.74 1356.74 1.00 0.00 0.00 0.00 0.00
NASCOM 4/15/03 1391.01 1391.01 0.00 1.00 4.00 0.00 1.00
----- Original Message -----
From: "kk2628" <kk2628@xxxxxxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, July 23, 2003 5:45 PM
Subject: Re: [amibroker] Re: Barssince / Help
> Hi DT,
>
> You are right, I just want either one of the condition happened then cover
> to be activated. After checking, I confirm the barssince(short)==7 not
> working as you can see there are covers more than 7 bars. For Nasdaq, you
> can see that a short happened on 1/17/03 but a cover only happen on
3/20/03.
> Could this because the barssince is return array and the type is mismatch
> ???
>
> Thanks
> KK
>
> Following is the AFL code I use.
>
> // For futures use
> MarginDeposit = 5000;
> file://PositionSize = -30;// use 80% of equity
> PositionSize = 1 * 8000;// limit to maximum contracts
> RoundLotSize = 1;
> PointValue = 100;
>
> Short=Open>Close AND Close<EMA(Close,50);
> Cover=BarsSince(Short)==7 AND Close>Ref(High,-1);
> Short=ExRem(Short,Cover);
> Cover=ExRem(Cover,Short);
>
>
> Filter= Short OR Cover;
>
> AddColumn(Close,"close",1.2);
> AddColumn(ShortPrice,"shortprice",1.2);
> AddColumn(Short,"short");
> AddColumn(Cover,"cover");
> AddColumn(BarsSince(Short),"bar");
> AddColumn(BarsSince(Short)==7,"barc");
> AddColumn(Close>Ref(H,-1),"c");
>
> ----- Original Message -----
> From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxxxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Wednesday, July 23, 2003 5:25 PM
> Subject: [amibroker] Re: Barssince / Help
>
>
> > Your condition is just fine.
> > [try Cover=BarsSince(Short)==7 ; to confirm that it works]
> > But, if Close>Ref(High,-1) comes before the 7th bar after Short, it
> > is activated first.
> > For ^NDX there is a [rare] example between 2/2/2001 and 13/2/2001,
> > when Close>Ref(High,-1) did not happened any of the 7 bars and
> > BarsSince(Short)==7 was activated first.
> > You join with OR your Cover conditions, which means you search for
> > ANY true, not for both.
> > Dimitris Tsokakis
> > --- In amibroker@xxxxxxxxxxxxxxx, "kk2628" <kk2628@xxxx> wrote:
> > > HI,
> > >
> > > I intend to cover my short on the 7th bar after my short or if the
> > close today higher than yesterday high. My AFL is as below
> > > short = close<ema(close,50);
> > > Cover=BarsSince(Short)==7 OR Close>Ref(High,-1);
> > >
> > > However, when I check the result, seems only the second condition
> > close>ref(high,-1) will be execute, the first condition barssince not
> > taking effect. Any help is appreciated.
> > >
> > > Thanks
> > > KK
> >
> >
> >
> > 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 Breakthrough Natural Health Specialties at VitaminBoost.com $20 to $40
Naturally Painless Spray, Coral Calcium, No Snore, EZ Appetite Suppressant.
http://www.challengerone.com/t/l.asp?cid=2882
http://us.click.yahoo.com/yoMABA/ruYGAA/ySSFAA/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/
|