Voyager,

What I published earlier is logically equivalent to IIF and works fine. In both 
cases, you just need to use a large enough offset to actually see the position 
get held for a few bars.

Prabhu,

An important detail is that in both examples, you should be setting the 
BuyPrice to Close (either in code or in AA Settings), else to Open with trade 
delays set to 1.

As an aside, using a fixed offset like this will often hurt results, since it 
does not take into consideration the natural volatility of the symbol. Might be 
better to use a multiple of ATR if going that route.

Mike

--- In [email protected], Inquisitive Voyager <hedonist2...@...> wrote:
>
> @prabhu: try this.
> 
> 
> e1 = MA(*C*, 14);
> 
> e2 = MA(*C*, 5);
> 
> *Buy* = Cross(e2, e1);
> 
> pb= ValueWhen(Cross(e2, e1),*C*);
> *
> 
> Sell*=IIf(*C*>pb+5,*True*,IIf(*C*<pb-5,*True*,*False*));
> 
> 
> 
> @mike: without IIF sell condition shall always be true.
> 
> BTW,thanks for your input.
> 
> 
> 
> On Fri, Jun 11, 2010 at 1:28 PM, Prabu <prabui...@...> wrote:
> 
> >
> >
> > Still the result is same. (selling on the same bar).
> > I'm trying it with 5 Minute periodicity.
> >
> > I even tried Sell = (Buy+30) OR (Buy-30); no use;
> >
> >
> > On Fri, Jun 11, 2010 at 1:11 PM, Inquisitive Voyager <
> > hedonist2...@...> wrote:
> >
> >>
> >>
> >> (1) as 5 is small factor. This happens-
> >> replace it with-
> >> Sell = (Buy*1.1) OR (Buy*.9);
> >>
> >>
> >> this sells when price is 10 % above or 10% bellow the buy.
> >>
> >>  btw: are  u trying it on eod data?
> >>
> >>
> >>  On Fri, Jun 11, 2010 at 12:55 PM, Prabu <prabui...@...> wrote:
> >>
> >>>
> >>>
> >>>  hi,
> >>>
> >>> I tried this..
> >>>
> >>> e1 = EMA(C, 14);
> >>> e2 = EMA(C, 5);
> >>>
> >>> Buy = Cross(e2, e1);
> >>>
> >>>
> >>>  But it is buying and selling on the same bar..
> >>>
> >>>
> >>> Prabu
> >>>
> >>>
> >>> On Fri, Jun 11, 2010 at 12:36 PM, Inquisitive Voyager <
> >>> hedonist2...@...> wrote:
> >>>
> >>>>
> >>>>
> >>>> Sell=(
> >>>> *Buy*+5) *OR* (*Buy*-5);ps: it is better touse % than points.
> >>>>
> >>>>
> >>>> On Fri, Jun 11, 2010 at 11:58 AM, Prabu <prabui...@...> wrote:
> >>>>
> >>>>>
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>> I'm new to amibroker.
> >>>>> Please help me with this..
> >>>>>
> >>>>> I'm testing it with a simple Ema crossover system. It buy on
> >>>>> ema-crossover and Sell if price goes above or below 5 points from the 
> >>>>> buy
> >>>>> price.
> >>>>>
> >>>>> I'm able to write the Buy condition. But i'm not able to write the sell
> >>>>> condition. I'm confused whether I can write it as Sell condition or 
> >>>>> should i
> >>>>> write it with ApplyStop's .. please help me.
> >>>>>
> >>>>> e1 = EMA(C, 14);
> >>>>> e2 = EMA(C, 5);
> >>>>>
> >>>>> Buy = Cross(e2, e1);
> >>>>> Sell = (.. confused here .. )
> >>>>>
> >>>>> Thanks
> >>>>> Prabu
> >>>>>
> >>>>>
> >>>>
> >>>
> >>
> >  
> >
>


Reply via email to