Announcement

Collapse
No announcement yet.

Back testing Renko and Parabolic sar

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

  • Back testing Renko and Parabolic sar

    Anyone know how I would back test using Renko with Parabolic SAR on a 10 min chart going back 2 months...all help appreciated.

  • #2
    Hello leewright,

    Creating a back testing formula for a Renko chart is done in much the same way as a bar or candlestick chart. The main thing that you need to be aware of in back testing on Renko is that a formula will be evaluated on every Renko bar. This does not happen in real time depending on the box size and symbol. There can be multiple Renko bars that get inserted in the chart at the same time when the interval closes. Renko bars are not built one bar at a time as they develop. To create realistic back test results in the Strategy Analyzer you will need to detect the historical instances where the new bar or bars arrive. This can be done by looking at the rawtime() of the current bar being evaluated and the next bar's rawtime. When these two values are different, evaluate your back testing conditions on the current bar. Make note that this logic can only work for a back testing formula since we now what the next (future) bar's rawtime value is.

    PHP Code:
    function main() {

        if (
    rawtime(0) != rawtime(1)) {
            
    // your back testing conditions here
        
    }
        
        ....
        
        return;

    When you need to start using your strategy in real time you will no longer look at the rawtime values. You will then look for BARSTATE_NEWBAR using getBarState() and then evaluate your conditions on the current bar.

    PHP Code:
    function main() {

        if (
    getBarState() == BARSTATE_NEWBAR) {
            
    // your back testing conditions here
            // evaluate them on current bar
        
    }
        
        ....
        
        return;

    Jason K.
    Project Manager
    eSignal - an Interactive Data company

    EFS KnowledgeBase
    JavaScript for EFS Video Series
    EFS Beginner Tutorial Series
    EFS Glossary
    Custom EFS Development Policy

    New User Orientation

    Comment


    • #3
      Renko parabolicSAR backtesting thoughts

      ParabolicSAR works great for me on Renko charts for trailing stops.
      I looked at posting my AdjStop code but it was larger than I cared to cleanup and describe all the variables.
      JasonK has some great backtesting samples in his fileshare area. In his Main folder is adxdm4b2.efs which is what I started with long ago Thanks Jason.

      FWIW :
      I like Renko because it smooths out most of my indicators.
      I tried taking partial profits, but with pSAR my results are better either all In or Out on a trade.
      I used a spreadsheet to record good/bad (SAR values/ Renko box size/ time interval) combinations and made lots of comments.
      Entry is based on several indicators being in an "acceptable range", because I never could find that 1 magical crossover.
      Backtesting and adding code is like an endurance contest, don't expect to finish the first week or month.
      Be Aware that your chart indicators will drift on your real tiime Renko charts. You must reload to see the chart correctly. This is not a problem if you are only backtesting.

      hope this helps

      Comment

      Working...
      X