Sorry, the line MACD_Bars = BarsSince(0,MD); should be
MACD_Bars = BarsSince(Cross(0,MD)); ----- Original Message ----- From: "bilbo0211" <[EMAIL PROTECTED]> To: <amibroker@yahoogroups.com> Sent: Thursday, January 10, 2008 6:45 AM Subject: [amibroker] Re: code help request >I don't think that will work because MD just crossed above zero so > > BarsSince(MD==0); > > will be 1. > > I think you need something like > > bsZeroCross=BarsSince(MD==0); > bsPrevZeroCross=BarsSince(Ref(MD,-bsZeroCross)==0) > LowPrice = LLV(Low,bsZeroCross+bsPrevZeroCross); > > Bill > > --- In amibroker@yahoogroups.com, "Ara Kaloiustian" <[EMAIL PROTECTED]> wrote: >> >> Find out when the negative MACD cycle started: >> >> MD = MACD(...); >> MACD_Bars = BarsSince(0,MD); >> LowPrice = LLV(Low,MACD_Bars); >> ----- Original Message ----- >> From: Higgs Boson >> To: amibroker@yahoogroups.com >> Sent: Wednesday, January 09, 2008 11:43 PM >> Subject: [amibroker] code help request >> >> >> What function(s) should I be looking at for the following pseudo > code? >> >> When MACD crosses positive, buy, and use the lowest price during the >> previous negative MACD swing as a stop. >> >> I'm pretty sure I can write the buy conditioned on the cross with > little >> problem. But at this point I have no idea how to write that stop. >> >> I am not a programmer at all, but I once got a Unix box to output, > "Hello, >> world!" It was probably dumb luck. >> > > > > > Please note that this group is for discussion between users only. > > To get support from AmiBroker please send an e-mail directly to > SUPPORT {at} amibroker.com > > For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG: > http://www.amibroker.com/devlog/ > > For other support material please check also: > http://www.amibroker.com/support.html > > Yahoo! Groups Links > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >