[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 580
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Damn, that's my problem. I wonder how to bypass it if I only need to delete the whole grid when I unload the robot... I can't even think of anything to do with it :(
A script can be loaded into deinit() via the library to chart:
with the delete all orders function.
P.S. With some or other cost and energy you can solve ANY exotic desires of a trader, but whether you need this "exotic" sometimes ... :)))
eh...why couldn't the condition for checking open orders be written like this:
if OrdersTotal() > 0
everything is clear and understandable... it would be...
I've been trying to figure out HOW to write this condition for an hour...
eh...why couldn't the condition for checking open orders be written like this:
if OrdersTotal() > 0
everything is clear and understandable... it would be...
I've been trying to figure out HOW to write this condition for an hour...
Why not? You can, but it will be triggered if there are open or pending orders on any symbol.
Why not? you can, but it will be triggered if there are open or pending orders on any instrument.
I wish it would work - I have one position and one tool.
But it doesn't work!
It says there's an error in the code.
to this
---------------------------
int start()
{
//----
if OrdersTotal()> 0
PlaySound ("alert.wav");
//----
return(0);
}
-----------------------------
gives up 8 errors!!!
How about this?
How about this?
:)))))))))))))))))))
gorgeous! Thank you
So deinit is called when I delete a robot from a chart - I can't track this condition any other way..... it's probably easier to write a separate script that deletes all the remaining pendants, there is no other way.
By the way, another thought on the subject:
I think I have solved the problem of deleting pending orders. I determine the amount of "necessary" (to be removed) orders in a separate function, called this function and then while with condition (Total>0), then the cycle of removing for(int i=Total-1;i<=0l; i--), again calculating"necessary" and counter of removing attempts with exit fromwhile when the given level is reached. This way everything is deleted.
An infinite loop may occur here in case one of the orders disappears after the moment of counting for any reason
Why it cannot be done? For example, create a global variable at terminal level, assign a value to it and check start and change value of this variable via service -->global variables before it is switched off.
And so ?
And may I ask, what are they trying to pull with this?
for(int i=0; i<OrdersTotal(); i++)
it looks like they're trying to count open positions using brute force method...
Good day!!! I can't find a nice solution to the situation. Here is a typical order setting. But if I give zero to my robot in parameters, i.e. no stops and takeprofits, nothing will work.
We can also set an if and enter an order with zeros for the second time, but it is a bit cumbersome.
And may I ask what they are trying to pull here?
for(int i=0; i<OrdersTotal(); i++)
it feels like it's trying to count open positions...
Well, it selects orders by specified parameters.
e.g. https://www. mql5.com/ru/forum/131859/page3#434221
Function NumberOfPositions().
This function returns the number of open positions at the moment. More accurate selection of counted positions is specified by external parameters: