Forex



Go Back   Forex Trading > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 03-09-2007, 08:01 PM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Breakout-System - Cancel Order

Hi,
I need some help.
I designed a simple Breakoutsystem, which generates two orders like the following:

Ticket = OrderSend(Symbol(),OP_BUYSTOP,Lots,kauf_stopp_prei s,3,kauf_stopp_preis-anfangs_stopp,kauf_stopp_preis +TakeProfit*Point,NULL,Magic1,TradeTime+EndHour*60 *60,Blue); //TradeTime+EndHour*60*60

Ticket = OrderSend(Symbol(),OP_SELLSTOP,Lots,verkauf_stopp_ preis,3,verkauf_stopp_preis+anfangs_stopp,verkauf_ stopp_preis-TakeProfit*Point,NULL,Magic2,TradeTime+EndHour*60* 60,Red); //TradeTime+EndHour*60*60

So there are two order to get stopped into the market.
If one of them gets executet, the other order must bedeleted.
Can I delete an order by using the MagicNumber?
If that works, can somebody tell me the code???

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #2 (permalink)  
Old 03-09-2007, 08:51 PM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
Here you can test simple version of it.
EURUSD only.
Initial-Stop 45...65 - optimum 60
TakeProfit 20 ... 35 - optimum 30
TF daily only.
Attached Files
File Type: ex4 ORBsV.ex4 (7.3 KB, 49 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #3 (permalink)  
Old 03-10-2007, 02:15 PM
jkancil's Avatar
Junior Member
 
Join Date: Sep 2006
Location: Indonesia
Posts: 8
jkancil is on a distinguished road
int mgc=87697;
int total=OrdersTotal();
bool cancelorder=false;
for(cnt=0;cnt<total;cnt++) {
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if((OrderMagicNumber()==mgc) && (OrderType()==OP_BUY || OrderType()==OP_SELL)) cancelorder=true;
}
if(cancelorder) {
for(cnt=0;cnt<total;cnt++) {
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if((OrderMagicNumber()==mgc) && (OrderType()==OP_BUYSTOP || OrderType()==OP_SELLSTOP)) OrderDelete(OrderTicket());
}
}

Last edited by jkancil; 03-10-2007 at 02:18 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #4 (permalink)  
Old 03-10-2007, 07:35 PM
Member
 
Join Date: Feb 2007
Posts: 30
justize is on a distinguished road
THANKS!!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
breakout system ligerny Suggestions for Trading Systems 3 04-25-2008 10:14 AM
Breakout System daet Suggestions for Trading Systems 3 02-22-2007 01:11 PM


All times are GMT. The time now is 11:18 PM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.