New MetaTrader 4 Client Terminal build 402 - page 6

 
dmmikl86:
This is because the pip value is different for different pairs...

I think the pip value is redundant in the "profit in pips" display mode

 
olyakish:

I think the point value is redundant in the "profit in pips" display mode

it's another eternal MT glitch )
 

Glitches....

1) If you remove unnecessary instruments from Market Watch and then add some again, you get an interesting thing.

Right-click on an instrument, select "Chart Window" to open a chart.

This will open a chart of a different instrument than the one you selected!!!

For this error to happen, you have to select a tool from the one you have just added. (see screenshots pic1, pic2, pic3)

2) in my screenshot you can see that USDCHF instrument is marked as selected in the "Symbols" window, although it is not actually in the "Market Watch". (pic4)

Maybe the first glitch is a consequence of the second one, because the numbering of instruments in the Market Watch is wrong.

I have very bad Internet, that's why all screenshots are in archive.

Here is the linkhttp://www.sendspace.com/file/tbav73

 
dimonsky:

Glitches....

1) If you remove unnecessary instruments from Market Watch and then add some again, you get an interesting thing.

Right-click on an instrument, select "Chart Window" to open a chart.

This will open a chart of a tool other than the one you selected!!!

Also noticed this back in the 401 build.
 

Today (or rather yesterday) morning I got a strange glitch in MT4 - OrderSelect did not find an order by ticket number in one Expert Advisor.

Two pending orders are placed in the EA - BUY_STOP and SELL_STOP, on opposite sides of the current price. The ticket numbers of these orders are stored in t1 and t2. The code where the error has occurred, as shown below, does the following: when one of these pending orders is opened, the second one is deleted and the next pending order with the number t3 is placed instead. If there was an error when t1 and t2 were originally placed, the erroneous ticket should not be on the order list. This is what is checked with if (OrderSelect ...) and, in case of an error, we write a message in the log and exit the series using restart().

Today t1 opened at 6:30. Order t2 was immediately deleted by the Expert Advisor (it was deleted from the market, but it stayed in the history - "canceled", I checked). After that, t3 was placed. These events are all in the logs of MT and EA. Then the check "OrderSelect(t2, SELECT_BY_TICKET)" returns FALSE and the series aborts with "Unknown order t2" error. It's strange, because t2 was set and deleted without errors and stayed in the history. The history mode in MT is "All history". How could OrderSelect not find it?

The computer is standalone, used only for trading, nothing else. No one touches it but me. CPU load averages 10%. Memory, disk space, etc. is big enough.
The version of MT4 is 402. For several months the Expert Advisor has been working in different variations in real time on a demo account in one MT parallel to three different pairs (on three charts). There were no problems with this part of the code until this morning. After that everything went smoothly in the afternoon and in the evening for other pairs on the same EA. That is, the error cannot be reproduced at will.

Question: how could this happen? Is it a glitch in MT or something I didn't take into account in the code?

This code uses functions OrderDeleteX and OrderSendX - wrappers for standard OrderDelete and OrderSend, which add checks of a trade thread for not being busy and register events like "Deleting order ..." and "Sending order ..." in the EA's log.
I removed price calculations to make the code simpler and clearer.

if (OrderSelect(t1, SELECT_BY_TICKET)) {
  if (OrderType() == OP_BUY) {
    Print("--------------------------------------------------");
    if (t2 > 0) OrderDeleteX(t2);
    // Расчёты цены, стоплосса и тейкпрофита
    // .....
    t3 = OrderSendX(Symbol(), OP_SELLSTOP, 0.02, Price1, slip, StopLoss, TakeProfit, "step 2", Magic, 0, ColorOrderSendSell);
  }   
} else {
  Print("ERROR: Unknown order t1 in step 1");
  restart(3);
}
 

if (OrderSelect(t2, SELECT_BY_TICKET)) {     
  if (OrderType() == OP_SELL) {
    Print("--------------------------------------------------");
    if (t1 > 0) OrderDeleteX(t1);
    // Расчёты цены, стоплосса и тейкпрофита
    // .....
    t3 = OrderSendX(Symbol(), OP_BUYSTOP, 0.02, Price1, slip, StopLoss, TakeProfit, "step 2", Magic, 0, ColorOrderSendBuy);
  }
} else {
  Print("ERROR: Unknown order t2 in step 1");
  restart(4);
}


Order numbers in variables:
t2 = 119732180
t3 = 119733656

Лог эксперта:
06:30:43 CheMurom v3.4.real EURUSD,H1: --------------------------------------------------
06:30:43 CheMurom v3.4.real EURUSD,H1: Deleting order #119732180; attempt number: 1
06:30:43 CheMurom v3.4.real EURUSD,H1: delete #119732180 sell stop 0.01 EURUSD at 1.46432 sl: 1.47032 tp: 1.43432 ok
06:30:43 CheMurom v3.4.real EURUSD,H1: Sending order cmd=SELL_STOP, lot=0.02, price=1.46032, slip=3, sl=1.46932, tp=1.44082; attempt number: 1
06:30:44 CheMurom v3.4.real EURUSD,H1: open #119733656 sell stop 0.02 EURUSD at 1.46032 sl: 1.46932 tp: 1.44082 ok
06:30:44 CheMurom v3.4.real EURUSD,H1: ERROR: Unknown t2 in step 1

