[amibroker] How to sell at +5 or -5

2010-06-10 Thread Prabu
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 whe

Re: [amibroker] How to sell at +5 or -5

2010-06-11 Thread Inquisitive Voyager
Sell=(*Buy*+5) *OR* (*Buy*-5); ps: it is better touse % than points. On Fri, Jun 11, 2010 at 11:58 AM, Prabu 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 be

Re: [amibroker] How to sell at +5 or -5

2010-06-11 Thread Prabu
hi, I tried this.. e1 = EMA(C, 14); e2 = EMA(C, 5); Buy = Cross(e2, e1); Sell = (Buy+5) OR (Buy-5); But it is buying and selling on the same bar.. Prabu On Fri, Jun 11, 2010 at 12:36 PM, Inquisitive Voyager < hedonist2...@gmail.com> wrote: > > > Sell=( > *Buy*+5) *OR* (*Buy*-5);ps: it is b

Re: [amibroker] How to sell at +5 or -5

2010-06-11 Thread Inquisitive Voyager
(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 wrote: > > > hi, > > I tried this.. > > e1 = EMA(C, 14); > e2 = EMA(C,

Re: [amibroker] How to sell at +5 or -5

2010-06-11 Thread Prabu
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 wrote: > > > (1) as 5 is small factor. This happens- > replace it with- > Sell = (Buy*1.1) OR (Bu

Re: [amibroker] How to sell at +5 or -5

2010-06-11 Thread Prabu
I think this is not the right way of sell condition.. Sell = (Buy+6) OR (Buy-5); On Fri, Jun 11, 2010 at 1:28 PM, Prabu 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,

Re: [amibroker] How to sell at +5 or -5

2010-06-11 Thread Inquisitive Voyager
@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* 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

Re: [amibroker] How to sell at +5 or -5

2010-06-11 Thread Prabu
My sincere thanks to voyager & Mike. On Fri, Jun 11, 2010 at 8:22 PM, Inquisitive Voyager 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* > > > @mike: withou

Re: [amibroker] How to sell at +5 or -5

2010-06-16 Thread Abhay Deshpande
Hello, Buy and Sell are boolean variables. Using arithmatic operators / operations on them won't yield correct results. You will need to obtain closing price on buying candle first and then use it in your condition for Sell. Something like this : Buy = \\your buying condition Buy