Download MetaTrader 5

V625 StrategyTester Optimization bug ObjectFind ??

To add comments, please log in or register
Tjipke de Vries
6362
Tjipke de Vries  

I made an EA that when price passed a line condition for opening a trade was true

The level was found with

         if(ObjectFind("new_buy") != -1)
           {
           buyprice = ObjectGet("new_buy",OBJPROP_PRICE1);
              {
              if(pAsk >= buyprice)Openbuystop = true;
              } 
           }         

The EA was working well in testing lot of trades and on demoaccount

but moment I tried to optimize the settings with Optimization all results of optimization were no trades done

It was by using ObjectFind this happend

Changing the code

      if(IsOptimization())
         {
         if(GlobalVariableCheck("New_Buy "+Symbol()) != false)
           {
           buyprice = GlobalVariableGet("New_Buy "+Symbol());
              {
              if(pAsk >= buyprice)Openbuystop = true;
              } 
           }
         }     

using a globalvariable made the EA also doing the Optimization

qjol
3243
qjol  

try to

Print(GlobalVariableCheck("New_Buy "+Symbol()));

and see the result maybe it false

Tjipke de Vries
6362
Tjipke de Vries  
qjol:

try to

and see the result maybe it false


for what reason to do that globalvariable is working in optimization,

the problem i found was using function ObjectFind in optimization while it worked in normal test StrategyTester

qjol
3243
qjol  
deVries:


for what reason to do that globalvariable is working in optimization,



for debugging reasons only
Tjipke de Vries
6362
Tjipke de Vries  
qjol:

for debugging reasons only

Print is not done while you run optimization
qjol
3243
qjol  
I didn't know that i'm not using StrategyTester or optimization
Alain Verleyen
Moderator
32012
Alain Verleyen  
qjol:
I didn't know that i'm not using StrategyTester or optimization
LOL...why are you answering...
Alain Verleyen
Moderator
32012
Alain Verleyen  
deVries:


for what reason to do that globalvariable is working in optimization,

the problem i found was using function ObjectFind in optimization while it worked in normal test StrategyTester

The object is created by your EA ?
Tjipke de Vries
6362
Tjipke de Vries  
angevoyageur:
The object is created by your EA ?


yes it is, created by the EA. normally testing it did do all the trades,

with optimization you don't see a chart but also with same setting as in testing result of optimization was no trade in optimization

Alain Verleyen
Moderator
32012
Alain Verleyen  
deVries:


yes it is, created by the EA. normally testing it did do all the trades,

with optimization you don't see a chart but also with same setting as in testing result of optimization was no trade in optimization

I supposed you checked that there is no error when creating your object.

Tjipke de Vries
6362
Tjipke de Vries  
angevoyageur:

I supposed you checked that there is no error when creating your object.


There was no error creating the object, outside optimization a normal function

i can show you the logic how i created the object if you Skype me

12
To add comments, please log in or register