Лог терминала:
06:30:43 '2871084': delete pending order #119732180 sell stop 0.01 EURUSD at 1.46432 sl: 1.47032 tp: 1.43432
06:30:44 '2871084': request was accepted by server
06:30:44 '2871084': request in process
06:30:44 '2871084': pending order #119732180 was deleted
06:30:44 '2871084': pending order sell stop 0.02 EURUSD at 1.46032 sl: 1.46932 tp: 1.44082
06:30:44 '2871084': request was accepted by server
06:30:45 '2871084': request in process
06:30:45 '2871084': order was opened : #119733656 sell stop 0.02 EURUSD at 1.46032 sl: 1.46932 tp: 1.44082
 

I cannot find any order. We can see from the DC report that order 67930924 was open...

These are closed trades in the account history since 08.06.11. As we can see this order is not here.

So it must be in open trades. The picture below, open trades.

But it is not here either. I wonder what report will be sent tomorrow by DC, but I want to hear the version of software developers, how it can be.

And one more thing, may be it is not important, but my date is not saved and I don't have any info about it.


 
voinG:

I cannot find any order. We can see from the DC report that order 67930924 was open...

These are closed trades in the account history starting from 08.06.11. As we can see this order is not here.

So it must be in open trades. The picture below, open trades.

But it is not here either. I wonder what report will be sent tomorrow by DC, but I want to hear the version of software developers, how it can be.

And one more thing, may be it is not important, but my date is not saved and I don't have any info about it.



It's there. I opened "whole story" and it's visible in this version.
 

As a continuation of the theme "OrderSelect did not find an order by ticket number".

This morning the same error occurred in the same Expert Advisor on another pair. The pending order t2=#119899844 was placed successfully, then it was deleted successfully as well, after which the pending order t3=#119903758 was placed, and after that t2 was not found by OrderSelect function.

Between yesterday's error and today's one, the code given in my previous message in the Expert Advisor worked successfully several times with no errors and the deleted orders were found without any problems.

For several months before that, the Expert Advisor had been working in version MT4 229. Nothing like this was observed before. At weekend 4 days ago I have switched to version 402. I do not know if the errors are related to the new version. I cannot go back to old version, because Alpari, where this Expert Advisor is trading, has changed time zone of quotes, and only version 402 correctly reflects these changes (so Alpari claim).

The questions remained open:
How could this happen, why has OrderSelect not found the order in the history, while the history is displayed in its entirety, the lost order is visible in it? Is this a MT glitch or am I missing something in the code?

Лог эксперта:
10:15:33 CheMurom v3.4.real EURCHF,H1: --------------------------------------------------
10:15:33 CheMurom v3.4.real EURCHF,H1: Deleting order #119899844; attempt number: 1
10:15:34 CheMurom v3.4.real EURCHF,H1: delete #119899844 sell stop 0.01 EURCHF at 1.22245 sl: 1.22945 tp: 1.19735 ok
10:15:34 CheMurom v3.4.real EURCHF,H1: Sending order cmd=SELL_STOP, lot=0.02, price=1.21745, slip=3, sl=1.22845, tp=1.20015; attempt number: 1
10:15:36 CheMurom v3.4.real EURCHF,H1: open #119903758 sell stop 0.02 EURCHF at 1.21745 sl: 1.22845 tp: 1.20015 ok
10:15:36 CheMurom v3.4.real EURCHF,H1: ERROR: Unknown t2 in step 1

Лог терминала:
10:15:35 '2871084': delete pending order #119899844 sell stop 0.01 EURCHF at 1.22245 sl: 1.22945 tp: 1.19735
10:15:35 '2871084': request was accepted by server
10:15:35 '2871084': request in process
10:15:36 '2871084': pending order #119899844 was deleted
10:15:36 '2871084': pending order sell stop 0.02 EURCHF at 1.21745 sl: 1.22845 tp: 1.20015
10:15:36 '2871084': request was accepted by server
10:15:36 '2871084': request in process
10:15:37 '2871084': order was opened : #119903758 sell stop 0.02 EURCHF at 1.21745 sl: 1.22845 tp: 1.20015
 
Described the problem to Renate with a screenshot, in 399 build they removed it, but in 401 and 402 this glitch appeared again, I had to go back to 399 build
 

There is a DLL written in Delphi7. It has only one function - to check if there is a file in the specified path.

Here is its code.

library FileGDV;

uses
  SysUtils,
  Classes;

//{$R *.res}

function FileExists(s:pchar):boolean; StdCall;
begin
   result:=sysutils.fileexists(s);
end;

exports FileExists;

begin
end.

Nothing complicated, nothing special, just one function.

Here is the code of the Expert Advisor that uses this function:

if (FileExists(s))
      {
         handleM=FileOpen(fn,FILE_BIN|FILE_WRITE|FILE_READ);
         
      }
      else
      {
         Alert("File not found   "+s);         
         handleM=FileOpen(fn,FILE_BIN|FILE_WRITE);
         s="Time;;M1;M5;M15;M30;H1;H4;D1\n";
         FileWriteString(handleM,s,StringLen(s));
      } 

and here is the code of the header file

#import "FileGDV.dll"


bool FileExists(string s);

 
#import


Here is the code of the header file. If there is only one Expert Advisor in the terminal, everything runs like clockwork.

If I have two of them in the terminal in different windows and they call this function, then every few hours, both EAs stop working and messages appear in the journal

2011.06.09 14:33:57     gdv_e_MultiMACD_a_KSP_GBP_v082 GBPCHF,M5: expert stopped
2011.06.09 14:33:57     gdv_e_MultiMACD_a_KSP_GBP_v082 GBPCHF,M5: function 'FileExists' call from dll 'FileGDV.dll' critical error
Reason: