Announcement

Collapse
No announcement yet.

2 interval backtesting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 2 interval backtesting

    hi, everyone,

    I'm backtesting a program that runs in 2 different intervals

    for example: it first check for a condition to appear on the
    3min interval and then looks for a condition on the 1 min
    interval to give me the signal.

    which one should I choose on the backtesting window?

    thanks a lot

    great day,

    Jaime

  • #2
    Re: 2 interval backtesting

    Originally posted by jaimeog
    hi, everyone,

    I'm backtesting a program that runs in 2 different intervals

    for example: it first check for a condition to appear on the
    3min interval and then looks for a condition on the 1 min
    interval to give me the signal.

    which one should I choose on the backtesting window?

    thanks a lot

    great day,

    Jaime
    Jamie,

    The results of the backtest "should" be the same regardless of whether you specify 1 or 3 in the backtesting input window. The calculations are made independent of whatever interval is specified for a given chart. It can actually be different from either 1 or 3 minutes.

    I routinely set the chart interval to the smallest time period, 1minute in this case. If like me you are usually trading off the 1 minute and like to check the 3minute for confirmation then it seems to make logical sense to use the 1 minute time period.

    One important consideration, and the reason I said "should" in my first sentence is the when backtesting a multiple interval strategy to get accurate results you must replace the normal checking for a newbar condition the default time period is based on the currently loaded charts time interval ( 1minute in your case) with the getBarState() function.

    Normally unless you want your strategy to run on every tick, you would code getCurrentBarState() which would cause you strategy to only get control upon completion of a 1 minute bar
    via this statement:

    PHP Code:

    if (getBarState() == BARSTATE_NEWBAR{

       
    look for trading conditions.....bulk of codeetc

    however in you case you have to use the following statement in your strategy which is loaded into the 1 minute chart:

    PHP Code:

    if (getBarStateInterval("3") == BARSTATE_NEWBAR{

      
    look for trading conditions,bulk ofcodeetc.

    One other very helpful suggestion that Jason gave me (yesterday) that I didn't realize is that the Formula-EFS2 Custom folder contains almost every indicator in a Editable format that allows multiple time interval specification. So whatever indicator you are backtesting, instead of coding up all these non-study multiple indicators I was doing, to monitor the other time intervals indicators, they are already there. So, you can easily see the other intervals (3 minute in your case) indicator values when developing your system

    Good Luck with your system, and let me know if running multiple intervals make your system more profitable. As I have been also trying to convert some of my strategies over to multiple timeperiod for sometime and would be interested in your experience.

    Glen
    Glen Demarco
    [email protected]

    Comment

    Working...
    X