Announcement

Collapse
No announcement yet.

Backtesting Divergences

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

  • Backtesting Divergences

    I use 1 indicator and wait for a divergence to price. Then i have a simplistic structured exit strategy. How hard would it be to backtest a strategy involving divergences? i want this set up so I can play with the exit strategy to maximize it. I have been told by a few coders not to bother because backtesting a divergence is impossible to get accurate.

    BTW my indicator is a 1 line indicator so i am looking for it to make a higher low and price makes a lower low to get long or a lower high as price makes a higher high to get short.

    Thanks in advance for your insight.

  • #2
    divergences are hard to code because it is hard to properly define the timespan of a divergence without lwriting lines of code that winds up conflicting with each other.

    Eg: in your model does a higher low versus a lower low mean with respect to the previous bar, 2 bars ago, 3 bars ago, 5 bars ago or anything in between? Trying to code that scenario is a nightmare. If it is defined time frame, as in high/low versus a defined time in the period (1 bar or 3 bars) then:

    low() > low(-3)

    should work fine.

    Best practice is to set up various combinations and backtest to determine best results.

    Hope this helps.

    Comment

    Working...
    X