How are you trying to shift the blame onto the Strategy Tester when it is the indicator that is improperly coded?
If you don't have the code for the indicator, then contact the author to have it fixed.
And if that is not possible, then rewrite a new indicator to match the functionality of the "closed source" indicator.
I'd be greatful if you share the reference to a "properly coded" indicator. by your definition all the example indicators in the codebase are improper code. I don't enjoy blaming, this is could be easily considered a user feedback to an edge case scenario where the design allows inconsistencies, no matter how good or crap is the user code.
Make sure you use exactly the same tester settings during 2 different passes.
If you use a precompiled indicator which does not handle every tick in non-visual mode - this is the most possible reason of descrepancies - just change the signals to something else (from codebase, for example, where you have full control over the source code) and check if results from visual/non-visual tests are the same - this would mean that your work indicator is buggy.
Also include debug printouts for the signals where EA performs trades - every value from the price, volume, indicators, _LastError flag (and many others possibly related to your strategy - nobody knows it except you) is important. Then compare the logs for 2 passes and find out why you get different trades.
hematinik #: I'd be greatful if you share the reference to a "properly coded" indicator. by your definition all the example indicators in the codebase are improper code. I don't enjoy blaming, this is could be easily considered a user feedback to an edge case scenario where the design allows inconsistencies, no matter how good or crap is the user code.
The "tester_everytick_calculate" issue, usually only affects the Indicator calculations of the current bar, where the close price (and consequently the high/low too) is constantly changing with every new tick.
It does not usually affect the calculations of past bars (unless it is repainting), nor is it an issue if the indicator is only dependant on the open price.
So, if you want to avoid the issue completely, make sure your strategy is only dependant on "closed bars" and never on the current bar which is incomplete and still changing.
If however, your strategy already does this, then there is probably a logic bug in your EA that is dependant in some way on the Indicators calculated buffer data for the current bar, instead of only previously closed bars.
EDIT: Edited the post to make it more clear in respect to the current bar data.
If however, your strategy already does this, then there is probably a logic bug in your EA that is dependant in some way on the current bar data, instead of only previously closed bars.
This can not be a matter of the bug - EAs are trading by all ticks (generated by the tester according to its current generation algorithm) both in visual and non-visual modes.
@Stanislav Korotky#:This can not be a matter of the bug - EAs are trading by all ticks (generated by the tester according to its current generation algorithm) both in visual and non-visual modes.
I am referring to the current bar data that the indicator calculations are generating (in respect to the absence of "tester_everytick_calculate" property). I will update my post to make it more clear.
hematinik #: I'd be greatful if you share the reference to a "properly coded" indicator. by your definition all the example indicators in the codebase are improper code. I don't enjoy blaming, this is could be easily considered a user feedback to an edge case scenario where the design allows inconsistencies, no matter how good or crap is the user code.
no one that I know offline would argue with you on that. however, to allow any ea or indicator to work in strategy tester, you often have to add more or different code. The code on codebase are mostly crap, but mostly because mql4/5 is constantly evolving, just like all other code types. and stop argueing with the experts.
And blaming? no one here can be blamed. They are all normal users of mt4/5 like yourself. If you had read some of the threads on this forum, you would know that 9 out of 10 users on this forum, including the moderators -- have nothing to do with mq and are NOT linked to the devs of mt4/5 in any way, whatsoever.
And, how can you know what is in the code if you do not have the source code? That is impossible.
no one that I know offline would argue with you on that. however, to allow any ea or indicator to work in strategy tester, you often have to add more or different code. The code on codebase are mostly crap, but mostly because mql4/5 is constantly evolving, just like all other code types. and stop argueing with the experts.
And blaming? no one here can be blamed. They are all normal users of mt4/5 like yourself. If you had read some of the threads on this forum, you would know that 9 out of 10 users on this forum, including the moderators -- have nothing to do with mq and are NOT linked to the devs of mt4/5 in any way, whatsoever.
And, how can you know what is in the code if you do not have the source code? That is impossible.
I truely respect and appreciate all comments and replies, Im here to learn from the experts not to argue. I was trying to abstract the problem because the actual one got solved after the generous guidance from @Manuel Alejandro Cercos Perez
Imagine a scenario in which:
1- you have got an indicator that works fine with your EA inside the visual tester and live chart
2- you do not have access to the source code or author to ask for including tester_everytick_calculate
3- you don't want to re-write, replace or change your life philosophy to erase the whole problem
4- you did the best you could inside EA like reading buffers from past bars, eavluating conditions on bar open, and both environments (visual/non-visual) are configured using the same settings
5- backtest modeling method is set to every-tick with zero latency
6- both environment use the same dataset
7- you name it!
now you expect that platform handles the rest consistently.
Imagine a world based on absolute uncertainty and us humans neglect to see what is foreseeable!
i am afraid the only achievable goal on your list is at number 3! But good luck to you on doing that, even!
Even the moderators themselves often comment on old codes and functions that are used on a daily basis; breaking or resulting in bugs or errors -- after a recent update.
And strategy tester and the trading terminal has NEVER matched up, especially in terms of ea results. The only (seemingly) consensus, is that strategy tester and backtests are for proving that code is working as planned. And NOT for predicting or showing profit results of an ea. And yet -- MQ continues to allow bot sellers to use images of bts in their marketing images.
MQ only cares that the brokers keep paying them licence fees; and cares nothing about the traders and end user.
Also include debug printouts for the signals where EA performs trades - every value from the price, volume, indicators, _LastError flag (and many others possibly related to your strategy - nobody knows it except you) is important. Then compare the logs for 2 passes and find out why you get different trades.
?
If you want to at least find out what's the reason of the problem, do this simple step first. Only then you can write down the list of a scenario.
If you want to at least find out what's the reason of the problem, do this simple step first. Only then you can write down the list of a scenario.
Yes of course, that's the first thing I always do. complete logging is the first thing I always do. as you correctly pointed out it was the indicator readings but I couldn't figure out Why that thing keeps happening only inside non-visual tester. that was the very core of my question
How are you trying to shift the blame onto the Strategy Tester when it is the indicator that is improperly coded?
If you don't have the code for the indicator, then contact the author to have it fixed.
And if that is not possible, then rewrite a new indicator to match the functionality of the "closed source" indicator.
Make sure you use exactly the same tester settings during 2 different passes.
If you use a precompiled indicator which does not handle every tick in non-visual mode - this is the most possible reason of descrepancies - just change the signals to something else (from codebase, for example, where you have full control over the source code) and check if results from visual/non-visual tests are the same - this would mean that your work indicator is buggy.
Also include debug printouts for the signals where EA performs trades - every value from the price, volume, indicators, _LastError flag (and many others possibly related to your strategy - nobody knows it except you) is important. Then compare the logs for 2 passes and find out why you get different trades.
The "tester_everytick_calculate" issue, usually only affects the Indicator calculations of the current bar, where the close price (and consequently the high/low too) is constantly changing with every new tick.
It does not usually affect the calculations of past bars (unless it is repainting), nor is it an issue if the indicator is only dependant on the open price.
So, if you want to avoid the issue completely, make sure your strategy is only dependant on "closed bars" and never on the current bar which is incomplete and still changing.
If however, your strategy already does this, then there is probably a logic bug in your EA that is dependant in some way on the Indicators calculated buffer data for the current bar, instead of only previously closed bars.
EDIT: Edited the post to make it more clear in respect to the current bar data.If however, your strategy already does this, then there is probably a logic bug in your EA that is dependant in some way on the current bar data, instead of only previously closed bars.
This can not be a matter of the bug - EAs are trading by all ticks (generated by the tester according to its current generation algorithm) both in visual and non-visual modes.
I'd be greatful if you share the reference to a "properly coded" indicator. by your definition all the example indicators in the codebase are improper code. I don't enjoy blaming, this is could be easily considered a user feedback to an edge case scenario where the design allows inconsistencies, no matter how good or crap is the user code.
no one that I know offline would argue with you on that. however, to allow any ea or indicator to work in strategy tester, you often have to add more or different code. The code on codebase are mostly crap, but mostly because mql4/5 is constantly evolving, just like all other code types. and stop argueing with the experts.
And blaming? no one here can be blamed. They are all normal users of mt4/5 like yourself. If you had read some of the threads on this forum, you would know that 9 out of 10 users on this forum, including the moderators -- have nothing to do with mq and are NOT linked to the devs of mt4/5 in any way, whatsoever.
And, how can you know what is in the code if you do not have the source code? That is impossible.
no one that I know offline would argue with you on that. however, to allow any ea or indicator to work in strategy tester, you often have to add more or different code. The code on codebase are mostly crap, but mostly because mql4/5 is constantly evolving, just like all other code types. and stop argueing with the experts.
And blaming? no one here can be blamed. They are all normal users of mt4/5 like yourself. If you had read some of the threads on this forum, you would know that 9 out of 10 users on this forum, including the moderators -- have nothing to do with mq and are NOT linked to the devs of mt4/5 in any way, whatsoever.
And, how can you know what is in the code if you do not have the source code? That is impossible.
I truely respect and appreciate all comments and replies, Im here to learn from the experts not to argue. I was trying to abstract the problem because the actual one got solved after the generous guidance from @Manuel Alejandro Cercos Perez
Imagine a scenario in which:
1- you have got an indicator that works fine with your EA inside the visual tester and live chart
2- you do not have access to the source code or author to ask for including tester_everytick_calculate
3- you don't want to re-write, replace or change your life philosophy to erase the whole problem
4- you did the best you could inside EA like reading buffers from past bars, eavluating conditions on bar open, and both environments (visual/non-visual) are configured using the same settings
5- backtest modeling method is set to every-tick with zero latency
6- both environment use the same dataset
7- you name it!
now you expect that platform handles the rest consistently.
Imagine a world based on absolute uncertainty and us humans neglect to see what is foreseeable!
i am afraid the only achievable goal on your list is at number 3! But good luck to you on doing that, even!
Even the moderators themselves often comment on old codes and functions that are used on a daily basis; breaking or resulting in bugs or errors -- after a recent update.
And strategy tester and the trading terminal has NEVER matched up, especially in terms of ea results. The only (seemingly) consensus, is that strategy tester and backtests are for proving that code is working as planned. And NOT for predicting or showing profit results of an ea. And yet -- MQ continues to allow bot sellers to use images of bts in their marketing images.
MQ only cares that the brokers keep paying them licence fees; and cares nothing about the traders and end user.
Did you read this:
Forum on trading, automated trading systems and testing trading strategies
MetaTrader you had one job - inconsistencies when backtesting (visual vs. non visual)
Stanislav Korotky, 2025.02.04 14:36
...
Also include debug printouts for the signals where EA performs trades - every value from the price, volume, indicators, _LastError flag (and many others possibly related to your strategy - nobody knows it except you) is important. Then compare the logs for 2 passes and find out why you get different trades.
?
If you want to at least find out what's the reason of the problem, do this simple step first. Only then you can write down the list of a scenario.
Did you read this:
?
If you want to at least find out what's the reason of the problem, do this simple step first. Only then you can write down the list of a scenario.