Optimizing in Strategy tester

Back to topics list To post a new topic, please log in or register
avatar
30
forexbob1970 2016.08.15 15:41
 

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. 

Attached files:
  bobstbartv1.2.1.mq4  (17.76 KB)
avatar
13006
WHRoeder 2016.08.15 16:16 #
 
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.

avatar
1223
FMIC 2016.08.15 16:28 #
 

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!

avatar
30
forexbob1970 2016.08.15 16:33 #
 
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.
avatar
30
forexbob1970 2016.08.15 16:40 #
 
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? 
avatar
30
forexbob1970 2016.08.15 16:43 #
 

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!
Back to topics list  

To add comments, please log in or register