Errors, bugs, questions - page 1846

 
Konstantin:

Thanks for the example, but I wouldn't want to create a complex type object just because of one array, it all looks like excessive code))


What is this childish nonsense about complex types? This is elementary nonsense.
You're talking about C++, but have you ever looked into STL library? (it's a hell of a thing there).

The problem is solved in the most acceptable way, which can be found in a reasonable time.
Then if necessary, refactor as much as you like but it will hardly come to this.

Using a wrapper class for some library, and sometimes a standard functionality, is roughly a variation on the "facade" patter.

 

MQL has its own standard library with containers.
Used it when I was freelancing, about 2 years ago. Not very fast and not very handy, in my personal opinion.

But now they added adequate Templates + Function pointers to MQL functionality.
I have doubts that developers allocated resources to tweak the standard container library to fit the new features.
But still the standard library is better than most self-written crutches.

 
Sergey Dzyublik:


What is this childish nonsense about complex types? It's elementary.
Have you ever looked into the STL library? (that's where the devil breaks a leg).

The problem is solved in the most acceptable way, which can be found in a reasonable time.
Then if necessary, refactor as much as you like but it will hardly come to this.

Using a wrapper class for some library, and sometimes a standard functionality, is roughly a variation on the "facade" patter.


There are moments where creating a wrapper class for the sake of getting an array from a method issuperfluous, I don't mind getting an array as a buffer, but it would be more common to get it as in C++ by pointer, but since it's not possible, that doesn't mean you need to do overhead ))

 

I ask you to introduce an average MOEX broker commission for exchange symbols on Metaquotes-Demo.

At the moment there is no commission and you get graals on the demo and the tester.

 
fxsaber:

I ask you to introduce an average MOEX broker commission for exchange symbols on Metaquotes-Demo.

At the moment there is no commission and you get graals on demo and tester.


In the demo for exchange instruments, the inclusion of commission will not help you get rid of the grail is generally there commission depends on the rate, well, let's assume that it, as in the tariff plan universal, about 0.5 ticks, ie for a round you gave commis= 1tica.

And this 1 tick commission will not make a difference, taking into account the fact that on the demo trades are opened and closed by Last, ie without the spread. open and close the deal - get 0!

The difference between you and the tester is also different.

 
kaus_bonus:


In the demo for exchange instruments, the inclusion of a commission will not help you get rid of the grail - in general, there commission depends on the rate, well, let's assume that it is, as in the tariff universal, about 0.5 ticks, ie for a round you gave commission = 1tic.

I do not understand about the ticks. The amount of commission is always a certain percentage. I have a grail on limit orders. There, hopefully, flippers are not affected.

For instance, if you get a commission of 1 tick it won't make any difference if you open and close transactions on demo, i.e. you don't consider the spread.

If so, it's not a bug.

If so, it's not a bug in the software, but in the heads.

 
Looks like the tester needs to be checked for correctness.
 
fxsaber:
It looks like the tester should be checked for correctness.

Forum on trading, automated trading systems and trading strategy testing

List of changes in MetaTrader 5 Client Terminal builds

MetaQuotes Software Corp., 2016.09.14 16:24

New MetaTrader 5 build 1430: Updated Exposure tab

  1. Tester: Removed slippage in execution of Buy Limit and Sell Limit orders when testing on exchange instruments.
Expert Advisor for the tester (Metaquotes-Demo)
#include <MT4Orders.mqh>

// Скольжение лимитника на RTS-6.17
void OnTick()
{
  MqlTick Tick;    
  SymbolInfoTick(_Symbol, Tick);

// 2017.04.06 10:00:00                [time]   [bid]   [ask]  [last] [volume]    [time_msc] [flags]  
// 2017.04.06 10:00:00   2017.04.06 10:00:00  114200  114260  114200        2 1491472800335      56  
  if (Tick.time_msc == 1491472800335)
    OrderSend(_Symbol, OP_BUYLIMIT, 1, 114250, 0, 0, 0);
}

Result

2017.04.07 18:18:45.366 RTS-6.17 : real ticks begin from 2017.04.06 00:00:00
2017.04.07 18:18:45.778 2017.04.06 10:00:00   buy limit 1.00 RTS-6.17 at 114250 (114200 / 114260 / 114200)
2017.04.07 18:18:46.051 2017.04.06 10:00:00   order [#2  buy limit 1.00 RTS-6.17 at 114250] triggered
2017.04.07 18:18:46.051 2017.04.06 10:00:00   deal #2  buy 1.00 RTS-6.17 at 114240 done (based on order #2)
2017.04.07 18:18:46.051 2017.04.06 10:00:00   deal performed [#2  buy 1.00 RTS-6.17 at 114240]
2017.04.07 18:18:46.051 2017.04.06 10:00:00   order performed buy 1.00 at 114240 [#2  buy limit 1.00 RTS-6.17 at 114250]

Limit slippage on exchange symbol - BAG!

 
On the Metaquotes-Demo demo account, limit orders on exchange orders also slide. BAG!
 
A100:

More than 30 minutes have passed, and there is still no OnDeinit->M5 call

And now let's change the Expert Advisor's code (change the order slightly) ...

Result:

2017.02.06 01:31:45.002 OnInit->M5
2017.02.06 01:31:48.340 OnDeinit->M5:1 Called immediately and without delay!
2017.02.06 01:31:48.409 OnInit->M15


It was noticed that in the logs it misses lines

OnDeinit - may have worked but with a large output stream it skips the output

I wrote a walkthrough that contains 3 lines Print("1"); Print("2"); Print("3");

I was getting skipping of one and the other in the output

Reason: