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

Re: backtesting multiple data streams?



PureBytes Links

Trading Reference Links

I don't claim to be an expert on this, but you can test it by inserting a
debug line of code such as:
     print(eldatetostring(date),time, H data3, L data3, C data3);
somewhere in your strategy and opening the debug window to examine the
values produced. Assuming your shortest data period is data1 and your longer
ones are data2 and data3, the close of the 15-day bar in data3 show up the
same on each of the daily bars until it changes on the 15th day.

If your strategy happens to contain a series function (i.e., one that needs
to keep historical back bars for its calculations), according to the Omega
Research EasyLanguage Reference Guide (1st edition, page 57): "if a series
function is not called on a specific bar, it is executed at the end of the
procedure in order to perform the calculations and store all values -- of
the function itself and any variables and/or arrays in the function..." In
other words, even when the code for the 15-day bar only needs to be executed
once every 15 days, if it contains a series function, it will be executed
once for every one of your daily bars.

I'm going crazy trying to do something similar where my "normal" strategy is
based on 15-minute bars, but contains longer-term trend calculations based
on daily bars using the ADXCustom function. Even though I want the ADXCustom
function to execute only once per day on the 4pm bar when the daily high,
low and close are finally known, it apparently recalculates the function
every 15-minute bar. "Forcefeeding" the function 26 times in a row with the
same parameters gives different numerical results than running the same
function on a daily chart where it is calculated only once per day. (Note:
There are 26 15-minute bars in a trading day.)

One other pitfall to avoid that I ran into:   If you have multiple time
frames as data1, data2, etc., be sure and set the number of days for the
longest time frame greater than "maxbars".  If you don't the strategy just
sits there with no error messages, but not doing anything and not generating
trades. You will then get an error message if you try to look at a strategy
performance report since no trades have been generated.

R. Engholm


----- Original Message -----
From: "Mike Eggleston" <mikee@xxxxxxxxxxxxxx>
To: <omega-list@xxxxxxxxxx>
Sent: Thursday, May 09, 2002 9:02 AM
Subject: backtesting multiple data streams?


> Now that I've solved one problem I've run into another.  If I
> have the same symbol plotted in multiple time frames (seen as
> data streams) in the same chart and am back testing a strategy
> (TS6), then does the strategy see only the close of bar from
> each of the data streams? If so, then how can you really back
> test the strategy? How will the strategy differ when done with
> real-time data?
>
> With data streams for 1, 5, and 15 day bars on a symbol and
> I'm watching the chart for position trading during the day,
> will I get my signals or does the strategy only fire at end
> of bar regardless of any data that flows into TS6?
>
> If this chart were an intra-day chart with periods of 1, 5,
> and 15 minute and the strategy were watching the data flow of
> all three data streams, would the strategy only fire when all
> three bars close? Or would the strategy fire when the shortest
> period bar closed?
>
> We just had a talk about this. Try this setup and see if it
> is simple to understand and illustrate what I'm asking. For
> simplicity sake start with a 1 min bar. Then add the same
> symbol again as a 30 min bar and a 90 min bar. Next a strategy
> that is plotted in the 1 min chart that also looks at the 30
> min and 90 min data. As the chart is plotting data I know it
> will see the 1 min data and the strategy will fire on the 1
> min close of bar (right?). Now, in the strategy looking at the
> other data streams, will the strategy see the previous close
> of the 90 min bar or will the strategy see the current close
> price within the 90 min stream?
>
> Since the close of all bars, regardless of their time frame, is
> the current close, then does the strategy see the current close
> or does the strategy only see the previously plotted close?
>
> Mike
>