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 02-25-2007, 01:43 PM
Senior Member
 
Join Date: Oct 2005
Posts: 220
smeden is on a distinguished road
Multi pairs

Hi
I am making an EA based on more than one currency pair.

But I can't get it to work. I want to read ex. MA from EURUSD and trade on GBPUSD.

double dSMA=iMA("EURUSD",30,21,0,MODE_SMA,PRICE_CLOSE,1);
double dSMA=iMA("GBPUSD",30,21,0,MODE_SMA,PRICE_CLOSE,1);

Is this correct? Is it possible?

I can't back test it, but will it work live?
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 02-25-2007, 02:01 PM
lowphat's Avatar
Senior Member
 
Join Date: Sep 2005
Posts: 200
lowphat is on a distinguished road
ya its possible

Last edited by lowphat; 02-28-2007 at 04:12 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
  #3 (permalink)  
Old 02-25-2007, 07:18 PM
Senior Member
 
Join Date: Oct 2005
Posts: 220
smeden is on a distinguished road
Yes I know but I cant back test it. Is that right?
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 02-25-2007, 07:35 PM
lowphat's Avatar
Senior Member
 
Join Date: Sep 2005
Posts: 200
lowphat is on a distinguished road
i believe i have used data from other pairs to trade on another and it seemed to backtest. it made entrys so i assume it was ok but i didnt confirm everything was working 100%
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 02-25-2007, 07:38 PM
Senior Member
 
Join Date: Oct 2005
Posts: 220
smeden is on a distinguished road
Thanks you for your help.

can't get it to work. Please help

I add this EA to USDCHF and I want it to take a Sell if Bid price hit 30 bar high. (Reverse for buy)

If I make a back test it take buy/sell position every time it hit high/low on USDCHF, it was not the idea. It should only take a sell if EURUSD also hit high the same time as USDCHF.

I know the code is right(I use it for another EA). The thing that is new for me is how to calculate high/low on a different currency pair.



double dLow=Low[Lowest(NULL,0,MODE_LOW,30 ,1)];
double dHigh=High[Highest(NULL,0,MODE_HIGH,30,1)];

double dLow2=Low[Lowest("EURUSD",0,MODE_LOW,30 ,1)];
double dHigh2=High[Highest("EURUSD",0,MODE_HIGH,30 ,1)];


if (Bid<=dLow && Bid<=dLow2 ){
if (StopLoss!=0) ldStop=Ask-StopLoss*Point;
if (TakeProfit!=0) ldTake=Ask+TakeProfit*Point;
SetOrder(OP_BUY,Ask,ldStop,ldTake);

}
if (Bid>=dHigh && Bid>=dHigh2){
if (StopLoss!=0) ldStop=Bid+StopLoss*Point;
if (TakeProfit!=0) ldTake=Bid-TakeProfit*Point;
SetOrder(OP_SELL,Bid,ldStop,ldTake);
}
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 02-26-2007, 01:44 PM
lowphat's Avatar
Senior Member
 
Join Date: Sep 2005
Posts: 200
lowphat is on a distinguished road
1st thing i see is you have to have something that represents eur's current price which you don't have in your entry logic. perhaps you could use something simular to

Code:
eurusdCurPrice=iMA("EURUSD",1,1,0,MODE_EMA,PRICE_MEDIAN,0);

Code:
eurusdCurPrice<=dLow2
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
  #7 (permalink)  
Old 02-26-2007, 02:03 PM
Nicholishen's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Backtester will not pull data from other pairs.

From http://www.metaquotes.net/experts/ar.../tester_limits

Using of MarketInfo function generates error ERR_FUNCTION_NOT_ALLOWED_IN_TESTING_MODE(4059), however, correct information about current prices for the symbol under test, about stop level dimensions, about point size, about spread size of any symbol being present in the quotes window is provided.
__________________
"Anyone who has never made a mistake has never tried anything new." -Albert Einstein
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
  #8 (permalink)  
Old 02-26-2007, 02:05 PM
lowphat's Avatar
Senior Member
 
Join Date: Sep 2005
Posts: 200
lowphat is on a distinguished road
it does pull data from other pairs but i did not use market info
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
  #9 (permalink)  
Old 02-26-2007, 02:12 PM
Nicholishen's Avatar
Senior Member
 
Join Date: Dec 2005
Posts: 531
Nicholishen is on a distinguished road
Quote:
Originally Posted by lowphat
it does pull data from other pairs but i did not use market info
ok, i ran an extremely simple test to verify. Please tell me what i am doing wrong.

Ran in visual mode on EURUSD with NO RESULT:
PHP Code:
int start()
  {
//----
   
Comment(MarketInfo("GBPUSD",MODE_BID));
//----
   
return(0);
  } 
AND

int start()
{
//----
Comment(iMA("GBPUSD",0,20,0,0,0,0) );
//----
return(0);
}
__________________
"Anyone who has never made a mistake has never tried anything new." -Albert Einstein

Last edited by Nicholishen; 02-26-2007 at 02:14 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
  #10 (permalink)  
Old 02-26-2007, 02:14 PM
lowphat's Avatar
Senior Member
 
Join Date: Sep 2005
Posts: 200
lowphat is on a distinguished road
k gimme a sec

Last edited by lowphat; 02-26-2007 at 02:17 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
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
All USD pairs Linuxser Indicators - Metatrader 4 35 01-31-2009 09:10 PM
complimentary pairs? increase General Discussion 12 04-07-2008 10:08 PM
Trading Different Pairs With 1 Ea leeb Expert Advisors - Metatrader 4 3 12-23-2006 08:52 PM
Chart for SL, TP, and TS for all pairs? antone General Discussion 7 11-23-2006 06:58 PM
Multi EAs, multi brokers, same computer hhsmoney General Discussion 6 11-16-2006 09:32 PM


All times are GMT. The time now is 07:51 AM.



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