Errors, bugs, questions - page 2766

 
Alexey Viktorov:

The second question is: How do I set the day, in what format? Or it does not matter what time of day will be set?

In MqlTradeRequest::expiration zero time should be set

 
A100:

via ORDER_TIME_SPECIFIED and MqlTradeRequest::expiration

You should have read the documentation a long time ago.

Once again! I am not interested in ORDER_TIME_SPECIFIED type, I am interested in

ORDER_TIME_SPECIFIED_DAY

The order will be valid until 23:59:59 of the specified date. If that time does not fall on a trade session, the expiry will be at the nearest trade time.

If I trade on TF W1, I want to set expiry time to Friday. Of course, we can calculate the time to Friday, I can not only read, but also count to 1000. But my question is the one I am interested in. I also want to know the format for specifying the DAY. Or it's not important to specify the exact time of day, as long as it falls on the desired day? What will happen to your order if you close your trade on Friday at 21:00, for example, and the order is opened on Monday? Which should be the first expiry or activation.

 
A100:

Zero time should be set.

Thank you for deleting the message I took so long to reply to.

Are you sure about that? I'd do it as a precaution. But I'd like to know for sure.

 
Alexey Viktorov:

Thank you for deleting the message I took so long to reply to.

Are you sure about that? I would do it as a precaution, of course. But I want to be sure.

You have to manually place pending order with date (without time) and programmatically read its values of type_time and expiration.

I did not invent it myself, I did it that way.

 
A100:

Manually set a pending order to expire on a specific date (no time) and programmatically read its type_time and expiration values

I didn't come up with this myself, I did.

Thanks for the tip. I don't trade hands at all and didn't even think it could be checked that way. I have done it in a slightly different way. Here's the code.

  trade.OrderOpen(_Symbol, ORDER_TYPE_SELL_STOP, 0.1, 0, 1.24000, 0.0, 0.0, ORDER_TIME_SPECIFIED_DAY, D'2020.06.03 23:41:02');

and this order.


It turns out that time is not taken into account.

But we still have the second question. Which will be executed first, the expiration or the order activation...

The only thing I fear is different behaviour in tester and real or demo. And even in the demo, you can wait until you're stupefied...
 
Alexey Viktorov:

But without clarification there is a second question. What will execute first or activate the order...

It depends on the broker and the human factor - how they organise things there. I noticed that Friday's day order remained pending until Monday's trading session (even during quoting session it was still pending).

One night I called the bank at the dealing room and asked why my order was not executed? They said: We do not see it! How do not you see it? Here it is in my MetaTrader - I placed it a few hours ago and the price has already been there an hour ago. In the morning, when a new account manager comes, he will download data from MetaTrader and we will see everything.

So, your orders below the threshold are of no interest to anyone (and above the threshold they trade in the price-on-demand mode) because they are not output anywhere and the dealer receives an aggregate position at best

 

The terminal was upgraded to build 2470 in the open

And no problem, the robot started to show worse results in the tester than it was before the update.

I started to look into it and this is what I saw.

When I ran the robot through the history in normal mode, at the end it called a chart showing all my trades and I scrolled down and was surprised at what was going on there

As you can see from the chart, in a netting account, futures oil is opening a few positions, although the robot doesn't have any averaging, scaling etc. There is only one position stop and take, after the opening of the position the entry algorithm is disabled.


But, I took and did the same test, but only on visual testing, doing visual testing, everything is good there


Please tell me if it is a bug update, in general, all sprinkled after the update, take and stop was previously set on the price Ask and bid separate method after the market will appear position, now they have become stuck and move together with the prices, I had to redo and put the price and stop on the opening price of a position and add the spread to the indent.

What to do where to dig

 
Konstantin Seredkin:

The terminal was upgraded to build 2470 in the open

And here's the problem, the robot started to show worse results in the tester than it was before the update.

...

What to do

Dig to check "Does the Expert Advisor run in the test?

 
Artyom Trishkin:

Dig towards checking "Is the right EA running the test?

It is the only one in the terminal, there are no more, even the standard ones have been removed

 
Konstantin Seredkin:

It is the only one in the terminal, there are no more, even the standard ones have been removed

Judging by the behaviour you described, it is a different EA with a completely different algorithm.