Learning and writing together in MQL5 - page 19

 
Interesting:

(Yes and the request, sorry little justified and backed up by convincing arguments).

PS

Although, I may have missed something and the developers decide that it is quite reasonable.

I repeat: there was no request to the developers :) There were no requirements or even requests - in accordance with the theme of the branch. As the saying goes: "sailed, we know" :) The reason I explained here:"If someone raised such a question half a year ago, we could still hope for a relatively fast appearance of the feature, but waiting for the next year is easier to introduce a variable for the date. Although it will not be entirely accurate, but still.

As always, thank you all for your thoughts! This time you've convinced me I'm right :)

 

stringo:

Yedelkin:

Question. The description of switch(expression){...} says that "the switch operator's expression must be of integer type". I've seen the description of this operator with expressions of other types on the Internet. Will we extend use of the switch operator by adding expressions of the string type?

No, unfortunately, it won't. For string types only if ... else if ... else .

Using integer types in switch will speed up the switch operator several times as much as if

Question. Is there (by analogy with switch) any speedup as compared to if of the"conditional operator ?:"?

 
Yedelkin:

Question. Is there (similar to switch) any acceleration compared to if for"conditional operator ?:" ?

No. The conditional operator has no speedup compared to if. It's just easier to write.
 
stringo:
No. The conditional operator has no acceleration compared to if. It's just easier to write.
Oops, got it.
 

ORDER_TYPE_BUY_STOP_LIMIT

When the order price is reached , a Buy Limit pending order is placed at StopLimit price

It appears that the processing of this order, including setting a pending Buy Limit order, is done on the server side. I have some questions to which I couldn't find any answers in the reference:

1) DoesORDER_TYPE_BUY_STOP_LIMIT itself go into historywhen the order price is reached and the pending Buy Limit order is placed?

2) Is the ticket forORDER_TYPE_BUY_STOP_LIMIT order inherited by anew pending order placed on the server side?

3) Is any Trade event generated when a server-side pending Buy Limit order is placed?

4) How (by what rule) is the expiration time, order lifetime and comment assigned to a new pending Buy Limit order on the server side?

And in general, is there a smart way to quickly catch the placing of orders on the server side? Has this been mentioned anywhere?

 
Maybe Old_Time[0] was not initialized correctly in the first place. It's not clear from the code what's there. Take a look here, maybe you can use this solution.
 
AUser:
...
CopyTime(_Symbol,_Period,0,1,Old_Time);
Try to insert this line before the closing OnTick() bracket.
 
The thread is not tied to the kernel at all.

Yedelkin:

...The Sleep() function doesn't slow down the thread itself

It slows down but it frees up CPU resources for other threads.

That's why you shouldn't use Sleep in indices - one thread can calculate many indices and Sleep in one will make all the others idle as well.

________

Damn, I'm too late :) next time I'll look more carefully at the dates.

 
TheXpert:
The thread is not attached to the kernel at all.

It slows down but frees up CPU resources for other threads.

That's why Sleep should not be used in indulators - one thread can compute a large number of indulators and Sleep in one thread will cause all the others to be idle as well.

________

Damn, I'm too late:) next time I'll look more carefully at the dates.

About 'late'. - That's right! The key phrase here is "freeing up CPU resources for other threads". That's exactly what I was trying to formulate in the question.

 
Yedelkin:

ORDER_TYPE_BUY_STOP_LIMIT

When the order price is reached , a Buy Limit pending order is placed at StopLimit price

It appears that the processing of this order, including setting a pending Buy Limit order, is done on the server side. I have several questions to which I did not find answers in the reference materials: ...

Judging by the lack of responses to the question, people here are post-MT4 and have not yet moved to stop-limit orders :)

And, speaking without lyrics, I found materials on the Internet stating that a STOP LIMIT order does not create a new pending order but simply transforms into a limit order when some condition is fulfilled:

- a conditional order, which transforms into a limit order when the contract price reaches a certain level;

- an order to execute a trade at a price worse than the current market price, but not worse than the price specified in the limit portion of the order. Unlike a stop order, when the market price reaches the price specified in the order, this order is activated as a limit order. In this case the execution price of a stop limit order can be either equal to the order price or better than it;

- a client order that becomes a limit order once the market price reaches the set level (stop price);

etc.

This approach answers most of my questions. But if this is indeed the case, then the phrase in the Handbook about "placing a limit order" seems incorrect and specifically confusing.