Why is my indicator so slow when I use it in a strategy?

Forums ProRealTime English forum ProOrder support Why is my indicator so slow when I use it in a strategy?

Viewing 12 posts - 1 through 12 (of 12 total)
  • #170406

    This is code of indicator that take:

    • StopLossType => Select type of stop loss trailing (integer)
    • LongPosition => True if is on long position (boolean)
    • ShortPosition => True if is on short position (boolean)
    • EnterPrice => Last price of position (decimal)
    • EnterPriceClose => Last close price of position (decimal)
    • TrailingStopLoss => Trailing stop loss pips (integer)
    • StartBreakeven => Breakeven pips (integer)
    • PointsToKeep => Points for breakeven (integer)

     

    I can add to the charts but if I add to my strategy it is so slow.

    My strategy :

    Why?? any suggestion?

    Thanks

    #170429

    If you feel that the backtest is slow, it might be because of backtests servers overloading. Try to backtest at a different time of the day, are you doing optimization?

    #170433

    Thanks Nicolas, In this step I do not do optimization, Like more then one week I tray this indicator and always is slow, but if I put my code from indicator to my strategy is working well, why?

    #170434

    Actually it’s very slow. I tried embedding the indicator in the strategy and it’s fast (Dax, 4h, 200K).

    I am attaching the modified version.

     

    #170436

    I was posting while you were replying. So you already experienced that. Sorry.

     

    #170457

    I can’t really know why it is slow in backtest, try to reduce the quantity of IF/ENDIF? CALL the indicator only when it is needed in the strategy?

    #170471

    It’s incredible, if I put my code from indicator to my strategy is working well, but if commit all code in indicator is very slow yet.

     

     

     

    #170488

    If you call it with constants, instead of variables, it works fine:

    #170496

    Grazie Roberto, but it is not useful, in a lot of situation I need pass to indicator dynamic variable.

    problem is decimal inputs,

    • EnterPrice => Last price of position (decimal)
    • EnterPriceClose => Last close price of position (decimal)

     

    #170504

    Yes, I know variables are necessary.

    It’s just to know what happens in multiple different situations, in case you want to report this issue to PRT.

     

    1 user thanked author for this post.
    #237302

    Dears,
    please, some news about this topic? It’s real important to solve this issue, otherwise it’s not possible to public a lot of strategy on marketplace.

    Thanks a lot.

    #237303

    The issue with using CALL was sorted out a few years ago, when CALLed indicators were automatically appended to the code, so now the only overhead is the CALL itself, not loading the indicator.

    I sometimes experience slow backtesting, as well. It usually lasts one day or a few days, then the regular speed is restored.

    It may be due to overloaded servers because of  too many strategies running at the same time or to demo account while in maintenance mode.

    Try enquiring ProRealTime.

     

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

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