Help with tester and optimization (very quick)

 

Whenever I run a tester to test my EA (or in optimization), the tester will close all trades at the end of the period chosen (stop-out).

Is there any possibility to make it such that: the period tested remains the same (from date x to date y) but, should there be open trades, the tester should, in both, optimization and standard test, allow the open trade to be closed and not stop out. For example: testing to date y but, if any open trades, continue testing for y +z days until either sl or tp are hit or EA closes trades on his own (or margin call). Basically test to said date but, avoid stop out. does that make sense?

Can I do that in any way?



Thanks for your input. Have a good day.

 
firefoxuser331:

Whenever I run a tester to test my EA (or in optimization), the tester will close all trades at the end of the period chosen (stop-out).

Is there any possibility to make it such that: the period tested remains the same (from date x to date y) but, should there be open trades, the tester should, in both, optimization and standard test, allow the open trade to be closed and not stop out. For example: testing to date y but, if any open trades, continue testing for y +z days until either sl or tp are hit or EA closes trades on his own (or margin call). Basically test to said date but, avoid stop out. does that make sense?

Can I do that in any way?

You would need to code your EA to do it, you would tell your EA when the end date for the test run is and the EA would manage the trades as per your description z days before the end date.
 
I was thinking about that and, thanks for the suggestion, but, what about precompiled ea's such as commercial ones? I cannot change the code. Anything I could do there?
 
firefoxuser331:
I was thinking about that and, thanks for the suggestion, but, what about precompiled ea's such as commercial ones? I cannot change the code. Anything I could do there?
Only thing I can think of is to run the test a little longer than you want and then use the figures from a point before the end when there were no open trades.
 

you are right. that should work. thank you.

have a good day!

 
firefoxuser331: Whenever I run a tester to test my EA (or in optimization), the tester will close all trades at the end of the period chosen (stop-out).

Stop-out is NOT the tester closing all trades at the end of the period chosen.

Stop-out is a margin call and stops the run prematurely.

Before opening an order, you must verify that you will have free margin not only at the open but at the most adverse excursion (i.e. SL) for all open orders to avoid stop-out. See my lotsize() for an implimentation. Why is there NO Complete EA within the Code-Base? - MQL4 forum