Australian (ASX) Stock Market Forum

Amibroker - intraday backtesting

Joined
30 June 2007
Posts
7,200
Reactions
1,225
Hi,

I need someone to help me configure AB for intraday backtesting. I'm experienced with EOD backtesting but not sure how to set up time/date etc for intraday.

With EOD, if i want to reference the previous day's close, I can write Ref(c,-1). How do i do that using 1sec tick data?

Thanks!

GB
 
Hi GB --

Your post talks about 1 second tick data. Bars can be composed of a number of ticks, or a number of seconds, but not both.

In order to work with both intraday bars and daily data, you will need to use multiple time frames. See the reference materials for TimeFrameSet, TimeFrameExpand, TimeFrameRestore.

Thanks,
Howard
 
Thanks howard.

I only want to work with 1 second data.

I'm hoping this will work, but haven't got my data set up yet.

Buy = Cross( TimeNum(), 150000) AND Close > 1.05*TimeFrameGetPrice("C", inDaily, -1);
Sell = Cond2 = TimeNum() >= 161500;

I'm aiming to buy intraday at 3pm if the price has risen 5% since the previous day's close , then sell at close.

Will this work?
 
Thanks howard.

I only want to work with 1 second data.

I'm hoping this will work, but haven't got my data set up yet.

Buy = Cross( TimeNum(), 150000) AND Close > 1.05*TimeFrameGetPrice("C", inDaily, -1);
Sell = Cond2 = TimeNum() >= 161500;

I'm aiming to buy intraday at 3pm if the price has risen 5% since the previous day's close , then sell at close.

Will this work?

Hi GB --

One second bars are possible, but that is pretty fast. In order to do that, your databases must have one second or finer bars. Compare with one minute bars which is the granularity many intra-day traders use. Disk storage will be greater and backtesting times will be greater.

The code you suggest has a "cross" statement in it. Each cross statement produces an "impulse" signal on a single bar -- the bar at which the cross takes place. You might want to recode the logic so it uses "levels" (like your test of the change in price of the close) rather than impulses. You are already aware of the need to work with multiple time frames. So your idea can be coded in AmiBroker and traded in real time.

Thanks,
Howard
 
Top