Hi all,
This is my second ever post on forexfactory but I have read the site for some time.
My post is with regard to the 'error 1' on the MT4 backtest. I am currently getting similar messages on other EA's I write (I'm a programmer by trade). From the MT4 documentation the error means you are updating either a stop or TP with an unchanged value.
For example if a stop on cable is 2.0200 and you update it using OrderModify to be 2.0200 you will get error 1. I don't think it is a serious problem and may well be informational only. In fact if you backtest the supplied MacD EA that comes with MT4 you will see it also generates these errors.
The question is how to remove them? I have tried comparing OrderStopLoss() with the variable I store the new stop in and not doing the OrderModify if they are the same but somehow the EA always does the OrderModify and generates the error 1 message. Despite printing both values (the values appear the same) and even doing a NormaliseDouble to both values to remove any rounding problems when comparing them but it still happens.
for example, something like the following still performs the OrderModify even when the values of NewStop and OrderStopLoss appear the same when printed:
if (OrderStopLoss() != NewStop) {
OrderModify.....
}
Have any programmers out there found a work around? Maybe it is a bug being that Metatraders own EA does it.
This is my second ever post on forexfactory but I have read the site for some time.
My post is with regard to the 'error 1' on the MT4 backtest. I am currently getting similar messages on other EA's I write (I'm a programmer by trade). From the MT4 documentation the error means you are updating either a stop or TP with an unchanged value.
For example if a stop on cable is 2.0200 and you update it using OrderModify to be 2.0200 you will get error 1. I don't think it is a serious problem and may well be informational only. In fact if you backtest the supplied MacD EA that comes with MT4 you will see it also generates these errors.
The question is how to remove them? I have tried comparing OrderStopLoss() with the variable I store the new stop in and not doing the OrderModify if they are the same but somehow the EA always does the OrderModify and generates the error 1 message. Despite printing both values (the values appear the same) and even doing a NormaliseDouble to both values to remove any rounding problems when comparing them but it still happens.
for example, something like the following still performs the OrderModify even when the values of NewStop and OrderStopLoss appear the same when printed:
if (OrderStopLoss() != NewStop) {
OrderModify.....
}
Have any programmers out there found a work around? Maybe it is a bug being that Metatraders own EA does it.