Errors, bugs, questions - page 2279

 
Vladislav Andruschenko:

was just about to reply, but YOU answered your own question.

Thanks for the confirmation)

 

Good afternoon,

Could you make these function calls work in the strategy test, please? Thanks!

bool scaleFix=false;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
   ChartSetInteger(ChartID(),CHART_SCALEFIX,true);
   scaleFix=ChartGetInteger(ChartID(),CHART_SCALEFIX);
//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const int begin,
                const double &price[])
  {
//---
   if(rates_total!=prev_calculated)  
     {
      double max=iHigh(_Symbol,_Period,iHighest(_Symbol,_Period,MODE_HIGH,Period)); 
      double min=iLow (_Symbol,_Period, iLowest(_Symbol,_Period,MODE_LOW, Period));
      if(scaleFix && ChartSetDouble(ChartID(),CHART_FIXED_MAX,max))
         printf("Chart fixed max is %f, should be %f",ChartGetDouble(ChartID(),CHART_FIXED_MAX),max); 
      if(scaleFix && ChartSetDouble(ChartID(),CHART_FIXED_MIN,min))
         printf("Chart fixed min is %f, should be %f",ChartGetDouble(ChartID(),CHART_FIXED_MIN),min); 
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+
2018.09.06 12:54:55.757 2018.09.04 12:00:00   Chart fixed max is 1.171770, should be 1.162740
2018.09.06 12:54:55.758 2018.09.04 12:00:00   Chart fixed min is 1.158410, should be 1.155760
2018.09.06 12:54:55.765 2018.09.04 13:00:00   Chart fixed max is 1.171770, should be 1.162670
2018.09.06 12:54:55.765 2018.09.04 13:00:00   Chart fixed min is 1.158410, should be 1.155590
2018.09.06 12:54:55.772 2018.09.04 14:00:00   Chart fixed max is 1.171770, should be 1.162280
2018.09.06 12:54:55.772 2018.09.04 14:00:00   Chart fixed min is 1.158410, should be 1.154940
2018.09.06 12:54:55.781 2018.09.04 15:00:00   Chart fixed max is 1.171770, should be 1.162070
2018.09.06 12:54:55.781 2018.09.04 15:00:00   Chart fixed min is 1.158410, should be 1.154940
2018.09.06 12:54:55.789 2018.09.04 16:00:00   Chart fixed max is 1.171770, should be 1.162020
2018.09.06 12:54:55.789 2018.09.04 16:00:00   Chart fixed min is 1.158410, should be 1.154940
2018.09.06 12:54:55.799 2018.09.04 17:00:00   Chart fixed max is 1.171770, should be 1.161980
2018.09.06 12:54:55.800 2018.09.04 17:00:00   Chart fixed min is 1.158410, should be 1.153890

 
For some reason all market orders are executed longer than a second on InstaForex-Server
2018.09.06 14:08:22.754 Trades  '9424479': instant buy 0.01 CADCHF at 0.7360 (deviation: 1000)
2018.09.06 14:08:22.936 Trades  '9424479': accepted instant buy 0.01 CADCHF at 0.7360 (deviation: 1000)
2018.09.06 14:08:23.944 Trades  '9424479': deal #9539619 buy 0.01 CADCHF at 0.7360 done (based on order #10514041)
2018.09.06 14:08:23.944 Trades  '9424479': order #10514041 buy 0.01 / 0.01 CADCHF at 0.7360 done in 1195.200 ms
2018.09.06 14:08:23.944 Trades  '9424479': modify #10514041 buy 0.01 CADCHF sl: 0.0000, tp: 0.0000 -> sl: 0.0000, tp: 0.8350
2018.09.06 14:08:24.134 Trades  '9424479': accepted modify #10514041 buy 0.01 CADCHF sl: 0.0000, tp: 0.0000 -> sl: 0.0000, tp: 0.8350
2018.09.06 14:08:24.134 Trades  '9424479': modify #10514041 buy 0.01 CADCHF -> sl: 0.0000, tp: 0.8350 done in 184.895 ms
2018.09.06 14:08:24.134 Trades  '9424479': instant sell 0.01 CADCHF at 0.7350, close #10514041 buy 0.01 CADCHF 0.7360 (deviation: 1000)
2018.09.06 14:08:24.314 Trades  '9424479': accepted instant sell 0.01 CADCHF at 0.7350, close #10514041 buy 0.01 CADCHF 0.7360 (deviation: 1000)
2018.09.06 14:08:25.323 Trades  '9424479': deal #9539620 sell 0.01 CADCHF at 0.7350 done (based on order #10514042)
2018.09.06 14:08:25.323 Trades  '9424479': order #10514042 sell 0.01 / 0.01 CADCHF at 0.7350 done in 1193.896 ms
2018.09.06 14:08:25.323 Trades  '9424479': buy limit 0.01 CADCHF at 0.6360
2018.09.06 14:08:25.509 Trades  '9424479': accepted buy limit 0.01 CADCHF at 0.6360
2018.09.06 14:08:25.510 Trades  '9424479': order #10514043 buy limit 0.01 / 0.01 CADCHF at market done in 181.861 ms
2018.09.06 14:08:25.510 Trades  '9424479': cancel order #10514043 buy limit 0.01 CADCHF at 0.6360
2018.09.06 14:08:25.691 Trades  '9424479': accepted cancel order #10514043 buy 0.00  at market
2018.09.06 14:08:25.691 Trades  '9424479': cancel #10514043 buy limit 0.01 CADCHF at market done in 181.474 ms
2018.09.06 14:08:25.692 Trades  '9424479': buy stop 0.01 CADCHF at 0.8360
2018.09.06 14:08:25.878 Trades  '9424479': accepted buy stop 0.01 CADCHF at 0.8360
2018.09.06 14:08:25.882 Trades  '9424479': order #10514044 buy stop 0.01 / 0.01 CADCHF at market done in 190.823 ms
2018.09.06 14:08:25.883 Trades  '9424479': cancel order #10514044 buy stop 0.01 CADCHF at 0.8360
2018.09.06 14:08:26.062 Trades  '9424479': accepted cancel order #10514044 buy stop 0.01 CADCHF at 0.8360
2018.09.06 14:08:26.062 Trades  '9424479': cancel #10514044 buy stop 0.01 CADCHF at market done in 183.056 ms

At the same time, the pending ones are close to the ping. What can be the reason of this skew on the demo?

 

When I updated the product in the marketplace I filled in the English/Russian pages with a description of what has changed and published the new version, but nothing from my description has appeared in the "what's new" section of my product.

I can't even edit this description as there is no document against the latest version at all.

where is the description of the changes ?

 
Tetyana Shcherba:

When I updated the product in the marketplace I filled in the English/Russian pages with a description of what has changed and published the new version, but nothing from my description has appeared in the "what's new" section of my product.

Even no possibility to edit this description as there is no document against last version.


Same thing. I thought it was a glitch.

 

After selecting the menu item "Run single test"

there is nothing to indicate that an appropriate single test is in progress and has been run. It is a good idea to switch to the "Graph" tab if the single run is successful, or to the "Log" tab if it fails.


It may seem like a minor cosmetic niggle.

 
Nikolai Semko:

When I need to fill part of a large array with a single Z-value, I use a construction:


Many people will say - why is it so complicated, it can be simpler:

But for some unknown reason, the first variant using an intermediate array performs much faster than the second one

I already wrote on this question to SD a couple of years ago. I got a reply saying that I had found and fixed the problem and it would be ok in the next build.

But the problem persists.

I've got the same test in MT4:

You have encountered a peculiarity of memory operation in Windows

Right after ArrayResize add

ArrayFill(arr,0,size,0);
This initiates the actual allocation of physical memory so that this does not happen during the test.


Here are the results from my computer

2018.09.06 16:25:44.238 TestArrayFill (EURUSD,H1)       Время заполнения через ArrayFill = 94
2018.09.06 16:25:44.238 TestArrayFill (EURUSD,H1)       Время заполнения через ArrayInitialize + ArrayCopy = 147
 
Ilyas:

You have run into a memory peculiarity in Windows

Immediately after ArrayResize add

This initiates the actual allocation of physical memory so that this does not happen during the test.

What then does the ME built-in profiler measure on ArrayResize?

 
fxsaber:

What then does the ME built-in profiler measure on ArrayResize?

It measures the running time of ArrayResize function.

The TestArrayFill test code is built in such a way that "cold" memory is allocated for the array, with no chance to get "hot" memory.


To be clear, ArrayResize allocates virtual memory (or process memory), but there is no guarantee that virtual memory will immediately get (or already have) physical pages.

Windows, will allocate physical memory as needed, the first time the virtual memory page is accessed.
The page is 4KB in size, i.e. to "warm up", not all elements could be zeroed via ArrayFill (as I wrote) but only every 4096 / sizeof(array element type) starting from zero.


Since zeroing of variables is guaranteed in MQL4, ArrayResize in MT4 runs through the array zeroing it, so there is no "cold" memory effect there.

 
Ilyas:

Subtlety, however. Thank you! The Documentation is probably long overdue for a "Subtlety" spoiler.

Reason: