EA contest on real accounts - page 17

 

Now I've looked at the account history and found out. That the function of closing positions after reaching the specified profit in the real account practically does not work! Although it works properly in the tester.

That is, in most cases profitable positions are closed at Ticrofit that equals 15 pips - the minimum allowable stop level.

But this Pipswise Expert Advisor has been optimized for closing +11 on EURCHF and +8 on EURGBP!

Such a difference (especially 15 and 8) is very sensitive for a scalping Expert Advisor!

I don't know yet why it happened so.... I took a ready function from another (alien) design.

I combed it and improved it (for eurofrank the function looks like this):

//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж+
//Функция дает команду на  закрытие  позиции при достижении профита , 
//задаваемого  параметром CloseProfit. Для корректной работы 
//этой функции необходимо наличие вспомогателной функции del(int ticket)
void CloseProfit()                                                    {
    if (OrdersTotal() > 0)                                            {
      for (int q = OrdersTotal() + 1; q >= 0; q--)                    {
         if (OrderSelect( q, SELECT_BY_POS, MODE_TRADES))              {
            if (OrderSymbol() == "EURCHF")                            {
               if (OrderMagicNumber() == Magic)                       {
                  if (OrderCloseTime() == 0)                          {
                     if (OrderType() == OP_BUY)                       {
                        RefreshRates();
                        if (Bid > OrderOpenPrice() + CloseProfit* Point) {
                           Print("ClosePozishion"); del(OrderTicket());
                        } }
                     if (OrderType() == OP_SELL)                         {
                        RefreshRates();
                        if (Ask < OrderOpenPrice() - CloseProfit* Point) {
                           Print("ClosePozishion"); del(OrderTicket());
                        }}}}}}}}}
//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж+
//Функция реализует закрытие позиций по текущей цене
void del(int ticket) {
   int Error;
   double _bid;
   for (int w = 0; w < 1; w++) {
      GetLastError();
      OrderSelect( ticket, SELECT_BY_TICKET, MODE_TRADES);
      if (OrderType() == OP_BUY) {
         RefreshRates();
         _bid = MarketInfo("EURCHF", MODE_BID);
         if (!OrderClose( ticket, OrderLots(), _bid, 3, Green)) Error = GetLastError();
      }
      if (OrderType() == OP_SELL) {
         RefreshRates();
         _bid = MarketInfo("EURCHF", MODE_ASK);
         if (!OrderClose( ticket, OrderLots(), _bid, 3, Green)) Error = GetLastError();
      }
      if ( Error == 0) {  PlaySound("expert.wav");  return; }//при  нормальном закрытии  
      //  позиции, - даем сигнал "expert.wav"
      if ( Error != 0) {// если произошла ошибка закрытия - сигнал и печать .
         PlaySound("timeout.wav");
         Print("Error for Close Funtion =", Error);
      }
      while (!IsTradeAllowed()) Sleep(5000);//если торг. поток занят, - ждем 5 сек
      if ( Error == 146) while (IsTradeContextBusy()) Sleep(10000);
      //если нет соединения с сервером, ждем - 10 сек
   }
}

//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж+
 

Does it give out errors?

this design can be simplified

      if (OrderType() == OP_BUY) {
         RefreshRates();
         _bid = MarketInfo("EURCHF", MODE_BID);
         if (!OrderClose( ticket, OrderLots(), _bid, 3, Green)) Error = GetLastError();
      }
      if (OrderType() == OP_SELL) {
         RefreshRates();
         _bid = MarketInfo("EURCHF", MODE_ASK);
         if (!OrderClose( ticket, OrderLots(), _bid, 3, Green)) Error = GetLastError();
      }

like this

RefreshRates();
if (!OrderClose( ticket, OrderLots(),OrderClosePrice(), 3, Green)) Error = GetLastError();
 
keekkenen писал(а) >>

Does it give out errors?

this design can be simplified

like this.

I can't say anything about errors. I only have the investment password from this account.

But errors happen very often on my real account with this brokerage company. I receive a beeping signal of errors in the code and I hear this signal quite often! At first there is a closing error signal. And often after another minute or two there is a signal of Take Profit triggering. In other words, the function of closing works incorrectly and the price breaks through to the take profit level passing the set closing level!

As for the design simplification, it can be simplified but it is clearer to me when everything is described in details.

 

You wrote: This Pips Expert Advisor is optimized to close +11 on EURCHF and +8 on EURGBP!

Everything is easy to explain. You open a long position and wait for the condition to trigger the legal 15 pips

if (OrderType() == OP_BUY){
	RefreshRates();
    if (Bid > OrderOpenPrice() + CloseProfit* Point) {
		Print("ClosePozishion"); del(OrderTicket());
    }
}

But it was not there. You buy on Bid and close on Bid, thus you lose the spread (4 pips), so you have to set Ask instead of Bid in the Ifa,

to get your 15 pips...


and also, the above is something unclear... if takeprofit is 15 pips, why close earlier?

 
keekkenen писал(а) >>

You wrote: This Pips Expert Advisor is optimized to close +11 on EURCHF and +8 on EURGBP!

Everything is easy to explain. You open a long position and wait for the condition to trigger the legal 15 pips

But it was not there. You buy on Bid and close on Bid, thus you lose the spread (4 pips), so you have to set Ask instead of Bid in the Ifa,

to get your 15 pips...

If takeprofit is 15 pips why should i close earlier?

Not exactly. I want to close the position after reaching +11 pips of profit. While take profit is at +15 (because it's impossible to place it closer - the stop level in DC is allowable = 15).

Why do you think I bought on bid ? I was buying on asc.

But long positions are closed by selling ? - Isn't it ?

and that's why it's bid on the e-fee...

But even if I lose the size of the spread in your opinion, this fact does not explain the divergence of results between the real and the tester !

Almost 500$ divergence to the worse with lot =0.1 in 10 days with 200 trades.

 
leonid553 >> :

But even if I lose the spread size according to you, this fact does not explain the divergence of results between the real and the tester !

>> Uh-huh. There's also Freeze level, maybe that's the problem.
 
TheXpert писал(а) >>

Almost a third of the trades are missing in the real, which may be a missed profit. Or maybe there is something missing. Let me know and we'll figure it out.

I have sorted out the number of deals. Now I have run the Expert Advisor in the tester with the option of requotes modeling enabled. The amount of deals in the tester and in the real account was almost the same (within reasonable limits).

I.e., requotes are to blame. They strongly reduce the number of deals and a lot of profitable deals must have been cut down on the real account.

But all the same - it does not explain all the differences between the test and real results.

//-------------------------------------------------------------------

So my Expert Advisor seems to have "worked up" and become one of the leaders...

http://acompetition.love-craft.ru/?q=ru

 
TheXpert писал(а) >>
There is also Freeze level, maybe the problem lies in it.

If I understand correctly, this concept includes a limit on the number of positions open at the same time and a limit on the lot size.

I don't think this factor is relevant.

According to the Expert Advisor's algorithm, there can be no more than one position in the market for one pair at a time.

The lot is fixed for the time being. (0.1)

 
leonid553 >> :

If I understand correctly, this concept includes a limit on the number of open positions and a limit on the lot size.

No - it is a level closer than which you cannot modify pending orders, as well as take and lot positions.

 
Thank you for the clarification. I will go to the DC website to clarify the issue.
Reason: