[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 233

 
ОCould you please explain why this code sometimes freezes in one place and you have to restart the terminal to resume it?
int ticket,err;
         Alert("nachalo");
         ticket = OrderSend(Symbol (), OP_BUY, 1, Ask, 10,0,0, "dsgdsf", 0, 0, CLR_NONE);
         err = GetLastError();
         Alert (err);
         Alert("konec");
         OrderClose (ticket,1,Bid,5,CLR_NONE);
         Alert ("zakrito");

 
doon:
Can you please explain why this code sometimes freezes in one place and you have to restart the terminal to resume it?

on which line does it freeze?
 
sergeev:
on which line does it freeze?


Thank you so much for answering!

It freezes when you have to open or close an order.

 
doon:


It hangs when you need to open or close an order.

Try it on a different terminal.
 
sergeev:
test on a different terminal.

Can you try through yours?
 
doon:
Can you try through yours?
This is not tennis, Comrade Sergeev. This is squash.
 

Victor, what do you think the problem is?

 
granit77:
This is no longer tennis, Comrade Sergeev. This is squash.
These are bourgeois games, they're alien to my proletarian ideals!
 
doon:

Victor, what do you think the problem is?


The problem is the unwillingness, if only for fun, to familiarise yourself with this and that before you speak on a forum with it:

"...The thing is, I need to check if the order was checked with isCloseLastPosByStop().Magik cannot be used, because it will run out sooner or later (2147483647), and you cannot erase or modify it. Can you tell me how to implement this...".

 
doon:

Can you try through yours?

Tried it. It didn't freeze.


gave error 129 on OrderClose.

Put RefreshRates in front of it.

Closed without error.

Reason: