| 
 PureBytes Links 
Trading Reference Links 
 | 
{-----------------------------------}
....
....
R; {MACD}
Z; {Signal} {end of Roy's stuff}
Hist:=(R-Z); {Histogram}
Hist;
{1}Buy:=ROC(Hist,1,POINTS)>0 AND Hist<0;
{2}Sell:=ROC(Hist,1,POINTS)<0 AND Hist>0;
{3}{If(Buy,1,0);}
{4}If((Buy AND (BarsSince(Buy)>BarsSince(Sell)=1)),1,0);
{5}{If(Sell,-1,0);}
{6}If((Sell AND (BarsSince(Sell)>BarsSince(Buy)=1)),-1,0);
{-----------------------------------}
"Alan Davidson" <alan_davidson22@xxxxxxxxxxx> wrote:
>I'd be grateful for any help with BarsSince() in the following 
>formula fragment.
>
>Regards,
>Alan
>
>
>{-----------------------------------}
>....
>....
>R; {MACD}
>Z; {Signal} {end of Roy's stuff}
>Hist:=(R-Z); {Histogram}
>Hist;
>{1}Buy:=ROC(Hist,1,POINTS)>0 AND Hist<0;
>{2}Sell:=ROC(Hist,1,POINTS)<0 AND Hist>0;
>{3}{If(Buy,1,0);}
>{4}If((Buy AND (BarsSince(Buy)>BarsSince(Sell))),1,0);
>{5}{If(Sell,-1,0);}
>{6}If((Sell AND (BarsSince(Sell)>BarsSince(Buy))),-1,0);
>{-----------------------------------}
>
>Explanation:
>{1} Buy if histogram ticks up from below its centreline.
>{2} Sell if histogram ticks down from above its centre line.
>{3}(Commented out.) Plot the buy trigger .  This worked fine, but as 
>long as the histogram is oscillating below its centre line, it 
>continues to give buy signals on each up-tick.
>{4} This is my attempt. I thought it said: "Buy if histogram ticks up 
>from below its centreline AND the previous buy/sell signal was a 
>sell." In other words, if the previous signal was a buy, don't add to 
>the position.  This doesn't work.  The plot is a horizontal line at 
>Y=0 (the histogram centre line).
>{5} (Commented out.)  Again, this worked fine, but could give 
>multiple contiguous sell signals.
>{6} Similar to {4}.
>
>
>
__________________________________________________________________
Introducing the New Netscape Internet Service. 
Only $9.95 a month -- Sign up today at http://isp.netscape.com/register
Netscape. Just the Net You Need. 
New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
------------------------ 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/mOAaAA/3exGAA/qnsNAA/BefplB/TM
---------------------------------------------------------------------~->
 
Yahoo! Groups Links
<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/equismetastock/
<*> To unsubscribe from this group, send an email to:
     equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/
 
 |