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

Re: Backtesting Question



PureBytes Links

Trading Reference Links

Peter,

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