Download MetaTrader 5

Wrapper for slow indicator for backtesting

To add comments, please log in or register
jackee1234
197
jackee1234  
If a technical indicator works very slow, and I wish to include it in an EA (using iCustom), is there a some "wrapper" that could cache the indicator results to a file based on the particular indicator inputs? This way I could get a better speed next time when I backtest it using the same set of parameters, since the "wrapper" could read the result from file rather than recalculate the result from the indicator.
whroeder1
17047
whroeder1  
jackee1234: If a technical indicator works very slow, and I wish to include it in an EA (using iCustom), is
  1. Writing to a file will be much slower!
  2. If it's slow, fix it. It's probably computing all bars per tick. See How to do your lookbacks correctly.
  3. Don't do per tick what you can do per bar or once you reach a trigger level.
  4. You should write a self documenting function instead of calling iCustom directly, see Detailed explanation of iCustom - MQL4 forum
  5. There are no mind readers here. No code we can only guess.
Alain Verleyen
Moderator
35038
Alain Verleyen  
jackee1234:
If a technical indicator works very slow, and I wish to include it in an EA (using iCustom), is there a some "wrapper" that could cache the indicator results to a file based on the particular indicator inputs? This way I could get a better speed next time when I backtest it using the same set of parameters, since the "wrapper" could read the result from file rather than recalculate the result from the indicator.

First thing to do is to be sure your indicator code is optimized.

If yes and still slow, it may happens, you will have to write your "wrapper" or data cache yourself.

To add comments, please log in or register