Forex



Go Back   Forex Trading > Discussion Areas > 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 08-07-2006, 03:35 PM
Junior Member
 
Join Date: Jun 2006
Posts: 15
rbowles is on a distinguished road
Trade muliple currency Pairs

Most of the sample EA that come with metatrader have some code in it that do not allow more than one order at a time. What code would I use to allow more than one order if it is a different currency pair. For example if usdcad has an open position I do not want any more open. However I do want euros to trade if I signal is generated.

Thanks in advance

Randy
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 08-07-2006, 03:58 PM
Administrator
 
Join Date: Sep 2005
Posts: 20,058
Blog Entries: 241
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by rbowles
Most of the sample EA that come with metatrader have some code in it that do not allow more than one order at a time. What code would I use to allow more than one order if it is a different currency pair. For example if usdcad has an open position I do not want any more open. However I do want euros to trade if I signal is generated.

Thanks in advance

Randy
Most EAs are trading like this. And most EA are having magic number option which is doing it. And there is the other code which is protecting trading many EAs in one metatrader but I don't remember.
Check EAs (there are a lot on this forum), select one with Magic number option (in settings) and do the same with yours.
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 08-07-2006, 05:28 PM
Junior Member
 
Join Date: Jun 2006
Posts: 15
rbowles is on a distinguished road
Quote:
Originally Posted by newdigital
Most EAs are trading like this. And most EA are having magic number option which is doing it. And there is the other code which is protecting trading many EAs in one metatrader but I don't remember.
Check EAs (there are a lot on this forum), select one with Magic number option (in settings) and do the same with yours.
I did find some with the magicnumber. Can somebody give me a brief description of what that is and how it functions. Once I have that I think I can work with it.

Thanks,

Randy
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 08-07-2006, 06:12 PM
Administrator
 
Join Date: Sep 2005
Posts: 20,058
Blog Entries: 241
newdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud ofnewdigital has much to be proud of
Quote:
Originally Posted by rbowles
I did find some with the magicnumber. Can somebody give me a brief description of what that is and how it functions. Once I have that I think I can work with it.

Thanks,

Randy
My explanation is not good as I am not a coder.

But for example:

Code:
//Sell
   if (Order == SIGNAL_SELL ....

if(Total < 1) 
.....

Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
So every ticket it having magic number (some number let's say). Means that all the orders are opened with this number.
And then EA is trying to find the orders with the same numbers to modify, close with sl or with tp.

Code:
bool ExistPositions() {
	for (int i=0; i<OrdersTotal(); i++) {
		if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
			if (OrderSymbol()==Symbol() && OrderMagicNumber()==MAGIC) {
				return(True);
I could not find EA without magic number in my computer. Even very old EAs without magic numbers as the settings are having it inside the code:

{
OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-sl*Point,Ask+tp*Point,"qq-buy60",11603575,0,Blue);
}
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
  #5 (permalink)  
Old 08-07-2006, 06:15 PM
Junior Member
 
Join Date: Jun 2006
Posts: 15
rbowles is on a distinguished road
I think I understand it now. I am a programmer and I just needed some time to digest it. I also found this link that might help others. http://www.metatrader.info/node/115
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
  #6 (permalink)  
Old 08-13-2006, 06:51 AM
Member
 
Join Date: Dec 2005
Posts: 58
techinvest is on a distinguished road
Quote:
Originally Posted by rbowles
I think I understand it now. I am a programmer and I just needed some time to digest it. I also found this link that might help others. http://www.metatrader.info/node/115
I use a similar function in which I count the # of trades from within the expert and write it to a global variable. Then you simply have to have the EA's running on different charts check that global variable for the # of open trades. Easy as pie
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
What are best medium volatility ranging pairs to trade? shibeng Expert Advisors - Metatrader 4 5 03-02-2009 10:47 PM
How to display two currency pairs on one chart? Benna Metatrader 4 11 08-05-2008 11:59 AM
Brokers offering tight spreads on minor/exitic currency pairs jimbil Metatrader brokers 2 06-04-2007 01:54 PM
Derived Currency Strength Indicator from multiple pairs jswanson Metatrader 4 0 05-10-2007 09:40 PM
How Do I View More Currency Pairs? mikejody Metatrader 4 2 12-05-2006 01:50 AM


All times are GMT. The time now is 02:10 PM.



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