[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 103

 
chief2000:

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.

 

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 ?????

 
VOLDEMAR:

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.
 
Figar0:

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 you make several orders close at the same price? ??????
 
VOLDEMAR:
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?
 
And how is it possible that this fora cycle does not take place at all?
 
Dimka-novitsek:
If you could take a look at it. What kind of an assigment is that?

for ( ; y>=0; y-- )
 

Wow, look at that! Thank you! I'll try that.

Yes!!

 
PapaYozh:

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?

Reason: