MQL4 - automated forex trading   /  

Forum

Delete Pending

Back to topics list To post a new topic, please log in or register

avatar
5
Trampoukos 2006.07.26 22:52 
I copied the script (prepared by metaquotes) for deleting pending orders into an expert advisor.
I run the expert advisor but nothing happens. No pending orders are deleted.
Can somebody help?
article

Organizer’s Note

The first annual Automated Trading Championship 2006 comes to the end. Now we can give some preliminary results of the Championship. A great amount of work has been done within the last 6 months and the results of the competition are more than impressive. 258 developers from all over the world have taken part in it. This is an unique and very important event. No such events have taken place yet.


avatar
Moderator
5089
stringo 2006.07.27 10:21 
What errors output to experts log?

Tools - Options - Experts tab - check Allow Live trading

avatar
5
Trampoukos 2006.07.27 10:39 
stringo wrote:
What errors output to experts log?

Tools - Options - Experts tab - check Allow Live trading


It worked after I checked "Allow Live Trading".

Thank you.


avatar
5
Trampoukos 2006.07.27 11:07 

Hello stringo.

I noticed that delete pending script removes orders one at a time per up or down tick.

Is it possible to change it so it removes all pending orders at once regardless of tick movement?

I also copied "Send-pending" script into an EA and run it. I adds a pending order every time price ticks up or down. I am actually looking into placing 2 orders at a time - one to buy / one to sell - without the need of tick change. Please advise.


avatar
Moderator
5089
stringo 2006.07.27 11:45 

avatar
5
Trampoukos 2006.07.27 12:34 
I copied the code written by you:

on 'How to place (and close correctly) multiple orders in an EA' - stringo 2006.04.14 12:03

and run it but nothing happens.

You have to excuse me but I don't understand waht the code is all about.

What I am looking actually for are two little expert advisors that place / delete pending orders independently from a chart:

Expert advisor1 : To place a pending stop- buy and a pending stop-sell simultaneously at predefined distances from market prices.
Expert advisor 2: To remove above orders simultaneously irrespectively of market moves.


avatar
Moderator
5089
stringo 2006.07.27 13:49 
Copy and what? Why?
         if(OrderType()==OP_SELL) { flag=true; OrderClose(OrderTicket(),OrderLots(),Ask,3); }
         if(OrderType()==OP_BUY)  { flag=true; OrderClose(OrderTicket(),OrderLots(),Bid,3); }

There are closed short or long positions. Not pending orders

There is sample code only. You need to change it in accordance with your taste
Back to topics list  

To add comments, please log in or register