Forex



Go Back   Forex Trading > Discussion Areas > Metatrader 4






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

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2006, 11:04 PM
006 006 is offline
Member
 
Join Date: Jan 2006
Posts: 77
006 is on a distinguished road
Smoothed Demark

Anyone have a smoothed demark indicator?

Not the TD, just the standard but smoothed. Could have some use.

Many many thanks.
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-18-2006, 12:58 AM
006 006 is offline
Member
 
Join Date: Jan 2006
Posts: 77
006 is on a distinguished road
mt4 formula

Worst case, can someone provide the mt4 demark code so i can work on it?

muchos gracias
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-18-2006, 07:57 AM
Administrator
 
Join Date: Sep 2005
Posts: 20,016
Blog Entries: 235
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 006
Worst case, can someone provide the mt4 demark code so i can work on it?

muchos gracias
It is here:

Code:
//+------------------------------------------------------------------+
//|                                                     DeMarker.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net"

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 1
#property indicator_buffers 1
#property indicator_color1 DodgerBlue
#property indicator_level1 0.3
#property indicator_level2 0.7
//---- input parameters
extern int DeMarkerPeriod=14;
//---- buffers
double DeMarkerBuffer[];
double DeMaxBuffer[];
double DeMinBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- 2 additional buffers are used for counting.
   IndicatorBuffers(3);
   SetIndexBuffer(0, DeMarkerBuffer);
   SetIndexBuffer(1, DeMaxBuffer);
   SetIndexBuffer(2, DeMinBuffer);
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,DeMarkerBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="DeM("+DeMarkerPeriod+")";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//----
   SetIndexDrawBegin(0,DeMarkerPeriod);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| DeMarkerM                                                         |
//+------------------------------------------------------------------+
int start()
  {
   DeMaxBuffer[Bars-1] = 0.0;
   DeMinBuffer[Bars-1] = 0.0;
   int i=Bars-2;
   while(i>=0)
     {
      if(High[i] > High[i+1])
        DeMaxBuffer[i] = High[i] - High[i+1];
      else
        DeMaxBuffer[i] = 0.0; 
      if(Low[i] < Low[i+1])
        DeMinBuffer[i] = Low[i+1] - Low[i];
      else
        DeMinBuffer[i] = 0.0; 
      i--;
     }   
   int counted_bars=IndicatorCounted();
//---- 
   if(Bars<=DeMarkerPeriod) return(0);
//---- initial zero
   if(counted_bars<1)
      for(i=1;i<=DeMarkerPeriod;i++) DeMarkerBuffer[Bars-i]=0.0;   
//----
   i=Bars-DeMarkerPeriod-1;
   if(counted_bars>=DeMarkerPeriod) i=Bars-counted_bars-1;
   while(i>=0)
     {
      double SumiMAOnArray = iMAOnArray(DeMaxBuffer, 0, DeMarkerPeriod, 0, MODE_SMA, i) + iMAOnArray(DeMinBuffer, 0, DeMarkerPeriod, 0, MODE_SMA, i);
      if(!bCompareDouble(SumiMAOnArray,0.0))
         DeMarkerBuffer[i] = iMAOnArray(DeMaxBuffer, 0, DeMarkerPeriod, 0, MODE_SMA, i)/ SumiMAOnArray;
      else
         DeMarkerBuffer[i] = 0.0;
      i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+
 bool bCompareDouble (double dNumber1, double dNumber2)
    {
     bool bCompare=NormalizeDouble(dNumber1 - dNumber2,8) == 0;
     return(bCompare);
    }
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
DeMarker, demark

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
Another Demark Trendline Trader Linuxser Indicators - Metatrader 4 49 11-05-2009 02:54 PM
Ind-TD-Demark-3-1 sky_forex Suggestions for Trading Systems 63 10-24-2009 11:04 AM
Demark Auto Trader newdigital Expert Advisors - Metatrader 4 23 09-23-2009 08:21 AM
Demark documentation and code MainPIP Documentation 3 12-29-2007 09:55 PM
Demark arrow please explain toddanderson Indicators - Metatrader 4 0 12-22-2006 03:52 PM


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



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