Optimizing in Strategy tester

 

Hi all

I'm running the attached code through strategy tester. Works well in visual mode. Just as nice in non-visual mode. But try and run an optimization test and it doesn't take a trade.

 Any chance someone can tell me why?

 I do note most my other codes work fine. I do have a few variants of this code, they also don't work. Dazed and confused. 

Files:
 
forexbob1970: Works well in visual mode. Just as nice in non-visual mode. But try and run an optimization test and it doesn't take a trade.
  1. There is live, visual mode, and the non-visual optimizer. Contradictory statement.
  2. double currentboxhigh = ObjectGet("MagicBox" + IntegerToString(box_No), OBJPROP_PRICE1);
    There are no objects in the non-visual, so your get fails.
 

That EA has many, many bugs but in regards to your specific query, it uses Graphical Objects to store internal data (instead of using variables). However, Graphical Objects are NOT supported during Optimisation runs (and I quote):

Graphical Objects in Testing

During visualization, the Expert Advisor interacts with a real chart. In case there is no visualization, the Expert Advisor works with a "virtual" chart that is not displayed. The former case has some peculiarities. During optimization, working with graphical objects is not supported.

So, as a result, your EA cannot be optimised!

 
WHRoeder:
forexbob1970: Works well in visual mode. Just as nice in non-visual mode. But try and run an optimization test and it doesn't take a trade.
  1. There is live, visual mode, and the non-visual optimizer. Contradictory statement.
  2. double currentboxhigh = ObjectGet("MagicBox" + IntegerToString(box_No), OBJPROP_PRICE1);
    There are no objects in the non-visual, so your get fails.

So if I take that one step further, any code that uses the ObjectGet() function to obtain a value for processing can't be optimized through strategy tester. Instead one has to go back and use whatever code one used to generate that value in the first place and reference that. If that makes sence.
 
FMIC:

That EA has many, many bugs 

Bugs... that I'm not suprised by bro. I am the worlds worst programmer. But it seems I can do enough to test my ideas. But I hope one day like my trading my programming will become better. Can you recommend any links or articles that I should research to fix these bugs? 
 

Graphical Objects in Testing

During visualization, the Expert Advisor interacts with a real chart. In case there is no visualization, the Expert Advisor works with a "virtual" chart that is not displayed. The former case has some peculiarities. During optimization, working with graphical objects is not supported.


Seems I can't see the trees in the forest. Must have read that page half a dozen times looking for an answer!