| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
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 |
|
|||
|
Quote:
Check EAs (there are a lot on this forum), select one with Magic number option (in settings) and do the same with yours. |
|
|||
|
Quote:
Thanks, Randy |
|
|||
|
Quote:
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); 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);
{ OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-sl*Point,Ask+tp*Point,"qq-buy60",11603575,0,Blue); } |
|
|||
|
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
|
|
|||
|
Quote:
![]() |
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 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 |
| What are best medium volatility ranging pairs to trade? | shibeng | Expert Advisors - Metatrader 4 | 4 | 01-30-2007 06:57 AM |
| How Do I View More Currency Pairs? | mikejody | Metatrader 4 | 2 | 12-05-2006 01:50 AM |