Go Back   Forex-TSD > Discussion Areas > 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 08-09-2007, 07:54 PM
Senior Member
 
Join Date: May 2007
Posts: 177
dvarrin is on a distinguished road
Fractal Bug

Hi,

I have a problem with the default fractal indicator in MT4. If you create an EA which prints the value of the fractal indicator on each bar, it can happen that a non zero value is printed, although on the chart there is nothing indicating that the concerned bar is a fractal.

I think the problem is that when the last bar starts at a price lower than the previous fractal up value, two bars before, it will be recognized as a fractal because the previous bar and the current one (which is not finished) are lower.

How to modify that? I tried to use a shift of 3 to avoid indicating a fractal 2 bars befor the current one. I tried to modify the fractal indicator to recompute the last three bars. And I tried many other things, but I cannot get rid of those wrong signals.

I hope some of you can help me.

Here is the code. Try to execute it on EURUSD 1h from 2007.08.01 to 2007.08.02. You'll see that there are two false fractals printed in the journal, but they don't appear on the chart.

//+------------------------------------------------------------------+
//| Chaos.mq4 |
//| Copyright © 2007, MetaQuotes Software Corp. |
//| Forex Trading Software: Forex Trading Platform MetaTrader 4 |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

//----------------------- INCLUDES
#include <stdlib.mqh>

//----------------------- EA PARAMETER
extern double Lots = 0.1;


datetime prevBarTime;
datetime NO_TIME = D'01.01.1990';

//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//----
Print("--------------------------------- Start -------------------------------------");

prevBarTime = NO_TIME;
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+

int start()
{
//----

if (Time[1] != prevBarTime) {
//Print("Time: " + Time[1]);
double up = iCustom(Symbol(), 0, "Fractals", 0, 3);
double down = iCustom(Symbol(), 0, "Fractals", 1, 3);

if (up != 0.0)
Print(up);

if (down != 0.0)
Print(down);

prevBarTime = Time[1];
}

//----
return(0);
}
//+------------------------------------------------------------------+


Cheers,
Daniel

Last edited by dvarrin; 08-09-2007 at 08:09 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

Tags
fractal


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
Fractal indicator MacDaddy Indicators - Metatrader 4 21 10-09-2009 02:49 PM
Fractal ZigZag ienaplinsky Expert Advisors - Metatrader 4 8 11-24-2006 05:14 AM
Fractal EA yass Expert Advisors - Metatrader 4 1 05-07-2006 06:31 AM
Fractal Projection 006 Suggestions for Trading Systems 3 02-16-2006 06:17 PM


All times are GMT. The time now is 09:22 AM.



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