Download MetaTrader 5
To add comments, please log in or register
Examine the Top MetaTrader 5 signals. Choose the best one and subscribe to it!
fxtrader86
70
fxtrader86 2014.05.08 14:18 

I was wondering if strategy tester can calculate more than one close points when testing your expert adviser? It seems that I'm having problems getting the strategy tester to show more than one close points with my EA, another words, strategy tester will close the whole lot when it should be closing part of the lot. When I activate my EA for live trading, it will close part of the lot with no problems. Has anyone else encountered this problem or have a solution to fix this?

My closing codes look like this:

 void start()

{

Code......

int total=OrdersTotal();

for(int cnt=total-1;cnt>=0;cnt--)

{

OrderSelect(cnt, SELECT_BY_POS);

Closing Code......

{

OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); Time0=Time[0]; // close position

Code....

}

}

}

return;

}

//+------------------------------------------------------------------+


whroeder1
13644
whroeder1 2014.05.08 14:36  
fxtrader86: I was wondering if strategy tester can calculate more than one close points when testing your expert adviser? It seems that I'm having problems getting the strategy tester to show more than one close points with my EA,

  1. Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); Time0=Time[0]; // close position
    I've used partial close in the tester (pre-B600) with no problems, but your code shows a complete close.
fxtrader86
70
fxtrader86 2014.05.10 12:24  
It isnt a partial close that im looking for, it is closing out multiple tickets one at a time
Keith Watford
Moderator
8009
Keith Watford 2014.05.10 13:18  
fxtrader86:

I was wondering if strategy tester can calculate more than one close points when testing your expert adviser? It seems that I'm having problems getting the strategy tester to show more than one close points with my EA, another words, strategy tester will close the whole lot when it should be closing part of the lot. When I activate my EA for live trading, it will close part of the lot with no problems. Has anyone else encountered this problem or have a solution to fix this?

My closing codes look like this:



fxtrader86:
It isnt a partial close that im looking for, it is closing out multiple tickets one at a time


Your posts contradict each other.

Explain clearly and post proper code and maybe somebody will be able to help you.

Ian Venner
2583
Ian Venner 2014.05.10 18:15  
fxtrader86:

...in another words, strategy tester will close the whole lot when it should be closing part of the lot.

fxtrader86:
It isnt a partial close that im looking for ...
fxtrader86
70
fxtrader86 2014.05.12 09:53  
for example: if I buy .10 lots @ 1.2 then buy another .10 lots @1.21. I then close .10 lots @ 1.23 then close the other .10 lot @1.24
whroeder1
13644
whroeder1 2014.05.12 11:16  
fxtrader86: I was wondering if strategy tester can calculate more than one close points when testing your expert adviser?
Of course the tester can handle multiple open orders.
fxtrader86
70
fxtrader86 2014.05.12 12:47  
WHRoeder:
Of course the tester can handle multiple open orders.


yeah thats what I figured. I can get the tester to calculate multiple buy or sell lots on different bars but I cant get the tester to close each individual buy or sell lot. It closes everything in one lot at one price. any suggestions on what I should change in the closing criteria to make this possible, or just please point me in the right direction so that I can figure it out myself.
whroeder1
13644
whroeder1 2014.05.13 16:12  
fxtrader86: It closes everything in one lot at one price.
  1. No, your code is closing everything. fix your code to do what you want
  2. Or set the TP at the prices you want and be done.
/
To add comments, please log in or register