Hi Mark
Please see attached the following 2x sets of SQ strategy + associated MT4 files:
1. 20170617d_Strategy 0.48690_01.str (EURUSD_H1_20170617d_Strategy
0.48690_01.mq4)
2. WF Matrix - 20170617d_Strategy 0.48690_01_20191206 25%
MM.sqx (EURUSD_H1_WFM - 20170617d_Strategy 0.48690_01_20191206 25% MM.mq4)
MT4 backtest setup was identical for both MT4 files:
In essence, the difference between the above 2x MT4 files should
be a difference in WFM optimized parameter values only. Otherwise the strategies
should function the same. However, the SQX v126 generated MT4 code took ~188x
longer to perform the backtest than did the original SQ 3.8.2 generated MT4
code. Otherwise the SQX v126 MT4 code performed a successful backtest.
Please can you investigate what has gone wrong with the SQX generated MT4 code, causing this massive slow-down in MT4 backtest performance, and look into
correcting the problem for next up-issue of SQX.
Thanks
AC1962
Attachment EURUSD_M15_WFM - 20160819d_Strategy 081149_01_20191206 25 MM.mq4 added
Attachment EURUSD_M15_20160819d_Strategy 081149_01.mq4 added
Attachment 20160819d_Strategy 081149_01.str added
Attachment WF Matrix - 20160819d_Strategy 081149_01_20191206 25 MM.sqx added
Following on from my initial bug report: sq4_5833. I have now re-processed a portfolio of 5x existing SQ 3.8.2 strategies using SQX v126 WFM. 3x of which test in MT4 + TDS in good time, but the previous reported strategy, and 1x other, are now taking many days to test in MT4, for what previously took less than 1.5hrs in total to test both:
Please can you urgently investigate and report back why the new SQX v126 generated MT4 code has become so inefficient to test in MT4, compared to original SQ 3.8.2 generated MT4 code? While in essence both strategies should function the same as previous, with only a change in parameter values.
Thanks
AC1962
Attachment SQX 126 - Strategy parameters AC20200218.png added
Thanks for your response. However, I can find no parameter "replace pending order" in SQX v126 generated *.sqx file. Did you mean "replace existing orders"? See screenshot image.
Thanks
AC1962
for example this strategy is for M15 timeframe and have allowed replacing pending orders and order is valid only 2 bars...so every 15 minutes will the pending order be modififed and every 30 minutes will be deleted and if the entry conditions are still true, new pending order will be placed
so if you are doing tick backtest in MT4 (tick data suite) this backtest will last hours, days
Thanks for your message: a helpful tip. However, only the SQ 3.8.2 generated MT4 code includes variable 'ReplacePendingOrders'. The SQX v126 generated MT4 code does not.
The M15 strategy in SQ 3.8.2 generated MT4 code took 74min to run with variable 'ReplacePendingOrders = TRUE', reducing to 37min with variable 'ReplacePendingOrders = FALSE'. Either of these test times are fine with me. Whereas the same strategy in SQX v126 generated MT4 code takes 6 days to progress barely 40% through the MT4 test. At which point I gave up.
This massive slow-down in MT4 backtest performance suggests something else within the SQX v126 generated MT4 code being the cause, not either of the 2x variable values that you have suggested.
Thanks again
AC1962
and its normal behavior, because with every candle the EA need to recompute everything
if this could be done better, who knows...i am not a MQL programmer, but its true, that SQ3 code doenst do this
Status changed from New to Waiting for information
I noticed that in your EA from SQX there is a ModifyInsteadOfReplacing set to false.
Please try to set this parameter to true, I believe the backtest will be much faster.
Let me know if it helped.
Best regards,
Tomas
extern bool ModifyInsteadOfReplacing = false;
Modifying changes only open price, SL and PT. The volume is ignored - it is not a wanted behaviour when using other money management methods than Fixed size.
But if you use the simple fixed size MM, this setting can speed up the backtest in MT4, especially if the strategy produces a lot of trades.
Thanks hankeys!
Hi Tomas
Yes, changing setting ModifyInsteadOfReplacing = TRUE does significantly improve progress in MT4: <1hr in both cases, which is excellent. Thanks!
However, from what I can see, ModifyInsteadOfReplacing = FALSE is default set by SQX (as hankeys has mentioned), not user set by me. While I appreciate that changing this setting vastly improves the MT4 test time, does not changing this setting also change the strategy that SQX generated and thereby possibly negate all the effort involved in filtering, robustness testing & WFM testing that I have already undertaken in SQX, prior to even starting any final MT4 testing?
If, to resolve this issue in future, I need to modify ModifyInsteadOfReplacing = TRUE at MT4 stage, then I request that SQX should either: use ModifyInsteadOfReplacing = TRUE by default, not FALSE; or allow the user, possibly in Builder \ Trading Options, to set ModifyInsteadOfReplacing = TRUE prior to Building any strategies.
Thanks
AC1962
Status changed from Waiting for information to Fixed
It is completely fine to use this feature if you use fixed size money management, the results should be exactly the same. The problem is when using other types of MM, because the modification doesn't support changing pending order's size.
If you set ModifyInsteadOfReplacing = true and used for example Risk Fixed % Of Account MM and the strategy tested had a variable SL (not fixed pips), the trade volumes would be probably different from backtest with ModifyInsteadOfReplacing = false.
Because of this I think it would be better to leave this param set to false by default. The experienced users can simply toggle it to true manually if they want to.
Best regards,
Tomas
Thanks for you explanation. However, given the problems I have experienced with this feature in SQX (never with SQ 3.8.2) during MT4 backtesting, I request you consider giving the user the option to select ModifyInsteadOfReplacing = 'True' or 'False' at Builder setting stage, not fix the value as 'False' only. This way I can choose to avoid Builder generating any strategies that are likely to result in such impractically long MT4 backtest durations.
Thanks
AC1962
thank you for your suggestion, but I think this setting would unnecessarily complicate the UI.
I will set this parameter to true by default and add a condition to the MQL template not to ModifyInsteadOfReplacing in case the volume of the new order is different.
Best regards,
Tomas