Multi TF filters: How to reduce the time for each Backtest

Forums ProRealTime English forum ProOrder support Multi TF filters: How to reduce the time for each Backtest

  • This topic has 4 replies, 2 voices, and was last updated 1 year ago by avatarAMQ.
Viewing 5 posts - 1 through 5 (of 5 total)
  • #211796
    AMQ

    Hello everyone, Regarding the multitime frame, I have an automatic strategy that operates in TF 2 min, with filters in daily and weekly TF. Currently carrying out a Backtest takes a long time and we believe that it is due to the daily and weekly checks in TF. Help is requested to see some idea that allows redefining the code and allowing backtests to be carried out in less time. Thank you very much Regards Alfonso

    #211801

    There can be many reasons on why a backtest takes a long time to be made.

    Mutliple timeframes conditions is one of them, but it all depends on the way you have coded the conditions, if it carries loops, arrays, or many indicators declarations, .. and so on.

    How many bars? Are you making optimizations or single backtest only?

     

    #211819
    AMQ

    Thanks a lot, Nicolas.

    You can see the strategy attached. There is a call to an external indicator, that I am not able to attach aswell, so I will start to work by writting it inside the code.

    Thanks for the ideas you can share to improve de code in order to get less time per backtest.

    Alfonso

    #211824

    Well, I see that there are a lot of TIMEFRAME declarations and sometimes for the same timeframe. Why not calculate everything for the same timeframe just below the same TIMEFRAME instruction?

    When you declare variables, and that variables will not get any other values afterwards, use ONCE.

    Try to avoid calculation when not needed (for example, there is a 25 lines of position size calculation on each bar, even if you are at market already)..

    1 user thanked author for this post.
    avatar AMQ
    #212086
    AMQ

    Ok, perfect: I tried ONCE and comment the lines that I dont use for the money management. After all, it seems to get less time to make each backtest. Thanks a lot

    Regarding de timeframe declarations, I have some of them like “Timeframe(1week)” and others like “Timeframe(1week, updateonclose)” so I cannot put all together.

    Is it possible to know what time should be the best one to backtest faster??

    Thanks again.

Viewing 5 posts - 1 through 5 (of 5 total)

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