Error in OnTick function
-
Hello fxDreema.
I have this problem to do optimizations:
11:11 Core 2 2015.05.25 pass 0 tested with error "critical runtime error 503 in OnTick function (zero divides, module Experts\Advisors\TCF DC MM DC MM v1.0.ex5, file v1.0.mq5, line TCF 2828, Coll. 83)" in 00:00: 07,519
This line in the code is:
else if (mode == "balanceRisk") {size = ((value/100) * AccountBalance ())/(sl * TickValue * PipValue (symbol));}You have something wrong? Tested in two MT5 and different accounts.
......
TCF DC MM v1.0.mq5 -
This error is because SL is 0. Your SL comes from the indicator you use. Is everything ok with this indicator?
-
Yes. I had no problems in backtest visual.
SL Mode Dynamic Level (price imput)
Here's to analysis:
https://fxdreema.com/shared/JWNVt9cXc......
donchian_channels.mq5 -
The error comes because the "sl" part in this formula that you posted is 0, and "sl" comes from the indicator that is selected in the block. So, it reads that the indicator value is 0. Why... who knows. Or at least this is what I believe.
I tested this and it works on my MT5 - visual mode and optimization.
I can suggest to inspect those indicator values that you use for SL. I think that "Write to file" block can output this information when optimizing.
-
__I can suggest to inspect those indicator values that you use for SL. I think that "Write to file" block can output this information when optimizing.[/quote:jx9c7utl]
OK. How do I do that?Today I have compiled in mql5 and appeared to me the following message:
"possible loss of data due to type conversion TCF DC MM v1.1.mq5 4183 16"Is a warning important? Can influence in my trandes?
-
Just put the block to write data to file somewhere where you want to use, even under On Init, because you don't really need it to be filled with data too much. It will put the data in a file somewhere (use the windows search to find it). This seems to be the only way to output some data while optimizing. Otherwise we normally use Print, Alert, Comment, Objects and who knows wtah else. But these things just does not work when optimizing.
This warning is not important.
-
Added this block, but I don't see in the code. Where is?
https://fxdreema.com/shared/FzsidmiLb -
If you are talking about this - http://prntscr.com/7f1x8u - then I wonder how it's possible for you to not know that a single block like this is excluded from the project, which is some rule that exists from the very beginning. That's why I added this block called "Pass" - it does nothing, but when connected with other block it does the magic to put the other block into the output code
So, just connect one "Pass" block to "Write to file"