Go Back   Forex-TSD > Downloads > Expert Advisors - Metatrader 4
Forex Forum Register More recent 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 10-21-2007, 06:47 PM
Member
 
Join Date: Sep 2007
Posts: 31
Sendra is on a distinguished road
Who's confused, my EA or me?

These 2 EA basically the same, using EMA crossover. I backtested them on GBPUSD using IBFX mini demo account for October only (till the 20). EA_1 gained almost 50%, and EA_2 lost nearly 100%.

Problem is: I manually check trades from both EA (first to ten, not all of them), and only the first trade (from both) did exactly as I wanted them. The rest were triggered not even close from the setup. And both passed many crossovers.

My questions:

Does historical data from IBFX are so different than the data they put on their chart? (so it's their mistake, not my EAs).

or

My EA coding are so absurd that they did exactly what I don't want them to do, with so different results. (The mistake is on me, not anybody or anything else).

Thank you all for your help.
Attached Files
File Type: mq4 EA_1.mq4 (9.5 KB, 30 views)
File Type: mq4 EA_2.mq4 (7.3 KB, 20 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
  #2 (permalink)  
Old 10-21-2007, 08:42 PM
sps8's Avatar
Senior Member
 
Join Date: Apr 2006
Posts: 183
sps8 is on a distinguished road
hi

just do a visual backtest watch how they trade.i lke visual
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 10-21-2007, 10:03 PM
ralph.ronnquist's Avatar
Senior Member
 
Join Date: Oct 2006
Posts: 297
ralph.ronnquist is on a distinguished road
I think you've run into the pot-hole MetaQuotes created recently by changing the tester to recompute the intra-bar ticks anew at every test run. If your EA, as it does, depends on these ticks, then you cannot expect two runs even of the same EA on the same backtest data to be the same.

But perhaps you would fare better with an "open bar only" time filter:
PHP Code:
static datetime time 0;
if ( 
Time] == time ) return( );
time Time]; 
inserted at the beginning of the start() function. Then you should also rather
peep at the bars 1, 2 and 3 of iMA instead of 0, 1, 2 (since bar 0 is just about
started and far from complete).
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 10-25-2007, 08:28 AM
Senior Member
 
Join Date: Nov 2006
Location: Ukraine
Posts: 514
Shinigami is on a distinguished road
Why not using closed bars only? MA crossovers are closed bar MA crosses otherwise its re-drawing.
double x1=iMA(NULL,PERIOD_H1,24,0,MODE_EMA,PRICE_MEDIAN,0 );
double y1=iMA(NULL,PERIOD_H1,28,0,MODE_EMA,PRICE_MEDIAN,0 );
Yep! Thats the problem. Change 0 to 1 in the end so it will look like this:
double x1=iMA(NULL,PERIOD_H1,24,0,MODE_EMA,PRICE_MEDIAN,1 );
double y1=iMA(NULL,PERIOD_H1,28,0,MODE_EMA,PRICE_MEDIAN,1 );
and change the next MA crosses to 2 and 3 respectively.

Ralph you were correct here.

But its quite a funny way of using MA cross - "crossed up = true"
A different way would be checking last 2 bars (1 bar back, 2 bars back) and seeing if they crossed.
And yes, your program seems absurd
I use this:
if(lastMA<lastMA2) {
if(nowMA>nowMA2)
cross=1; } // cross up
else if(lastMA>lastMA2) {
if(nowMA<nowMA2)
cross=-1; } // cross down

Instead of huge blocks of code. Hope this helps
__________________
MQL4 programming is easy ^^

Last edited by Shinigami; 10-25-2007 at 08:36 AM.
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
Confused with Trailing Stops baharoth General Discussion 2 05-19-2006 09:37 AM


All times are GMT. The time now is 06:20 AM.



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