Errors, bugs, questions - page 1815

 
Compilation error
template<typename T>
class A { public:
    A( const T * ) {} //Error: 'T' - unexpected token
};
class B {};
void OnStart()
{
    A<const B> a( new B );
}
 

Hello, I am having the following happen in my demo account at Otkritie

the following happens: if I successfully modify and delete an order

of ORDER_FILLING_RETURN type (a regular limit order)

the variable volume fromMqlTradeResult structure stably equals to the initial order size (in this case, the order hasn't been executed at all).

It seems to be that it should give out an executed volume (0 in my case), or am I mistaken?

 
Sergey Kudryavtsev:

I think it should give out an executed volume (0 in my case) or am I wrong?

This was originally the case

Forum on trading, automated trading systems & strategy testing

Libraries: MT4Orders

fxsaber, 2017.02.10 12:01

Result of the script
OrderSend(NULL,OP_BUYLIMIT,1,Ask-100*Point,100,0,0,My Order)
Request.action = TRADE_ACTION_PENDING (5)
Request.magic = 0
Request.order = 0
Request.symbol = EURUSD
Request.volume = 1.0
Request.price = 1.06356
Request.stoplimit = 0.0
Request.sl = 0.0
Request.tp = 0.0
Request.deviation = 100
Request.type = ORDER_TYPE_BUY_LIMIT (2)
Request.type_filling = ORDER_FILLING_IOC (1)
Request.type_time = ORDER_TIME_GTC (0)
Request.expiration = 1970.01.01 00:00:00
Request.comment = My Order
Request.position = 0
Request.position_by = 0
Result.retcode = 10009
Result.deal = 0
Result.order = 57777
Result.volume = 1.0
Result.price = 1.06356
Result.bid = 0.0
Result.ask = 0.0
Result.comment = My Order
Result.request_id = 592
Result.retcode_external = 0
Now it is easy to understand how to correctly form the relevant trade requests in MT5.
 
fxsaber:
It was like this from the beginning!
Thank you!
 
A search for "MqlTradeResult " cannot produce a link to the description in the Help.
 

During OrderSend execution, it is not possible to exit debug mode or delete the EA/script.

Sometimes OrderSend runs for 180 seconds, with Request timeout. You have to wait three minutes to be able to compile in the editor, if the script was running in debug mode.

 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

fxsaber, 2017.02.16 07:55

2017.02.16 08:53:03.158 Network '2250': disconnected from FXOpen-MT5
2017.02.16 08:53:03.285 MQL5    wrong type, loading of Test failed
2017.02.16 08:53:03.813 Network '5122740': authorized on MetaQuotes-Demo through Access Point EU Amsterdam (ping: 50.93 ms)

What is it?

Nothing is running on the only chart. Any time I switch accounts this message pops up.

Deleted all Test.ex* files. The message keeps popping up.
 

Forum on trading, automated trading systems and trading strategy testing

Crazy cache of testing agents

Renat Fatkhullin, 2017.02.21 04:04

Try the new Friday build of MT5 1545 - something has been improved.

Also note that we have over 230,000 permanently active accounts on MetaQuotes-Demo MT5 and it's a real trading bacchanalia.

I think the bacchanalia is even more powerful on the exchange, but coping.

1545 - seems to be getting better. But all slips through the cracks.

Request/response.

Request.action = TRADE_ACTION_DEAL (1)
Request.magic = 0
Request.order = 0
Request.symbol = EURCAD
Request.volume = 0.01
Request.price = 1.39016
Request.stoplimit = 0.0
Request.sl = 0.0
Request.tp = 0.0
Request.deviation = 100
Request.type = ORDER_TYPE_SELL (1)
Request.type_filling = ORDER_FILLING_RETURN (2)
Request.type_time = ORDER_TIME_GTC (0)
Request.expiration = 1970.01.01 00:00:00
Request.comment =
Request.position = 134821044
Request.position_by = 0
Result.retcode = 10009
Result.deal = 118450870
Result.order = 134821045
Result.volume = 0.01
Result.price = 1.39016
Result.bid = 1.39016
Result.ask = 1.39043
Result.comment = Request executed 57.225 + 18.108 ms
Result.request_id = 4096
Result.retcode_external = 0

Highlighted - that's how long an entry appeared in order and transaction history after a successful OrderSend. A lot!

Log

NO      0       08:51:22.422    Trades  '5245006': instant sell 0.01 EURCAD at 1.39016, close #134821044 buy 0.01 EURCAD 1.39043 (deviation: 100)
MM      0       08:51:22.480    Trades  '5245006': accepted instant sell 0.01 EURCAD at 1.39016, close #134821044 buy 0.01 EURCAD 1.39043 (deviation: 100)
LH      0       08:51:22.480    Trades  '5245006': deal #118450870 sell 0.01 EURCAD at 1.39016 done (based on order #134821045)
EQ      0       08:51:22.480    Trades  '5245006': order #134821045 sell 0.01 / 0.01 EURCAD at 1.39016 done in 57.165 ms

And another case of the same script running.

Request/Response

Request.action = TRADE_ACTION_PENDING (5)
Request.magic = 0
Request.order = 0
Request.symbol = EURCZK
Request.volume = 0.01
Request.price = 27.043
Request.stoplimit = 0.0
Request.sl = 0.0
Request.tp = 0.0
Request.deviation = 100
Request.type = ORDER_TYPE_BUY_LIMIT (2)
Request.type_filling = ORDER_FILLING_RETURN (2)
Request.type_time = ORDER_TIME_GTC (0)
Request.expiration = 1970.01.01 00:00:00
Request.comment = Benchmark_Order
Request.position = 0
Request.position_by = 0
Result.retcode = 10009
Result.deal = 0
Result.order = 134821281
Result.volume = 0.01
Result.price = 0.0
Result.bid = 0.0
Result.ask = 0.0
Result.comment = Request executed 392.585 + 0.299 ms
Result.request_id = 4457
Result.retcode_external = 0

Log

HP      0       08:51:43.740    Trades  '5245006': buy limit 0.01 EURCZK at 27.04300
RE      0       08:51:44.133    Trades  '5245006': accepted buy limit 0.01 EURCZK at 27.04300
JS      0       08:51:44.133    Trades  '5245006': order #134821281 buy limit 0.01 / 0.01 EURCZK at market done in 392.533 ms

Ping ~54 ms.

 

It is impossible to copy anything from the Alert window.

Please add to the Alert window the possibility of selecting several lines, by right-clicking the menu "Copy" and "Go to Journal" - to show in the Expert Log the line corresponding to the alert.

 

Good afternoon.

I have faced with incorrect (in my opinion) behaviour of object pointers. It is relevant to both MT5 and MT4. Please clarify whether this is a bug or a feature. Here is the code:

class CBaseObject { };

class CDescObject:public CBaseObject { };

void OnStart()
  {
      CDescObject *obj1 = new CDescObject(), *obj2;
      CBaseObject *baseObj1 = obj1;
      
      obj2 = baseObj1;//Пока не грохнули объект - no problem
      delete(obj1);

      //Если добавить эти строки, ошибки в последней строке не будет
      //if(CheckPointer(baseObj1)==POINTER_INVALID)
         //baseObj1 = NULL;
      
      obj2 = obj1;//Указатели одного типа - no problem
      obj2 = baseObj1;//здесь ошибка "Invalid pointer access"
  }

I understand that pointers here are not the same as in C, but have a rich internal world. Still it would be more logical if the assignment in the last line passed peacefully. In my case, the check for POINTER_INVALID was after the assignment, so I did not understand at once why "Invalid pointer access" occurs, even though nobody makes any access.

P. S.: Just in case - Metatrader 5 build 1545, Win 7 SP1 x86

Reason: