Errors, bugs, questions - page 2066

 
fxsaber:

This seems to be the wrong behaviour for the language, as it limits the possibilities.

I need to define a const field as a structure. I thought the copy operator would work, but the compiler wants a constructor instead, because the syntax is similar. But it is wrong.

It's correct because it's unambiguous (it's always a constructor in the initialization list, not an operator), it's wrong in another way:

struct S {
        S()                        { Print( __FUNCSIG__ ); }
        void operator=( const S& ) { Print( __FUNCSIG__ ); }
};
void OnStart()
{
        S s;
        S s1 = s;

}

Result:

void S::S() (1)
void S::S() (2)
void S::operator=(const S&) (3)

whereas C++ does not output lines (2) and (3), and hence does not replace the missing copy constructor with a symbiosis of the default constructor and assignment operator

 

If a BMP object has had its resource deleted and then created again, the BMP object no longer sees its resource. This is an error. Now you have to delete the object and recreate it again.

 
fxsaber:

If a BMP object has had its resource deleted and then created again, the BMP object no longer sees its resource. This is an error. Now you have to delete the object and recreate it again.

Can you show us the code? Why do you need to delete a resource, you can overwrite/modify it without deleting it.
 

Situation:

A market position of a third-party Expert Advisor has been successfully selected by OrderSelect(ticketNumber,SELECT_BY_TICKET) and an attempt is made in the loop to close it (the order selection on the ticket was made before the closing attempt loop).


I get an error:

2017.11.10 06:00:33.806 ExpertName EURCAD,H1: unknown ticket 1846978258 for OrderClose function

Ticket is ok.


It is only natural that our EA could close that order independently, so

at each iteration of the loop, we check

if(OrderCloseTime()!=0) break;


which does not give the desired result and the message about the wrong ticket number is displayed all 30 times of the cycle.

A bad hand or is it a bug with a loss of a selected order ?

Or the error number may not accurately reflect the situation/problem ?


Update:

I have found out that position is closed not by native EA, but by the one we close.

However, before cyclic error 4108 we get a one time error 3 (although before error 3 is logged the order has been closed).

 
Kirill Belousov:

Naturally, the native EA could close this order independently, so

At each iteration of the loop, the check is done.

We have to do OrderSelect as well.

 
Andrey Barinov:
Can you show me the code? Why delete the resource, you can re-download / modify it without deleting it.

Reloaded without deletion without any problems, of course. After deletion, problems.

#define  WIDTH 100
#define  ARGB(a,r,g,b)  ((uchar(a)<<24)|(uchar(r)<<16)|(uchar(g)<<8)|uchar(b))

bool Set( const string Name, const uint &Data[], const uint Width )
{
  return(ResourceCreate(Name, Data, Width, (Width == 0) ? ArraySize(Data) : ArraySize(Data) / Width, 0, 0, Width, COLOR_FORMAT_ARGB_NORMALIZE));
}

void Test( const string Name )  
{
  static uint Data[WIDTH * WIDTH];
  
  for (uchar i = 0; i < 100; i++)
  {
    ArrayInitialize(Data, ARGB(0xFF, i, i, 0));
    ArrayInitialize(Data, ARGB(0xFF, i, i, 0));
    
    Set(Name, Data, WIDTH);
    
    ChartRedraw();
    
    Sleep(50);
  }
  
  ResourceFree(Name);  
}

void OnStart()
{  
  const string ObjName = __FILE__;
  const string Name = "::" + ObjName;
  
  ObjectCreate(0, ObjName, OBJ_BITMAP_LABEL, 0, 0, 0);
  ObjectSetString(0, ObjName, OBJPROP_BMPFILE, Name);
  
  // Видна работа
  Test(Name);
  
  // Нет результата на экране
  Test(Name);
  
  ObjectDelete(0, ObjName);
}
 

No messages from

System messages


No messages at all. Including , product message, product sale, moderator remarks, product validation message.

 
Vladislav Andruschenko:

No messages from

System messages


None at all. including , product message, product sale, moderator remarks, product validation message.

Good afternoon.

The bug was fixed, we have to wait for the site update.

We apologize for the inconvenience.

 
Julia Test:

Good afternoon.

The error has been corrected, we have to wait for the site to be updated.

Sorry for the inconvenience.


Thank you. already replied to the SD. :-) waiting...

P.S. It's never been so quiet before.... direct silence .........

 
fxsaber:

You have to do OrderSelect as well.

Can we have details as to why this is?

We have successfully selected an order on a ticket.

We have sent a close command in iteration 1.

At this iteration #1, we received error 3 (Invalid trade parameters.) The order nevertheless closed. How was it closed?

Then we get error 4108 at iteration 2. We cannot close it using OrderCloseTime!=0.


At which stage, according to the documentation, do we lose connection with the order selected by the ticket?

Isn't this a case where after sending the close command the order should have been locked and error 139 should have been generated instead of 4108?

Reason: