Errors, bugs, questions - page 260

 
Dima_S:
possible loss of data due to type conversion ChartObject.mqh 213 4
possible loss of data due to type conversion ChartObject.mqh 481 4
possible loss of data due to type conversion ChartObject.mqh 867 17
possible loss of data due to type conversion ChartObjectsTxtControls.mqh 519 4

Bild 375 - vornings appeared in standard libraries. There may be some more, I haven't checked them yet.


Already fixed. Will be in next build.
 
sergeev:
everyone has been interested since mt4.

Well, is there any suggestion at all?)

I mean, it's even weird, or deliberate)

 
Makser:

Well, is there any suggestion at all?)

I mean, it's even weird, or deliberate)

Are you referring to the numbers on the price scale of yen-containing symbols? If so, it's most likely a unification of the formatting of the fractional price value to display it on the scale, something like %10.{SYMBOL_DIGITS}f

I think the developers just didn't think it's necessary to add one more check to make sure the value is an integer.

 

This code occasionally leaves handle2 file open for some reason until I reload it and the Mt4 EA cannot open it for writing, what's wrong, please advise...

void OnStart()
  {
//---
   int handle1,handle2;
   string CurBid1,CurBid2;
   while (true)
      {
         handle1=FileOpen("M1"+"\\experts\\files\\"+"News"+".csv",FILE_READ|FILE_TXT|FILE_ANSI);
         handle2=FileOpen("M2"+"\\experts\\files\\"+"News"+".csv",FILE_READ|FILE_TXT|FILE_ANSI);
         if(handle2!=INVALID_HANDLE&&handle1!=INVALID_HANDLE)
         {  CurBid2=FileReadString(handle2);
            FileClose(handle2);
            CurBid1=FileReadString(handle1);
            FileClose(handle1);
            
         }

         Sleep(1000);
      }
  }
 
Olegts:

This code occasionally leaves handle2 file open for some reason until I reload it and mt4 EA cannot open it for writing, what's wrong, please advise...


You have broken the logic. You open two files at once, but it doesn't mean that both will open at the same time...

And you don't close it at the same time....

 
AlexSTAL:

Your logic is flawed. You open two files at once, but it's not certain that both will open at the same time...

And you don't close them at the same time....

got it, one may be hanging, thanks for the tip:)))
 
sergey1294:

In MT5, not a deal is closed by a stop loss, but a position, at this point, you can know only by the comment of the deal that closed the position by a stop loss. Here is a sample code.

Thanks for the helpful reply!

It is good that the possibility of finding out the reason for closing a position does exist, although the fact that there is no more standard possibility in MQ5 from the programmer's point of view indicates some incompleteness of the system. If there is an event, there must be a standard way to find out the reason for it. It seems to me that the next versions of the system should introduce extended statuses for DEAL to allow for this.

I have one more question: what is the best way to reverse a position when a certain level of loss is reached? Thank you in advance for your advise.

 
komposter:

What is the average profit trade size of the EA? Something tells me it's less than 10 pips.

The problem is probably in the historical data - it's either more combed (filtered), or just more correct (e.g. contains the correct spreads).

Which server is it?

Alpari-Demo server. There are a lot of small trades. But I still don't understand the reason for the reversal at point C.
 
sultanm:
Alpari-Demo server. There are a lot of trades and small ones. But I still do not understand the reason of the reversal at point C.

Try the optimisation on the MQ server, with the same parameters and time intervals.

If the result repeats then it's worth thinking, if not then it might be another Alpari bug (or just a tricky configuration of their server).

 

Some time ago I asked on the forum (a long time ago, when MT5 was quite crude) if it was possible to open two charts of different timeframes in one window (e.g. for EURUSD tab, put several charts inside). Someone answered that it is possible. I have now installed MT5 and I don't see this option. Can anyone confirm this and if so how to do it?

Thank you!