--- In [email protected], "Paolo Cavatore" <[EMAIL PROTECTED]> wrote: > > Has anyone of you ever come across the problem of properly backtesting > stop-loss orders at intraday level in order to get the correct High-Low > sequence within daily bars? > > > > This is a key point when you want to run reliable backtests on daily data > with a take-profit level and a stop-loss order. You must know which of the > two exit orders is hit first and you need intraday data for that. > > > > I'm referring to features like Look-inside-bar or PrecisionTick in other > softwares in order to let built-in stops working at lower timeframes and get > the correct exit level. > > > > Unfortunately with AB if two or more different stops are triggered on the > very same bar then they are evaluated in this fixed order > > (see http://www.amibroker.com/guide/afl/afl_view.php?id=20): > > > > Fixed Ruin stop (loosing 99.96% of the starting capital) > > Max. loss stop > > Profit target stop > > Trailing stop > > N-bar stop > > >
Ciao Paolo, not sure to understand exactly your need, because to use the "look inside the bar" feature of Tradestation you already need an intraday database as a starting point to build daily bars (unless you are thinking about the basic assumption checking if one is dealing with an OHLC or a OLHC bar(*): just in this case one could only use daily bars). Anyway, as far as I know, the order of stops you referred is used only by APPLYSTOP. Maybe you can try to code stops with looping to check if it suits your needs (there's somewhere in the tutorial the AFL code for applying the profit target whitin a loop; maybe it is a good starting point ). (*)"Assumption 1: The order in which prices on a bar are reached relates to the proximity of the open to the low and to the high"
