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

[amibroker] Looking for help with ApplyStop()



PureBytes Links

Trading Reference Links

Hello,

I've been trying to apply a stop to my backtest formula, but I can't
see how it can be done. From what I can see, this function defines its
stop as a percentage or point change from the previous bar. I would
like to specify an absolute stop loss, which is how I do it in real
trading.  

For example, I would like to set a stop just below the minimum of the
previous two bars.So my trade criteria would be something like:

Buy = O > Ref(H,-1) AND
      Ref(C,-1) > 1.0 AND Ref(C,-1) < 10.0 AND  
      Ref(V,-1) > 400000 AND
      BarNum > MinBarNum AND
Sell = HistInd < Ref(HistInd ,-1);
ApplyStop( stopTypeLoss, stopModePoint, Ref(LLV(L,2),-1), 1, True, 1 );

Is it possible to do this? The ApplyStop() above doesn't work.

A second question. In the buy formula above, it it possible to specify
a buy limit, so that gap ups aren't immediately triggered at the open?

Many thanks,
Paul


Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.7/618 - Release Date: 1/6/2007 7:47 PM