[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Backtesting Question confirmation



PureBytes Links

Trading Reference Links

Tomacz,

assume that
buystop=ref(close,-1)*1.02;
buy= H>(buystop*1.02);
buy= hold(buy==0,2) and buy; /* to have a peak*/


for the buyprice in new release 3.80
the right code is ??
1/buyprice=IIf(buy,IIf(O>= buystop ,O,
IIf(H> buystop , buystop ,0)),0); 
OR
2/buyprice=IIf(buy,IIf(O>= buystop ,O,
IIf(H> buystop , buystop ,0)),CLOSE); 

stephane

> it is a very interesting question
> buystop=ref(close,-1)*0.02;
> buy= H>(buystop*0.02);
> buy= hold(buy==0,2) and buy; /* to have a peak*/
> 
> but what is the buyprice if there is a gap at open?
> buyprice=IIf(buy,IIf(O>= buystop ,O,
> IIf(H> buystop , buystop ,0)),0); 
> 
> stephane
> 
> > 
> > How can you code AmiBroker to buy tomorrow on a stop at today's 
> close plus
> > some small amount (a couple of cents or .02 units of Average True 
> Range
> > above the previous close)?
> > 
> > Thanks in advance,
> > Peter Gialames