Howard, One comment, and somewhat beyond the answer to the original question. I like to convert impulse conditions to state (or your level) prior to and'g via Flip prior to the following. This is not always needed and is sometimes not wanted, but in most cases it is.
The two are combined to create an entry. Buy = AllowLongs AND BuySignal; Stated differently, I convert impulse to state (level) via Flip prior to and'g and convert state (level) via ExRem prior to or'g. Bert --- In [email protected], Howard B <howardba...@...> wrote: > > Hi Ford -- > > Mubashar is correct. > > To expand a little on what he wrote -- > > The expression "C > EMA(C,13)" defines a condition known as a "level". The > level is 1 (or, equivalently, True) for every bar where the Close of that > bar is greater than the 13 period exponential moving average computed using > the closing prices. The level is 0 (or False) for every bar where the Close > is not greater. > > The expression "Cross(C,EMA(C,13)" defines a condition known as an > "impulse". The impulse is 1 on only those bars where the Close was less > than the 13 bar EMA on the previous bar and is greater than the 13 bar EMA > on the current bar. > > Trading system logic can use either levels or impulses. > > A common use of a level is as an overall market filter. For example, > AllowLongs = C>EMA(C,120); > > A common use of an impulse is as an entry or exit trigger. For example, > BuySignal = Cross(C,EMA(C,13)); > > The two are combined to create an entry. > Buy = AllowLongs AND BuySignal; > > AllowLongs will be true for many bars -- all of those bars where you are > willing to take long positions. > BuySignal will be true on only those bars where the closing price crosses up > through the moving average. > The Buy will be on the bars where the crossing takes place, provided > AllowLongs is 1 or True. > > If you plot AllowLongs, you will see the "level" change from 0 to 1 and > maintain that value for many bars. > If you plot BuySignal, you will see the "impulse" on the single bars where > the crossing takes place. > > Thanks, > Howard > > On Sat, Aug 21, 2010 at 12:20 PM, Mubashar Virk <mvir...@...> wrote: > > > > > > > Both lines cover the the latest/or the last cross. > > > > First line buys if/when(ever) Close is greater than 13- bar EMA of the > > Close. > > Second lines buys when close last crossed over the 13-bar EMA of the Close. > > > > > > If you are looking for the last cross only then use second line. > > > > > > > > > > On 8/21/2010 10:34 PM, kin ford7 wrote: > > > > > > > > hi friends > > > > what is difference between buy signals below given > > buy = c> ema(c,13); > > or buy =cross(c,ema(c,13); > > To get latest cross over which is better > > please help > > ford > > > > > > > > >
