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

[amibroker] Re: Barssince / Help



PureBytes Links

Trading Reference Links

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


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Free shipping on all inkjet cartridge & refill kit orders to US & Canada. Low prices up to 80% off. We have your brand: HP, Epson, Lexmark & more.
http://www.c1tracking.com/l.asp?cid=5510
http://us.click.yahoo.com/GHXcIA/n.WGAA/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/