This is exactly what I'm applying now, but "it turns out" that there are shortened sessions and this solution slips into the next one, but not at the very beginning of it, but a bit further on. Maybe there is some other way?
Thank you!
Some brokers have trades that start later on Monday and/or end earlier on Friday. Also, you have to look at the server time (how much it is shifted from Greenwich Mean Time - GMT). But usually (if not always) all trading starts at 00:00 server time on Monday.
Also, problems can arise when you try to transform Friday's bar to Monday's bar using a simple formula:
iTime(NULL,PERIOD_D1,0)+24*60*60
To solve these problems, you just need to derive some regularity from your broker and get the time conversion formulas from it.
And please do not confuse the concept of trading session and the concept of "Day1" timeframe.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
This is exactly what I'm applying now, but "it turns out" that there are shortened sessions and this solution slips into the next one, but not at the very beginning of it, but a bit further on. Maybe there is some other way?
Thank you!
Some brokers have trades that start later on Monday and/or end earlier on Friday. Also, you have to look at the server time (how much it is shifted from Greenwich Mean Time - GMT). But usually (if not always) all trading starts at 00:00 server time on Monday.
Also, problems can arise when you try to transform Friday's bar to Monday's bar using a simple formula:
To solve these problems, you just need to derive some regularity from your broker and get the time conversion formulas from it.
And please do not confuse the concept of trading session and the concept of "Day1" timeframe.
If I use a loop to close 8 orders, when several quotes come, the closing price of 8 orders may be different...
If I use a close method like
if (ordertype()==op_Byu)
{
orderclose (Buy............madgic1);
orderclose (Buy............madgic2);
orderclose (Buy............madgic3);
orderclose (Buy............madgic4);
orderclose (Buy............madgic5);
orderclose (Buy............madgic6);
...........
}
With this close, the request will be sent to all orders at the same time ????? And at the same price ?????
If I use a loop to close 8 orders, when several quotes come, the closing price of 8 orders may be different...
If this is the case, a request will be sent to all orders simultaneously ????? And at the same price ?????
No, the trade flow will be occupied by the first operation. whether it is a "loop" or not, the sequence of operations will be the same.
No, the trade flow will be occupied by the first operation. whether it is a "cycle" or not, the sequence of operations will be the same.
How can I close several orders at the same price? ??????
open a counter for the total volume of orders to be closed, and then close it via OrderCloseBy()
If you could take a look at it. What kind of an assigment is that?
Wow, look at that! Thank you! I'll try that.
Yes!!
open a counter by the total volume of orders to be closed, and then close it via OrderCloseBy()
That's an interesting idea. I wouldn't come to it any time soon! Thanks! :D
Except that I've loaded myself up a bit. There is no way for the floating spread to affect this, is there?