Forex
Google
New signals service!

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

 
 
LinkBack Thread Tools
 
Old 02-21-2006, 12:43 AM
Rip Rip is offline
Junior Member
 
Join Date: Dec 2005
Posts: 8
Rip is on a distinguished road
Need help finding an indicator for MT4

Hi all, I looking for MT4 indicator which will draw a horizontal line at the high and the low over x periods. example, if I'm working off the eurusd 1hr chart I would like to see a line at the 50 period high and the 50 period low, but the period can be set to what ever you want and the lines update with each new candle. Any help would be great, thanks Rip
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 02-21-2006, 04:30 AM
Senior Member
 
Join Date: Oct 2005
Posts: 223
sailor is on a distinguished road
hey what u mean 50 period ? u mean 50 hour candles ?

sailor
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 02-21-2006, 06:45 PM
Rip Rip is offline
Junior Member
 
Join Date: Dec 2005
Posts: 8
Rip is on a distinguished road
yes, but ajustable, so you can find the 200 period high/low if you would like, find the high and low of x periods, x being any number of candles you choose.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 02-21-2006, 07:35 PM
keris2112's Avatar
Senior Member
 
Join Date: Dec 2005
Location: California, US
Posts: 130
keris2112 is on a distinguished road
I can't upload any files right now. Don't know if it is a problem with my work network or the forum. Anyway, here's the code for now. I'll upload the file later.

Keris

Code:
//+------------------------------------------------------------------+
//|                                                        Hi Lo.mq4 |
//|                                      Copyright © 2006, Keris2112 |
//|                                         http://www.forex-tsd.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Keris2112"
#property link      "http://www.forex-tsd.com"

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red
//---- input parameters
extern int       HiLoPeriod=10;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- 
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   int limit,i;
   //---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- 
   for(i=0; i<limit; i++)
   {
      ExtMapBuffer1[i]=High[Highest(NULL,0,MODE_HIGH,HiLoPeriod,i+1)];
      ExtMapBuffer2[i]=Low[Lowest(NULL,0,MODE_LOW,HiLoPeriod,i+1)];
   }
//----
   return(0);
  }
//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 02-21-2006, 07:42 PM
keris2112's Avatar
Senior Member
 
Join Date: Dec 2005
Location: California, US
Posts: 130
keris2112 is on a distinguished road
#MTF_Hi Lo

Here's the code for the Multi TimeFrame vesion. You need both files in your indicator folder to use the MTF version.

Code:
//+------------------------------------------------------------------+
//|                                                   #MTF_Hi Lo.mq4 |
//|                                      Copyright © 2006, Keris2112 |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Keris2112"
#property link      "http://www.forex-tsd.com"

#property indicator_chart_window
#property indicator_buffers 2
#property  indicator_color1  Blue
#property  indicator_color2  Red

//---- input parameters
/*************************************************************************
PERIOD_M1   1
PERIOD_M5   5
PERIOD_M15  15
PERIOD_M30  30 
PERIOD_H1   60
PERIOD_H4   240
PERIOD_D1   1440
PERIOD_W1   10080
PERIOD_MN1  43200
You must use the numeric value of the timeframe that you want to use
when you set the TimeFrame' value with the indicator inputs.
**************************************************************************/
extern int TimeFrame=0;
extern int HiLoPeriod=7;


double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   
//---- indicator line
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
      
   SetIndexBuffer(0,ExtMapBuffer1); 
   SetIndexBuffer(1,ExtMapBuffer2);  
//---- name for DataWindow and indicator subwindow label   
   switch(TimeFrame)
   {
      case 1 : string TimeFrameStr="Period_M1"; break;
      case 5 : TimeFrameStr="Period_M5"; break;
      case 15 : TimeFrameStr="Period_M15"; break;
      case 30 : TimeFrameStr="Period_M30"; break;
      case 60 : TimeFrameStr="Period_H1"; break;
      case 240 : TimeFrameStr="Period_H4"; break;
      case 1440 : TimeFrameStr="Period_D1"; break;
      case 10080 : TimeFrameStr="Period_W1"; break;
      case 43200 : TimeFrameStr="Period_MN1"; break;
      default : TimeFrameStr="Current Timeframe";
   }
   IndicatorShortName("MTF_Hi Lo("+HiLoPeriod+") ("+TimeFrameStr+")");

  }
//----
   return(0);
 
//+------------------------------------------------------------------+
//| MTF MACD                                            |
//+------------------------------------------------------------------+
int start()
  {
   datetime TimeArray[];
   int    i,limit,y=0,counted_bars=IndicatorCounted();
 
// Plot defined time frame on to current time frame
   ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); 
   
   limit=Bars-counted_bars;
   for(i=0,y=0;i<limit;i++)
   {
   if (Time[i]<TimeArray[y]) y++;

/***********************************************************   
   Add your main indicator loop below.  You can reference an existing
      indicator with its iName  or iCustom.
   Rule 1:  Add extern inputs above for all neccesary values   
   Rule 2:  Use 'TimeFrame' for the indicator time frame
   Rule 3:  Use 'y' for your indicator's shift value
 **********************************************************/  
 
   ExtMapBuffer1[i]=iCustom(NULL,TimeFrame,"Hi Lo",HiLoPeriod,0,y); 
   ExtMapBuffer2[i]=iCustom(NULL,TimeFrame,"Hi Lo",HiLoPeriod,1,y);    
   }  
     
//
   
  
  
   return(0);
  }
//+------------------------------------------------------------------+
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 
Old 02-22-2006, 12:59 AM
Rip Rip is offline
Junior Member
 
Join Date: Dec 2005
Posts: 8
Rip is on a distinguished road
Thank you, but can't get the MTF version to work. Thank again, Rip
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
 

Bookmarks
Thread Tools

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
Finding the Most Profitable EA druelus Expert Advisors - Metatrader 4 6 05-18-2007 05:53 PM
Help finding an indicator trevman Indicators - Metatrader 4 0 03-08-2007 08:06 PM
Having trouble finding Broker matrixebiz Metatrader 4 1 12-11-2006 01:06 PM
Finding the value of 1 pip per 1 lot of a pair rusty105 Metatrader 4 5 11-21-2006 10:20 PM
Need Help finding a Broker..... MT4 Qbert006 Metatrader 4 2 03-21-2006 03:21 AM


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



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