Errors, bugs, questions - page 1820

 
Maksym Mudrakov:

input string Somevalue = "Maxim";
...
void OnTick(){
   Comment(Somevalue);
}


The MQL5 program prints the comment:

"1487811600"

Why does it happen? How to output the correct string value?

Look for an error. Or post full reproducible code. Check code

//+------------------------------------------------------------------+
//|                                                        Test.mql5 |
//|                                      Copyright 2017, CompanyName |
//|                                       http://www.companyname.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2017, Vladimir Karputov"
#property link      "http://wmua.ru/slesar/"
#property version   "1.00"
#property script_show_inputs
//--- input parameters
input string Somevalue="Maxim";
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
   Comment(Somevalue);
  }
//+------------------------------------------------------------------+


does not reproduce the error.

I also recommend that you replace Comment with Print - there is a chance that another program will trivially overwrite the comment on the chart.

Files:
test.mq5  2 kb
 
restarted the EA on a different chart, it's working properly. That's weird. But thanks for the help.
 
Maksym Mudrakov:
restarted the EA on a different chart, it worked correctly. That's weird. But thanks for the help.
Especially you have a variable input - a variable of this type cannot be reassigned in the code - this leaves the option of a second program (EA or indicator) that secretly messes around and outputs its comment.
 
fxsaber:

Who understands the answer, please explain. I still don't understand why OrderSend is considered normal

As far as I understand, OrderSend only waits until the order is queued for processing on the server, but not until the result of processing.
 
Test agents keep dropping out during optimisation. Local agent cannot connect to 127.0.0.1:3000 and aborts testing.
 
Комбинатор:
As far as I understand, OrderSend only waits until the order is queued for processing on the server, but not until the result of processing.
This is where it is unclear.
 
OrderSend returns true, with the following line appearing in the log
2017.02.23 14:18:58.013 Trades  '5245006': failed buy limit 0.01 USDCNH at 6.85199 [Request rejected due to absence of network connection]
 

There is an OrderSend-bug reproducing script in the application. It runs through the Market Watch and opens BuyLimit at every symbol. After that it immediately tries to modify it (sets TP) and then delete it. If modification or deletion of the order is impossible, the script stops with a corresponding message.

Everything is done via synchronous OrderSend. And almost immediately we come across a situation where, after a successful OrderSend (setting BuyLimit), nothing can be done (modify or delete) with the pending order.

Operating result

2017.02.23 14:24:49.828 OrderSend-StartedBug (Si-3.17,M1)       ModifyError GetLastError() = 4756 EnumToString((ENUM_ORDER_STATE)OrderGetInteger(ORDER_STATE)) = ORDER_STATE_STARTED
2017.02.23 14:24:49.828 OrderSend-StartedBug (Si-3.17,M1)       DeleteError GetLastError() = 4756 EnumToString((ENUM_ORDER_STATE)OrderGetInteger(ORDER_STATE)) = ORDER_STATE_STARTED

Dear developers, is this a bug OrderSend or not?


SZZ, however, OrderSend at TRADE_ACTION_DEAL doesn't terminate as long as the corresponding order has STARTED status.

All the fun of the script can be experienced slowly on the FXOpen-MT5 server.

Files:
 
fxsaber:

when aposition is successfullyopened by a market order, a zero Result.deal is obtained every time?

From the SD
It is not guaranteed that the Result deal ticket will be filled. Whether or not it is filled depends on the instrument's execution mode and the settings of the particular server.
Who has set up a non-zero Result.deal - take action.
 
OpenCL not found. Error code=5101
Error in OpenCL initialization. Error code=5101
The integrated graphics on the CPU do not support OpenCL? It's not like the GPU was required for OpenCL either.