I’m looking for some advice re getting scans (and alerts) to run faster.
I’m running a scan across the 28 major forex pairs. I’m looking for either positive or negative MACD (12,26, 9) divergence. The script I’m using for this (taking from another post in this forum) is below
//Is stock price lower than at previous Momentum peak?
Sig2 = V2 < V2;
//Show when both conditions are true
Sig1 and Sig2
I also have a negative divergence script similar to above.
When I run a scan on a daily timeframe (across the 28 pairs) the scan takes approx 1 to 2 seconds to complete.
When I run the same scan on a 60m timeframe, it around 1.5 minutes
When I run the same scan on a 15m timeframe, it takes around 5 minutes.
Ideally I would like to run the scan on 15m and/or 5m charts.
Initially I thought that by changing the “Date Range” option, that this might reduce the number of bars used when calculating the scan results. (ie if the calculations are run on 100 bars it would take much less time than if they were being run over 2000 bars). However changing the date range value makes no discernible difference to the scan time. (I’ve tried everything from ‘last bar’ through to ‘last 5 years’)
Because the daily scan is so quick, I don’t think it’s the script itself that is causing the scan to take so long. But i’m guessing that intraday scans are somehow using too much data (for my requirements), and I would like to reduce this amount of data, to hopefully speed up the scans to a more usable time.
Is this possible? Would appreciate any advice or help.
The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.