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

[amibroker] Re: Barssince / Help



PureBytes Links

Trading Reference Links

Let us make some things more clear.
barssince(short)==7 works fine. 
It does not give what you ask, but, this is another story.
After 1/17/03 you have repetitive short signals in less than 7 bars 
and the 
barssince(short)==7 
can not be activated, as long as it counts from the last visible 
short [as expected...]
If you donīt mind, write your conditions properly to get what you are 
looking for
Short=Open>Close AND Close<EMA(Close,50);
Cover=BarsSince(Short)==7 AND Close>Ref(High,-1);
Short=ExRemSpan(Short,7);
Cover=Ref(Short,-7);
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "kk2628" <kk2628@xxxx> wrote:
> 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@xxxx>
> 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@xxxx
> > Send SUGGESTIONS to suggest@xxxx
> > -----------------------------------------
> > 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 Ink Cartridges & Refill Kits for Your Epson at Myinks.com
Free shipping on orders $50 or more to the US and Canada.
http://www.c1tracking.com/l.asp?cid=5705&lp=home/epson.asp
http://us.click.yahoo.com/brYXfA/_xWGAA/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/