Pivot strategy backtest

Forums ProRealTime English forum ProOrder support Pivot strategy backtest

Viewing 3 posts - 1 through 3 (of 3 total)
  • #119133

    Good day,

    I would like to backtest a strategy with pivots but have no idea how to code an instruction that lets me enter on pivot after a break of pivot.

    My strategy :(long scenario)

    When price breaks through the 4H pivot and closes above, enter if price pulls back and touches pivot with stoploss 10  points below pivot, target is R3.

    Can you please help?

    thank you,

    kind regards,

    1 user thanked author for this post.
    #119144

    I tried this on DAX, 4h:

    Lines with unused variables are commented out, but I left them in case you need them in the future.

    I set a LOOKBACK number of bars to 5, you can change it to whatever number you prefer.

    I used the MTF support to make sure pivots are ALWAYS calculated on a 4 hour-TF, but you can run it on any lower TF provided 4H is a multiple of it  (2 hours, 1 hour, 30-20-15-10-5-3-2-1 minute, but not 3 hours). I used 4h TF as default, which means I did not take advantage of the MTF support, which could be useful to trail stop loss.

     

    1 user thanked author for this post.
    #119334

    Here is also some code to save you some time going forward. I also use pivots in most of my strategies.

     

    1 user thanked author for this post.
Viewing 3 posts - 1 through 3 (of 3 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login