There are a number of ways to do selling after 5 bars Use the exremspan Use applystop - nbar type and define sell==0; Define the buy like this, a quick off the top example Sig = WhateverConditions; Buy = Sig and Sum(Sig,5)==1;
Even the actual Sell can be written differently Sell = ref(Buy,-5); Sell = barssince(buy)==5; There are no set rules on how to define things as each system can require a different approach depending on what else is to be included or used. -- Cheers Graham AB-Write >< Professional AFL Writing Service Yes, I write AFL code to your requirements http://www.aflwriting.com On 29/05/07, Homar Simpson <[EMAIL PROTECTED]> wrote: > Tomasz , you should have suggested this to me 25 years ago, since I've > been programming that long (maybe longer, but I stopped counting) . > I've programmed professionally , including database applications, for > almost that long as well. > > > I do notice that some users take it personally if the AB > presentation is criticized. This is a bad sign, and prevents > improvements from taking place. Offering me my money back is not a > good reply. lol. > > > I have done battle (and won) with many peculiar languages, > including Tradestation. I am not a newbie. But I do feel this AFL is > unnecessarily obtuse. In the version of HELP that I am using there > is no cross reference to ExRemSpan under BarsSince, which would have > pointed me to the solution to my problem. A language like this MUST > have as many cross references , examples, and CLEAR explanations as > possible. > > > You may not like my tone, but take it as a compliment, if I didn't > think AB was a useful product I wouldn't even bother, > > > --- In [email protected], "Tomasz Janeczko" <[EMAIL PROTECTED]> wrote: > > > > Homar, > > > > Shortly, I strongly suggest to exclusively use AFL Code wizard > > http://www.amibroker.com/devlog/2007/05/18/introducing-afl-code-wizard/ > > > > it is completely user-interface driven formula builder that requires > zero programming knowledge. > > > > Coding is not for everyone, the same as writing poems is not for > everyone. > > It does not matter how many books you read and how good are those books. > > Without certain natural skill you won't be a poet. > > > > And just smile, you don't need to be a poet to be good trader. Happy > Trading to you. > > > > Best regards, > > Tomasz Janeczko > > amibroker.com > > ----- Original Message ----- > > From: "Homar Simpson" <[EMAIL PROTECTED]> > > To: <[email protected]> > > Sent: Monday, May 28, 2007 5:29 AM > > Subject: [amibroker] Re: once again, this AFL fights you every step > of the way. Sorry, this is a badl > > > > > > > Maybe the poorly worded documentation, spotty examples, and lousy > > > debugging and error messages have something to do with it, I pity non > > > programmers, they have no shot at all. > > > > > > Sorry, but either I'm suffering from early alzheimers or this product > > > needs work. > > > > > > Makes microsoft docs read like Shakespear. > > > > > > Just trying to figure out WHAT is an array, what isnt, whats looped > > > ,and what isnt is more work than this is worth, By the time I got it > > > all straight, I'd have no strength to develop a system > > > > > > I'm sure MANY have given up on AB for these reasons. > > > > > > --- In [email protected], "dingo" <dingo@> wrote: > > >> > > >> No, I'm not - its just usually the first thing you point out to > > > everyone to > > >> prove it can't be your fault you're having trouble. > > >> > > >> I've been in the computer biz since 1964 and I initially struggled > > > with the > > >> array concept but I got over the mental hurdle just and you must. > > > Then and > > >> only then will you be able to get comfortable with AFL. You need to > > > digest > > >> the help material and spend some time on it. You're not going to get > > > it by > > >> osmosis. > > >> > > >> d > > >> > > >> > -----Original Message----- > > >> > From: [email protected] > > >> > [mailto:[EMAIL PROTECTED] On Behalf Of Homar Simpson > > >> > Sent: Sunday, May 27, 2007 10:27 PM > > >> > To: [email protected] > > >> > Subject: [amibroker] Re: once again, this AFL fights you > > >> > every step of the way. Sorry, this is a badl > > >> > > > >> > Why are you taking a survey? > > >> > > > >> > --- In [email protected], "dingo" <dingo@> wrote: > > >> > > > > >> > > You forgot to tell us how many years you've been dealing with > > >> > computers... > > >> > > > > >> > > d
