Forex
Google
New signals service!

Go Back   Forex Trading > Downloads > Indicators - 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
 
LinkBack (229) Thread Tools Display Modes
  97 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 02-20-2006, 09:54 PM
keris2112's Avatar
Senior Member
 
Join Date: Dec 2005
Location: California, US
Posts: 129
keris2112 is on a distinguished road
Multi Timeframe Indicators

Hi all,
I've been wanting to have the ability to plot indicators from different timeframes on my chart, but MT doesn't have this capability built in. (Does anyone know of any charting programs that do this natively?) As an example, if you're following the IWCR system, it'd be nice to be able to plot the Daily RSI on your 5 Min. chart.

When I put together the Daily Volitily Breakout indicator, that sorta did what I wanted in that it allowed you to add it to any timeframe (Daily or less) and see where the daily breakout point would be. The problem was that it was limited to only showing the Daily value.

About 2 weeks ago I came across Igorad's Price Channel Stop indicator and it seemed to do what I wanted (with regard to mulitiple timeframes). I started trying to use the Price Channel indicator as a template, adding code from other indicators and tweaking it to work within the new structure, but they never seemed to work. (I'm still not a very good coder.) Then last night I had a "breakthrough": If I can't figure out how to properly add the code from the other indicators, why not just Reference them, with their iName or iCustom? So, that's what I did. And, it works great.

Here are a few things to keep in mind when using these:
1) TimeFrame is the input you use to specify what timeframe to pull the data from.
2) You must set TimeFrame in minutes (1,5,15,30,60,240,1440,10080,43200)
3) By default, TimeFrame is set to 0, which means that it will use whatever the current timeframe is, i.e it will act as the original indicator.
4) If you set TimeFrame to anything other than 0, it must be >= current timeframe. (In other words, don't use a M15 PSar on an H1 chart. The values won't be correct. An H1 PSar on an M15 chart works properly.)

I've setup 5 Multi-TimeFrame (MTF) indicators to use as examples. You can open them up and use the code as a template so that you can make any existing indicator MTF. Please don't post asking for other indicators to be made, as the thread will soon turn into one big 'please do this for every MT4 indicator'. It's really, really simple to do, and if you don't know how to code, spend a week reading Coder Guru's MT4 programming guide and you'll be able to do it.

If I have time, I'll add more. Hopefully others will add their MTF conversions to the thread.

Multi-TimeFrame set 1 contains:
#MTF_MovingAverage.mq4
#MTF_PSar.mq4
#MTF_RSI.mq4
#MTF_MACD.mq4
#MTF_CCI.mq4

The attached chart is the following:
M5 Chart with LimeGreen PSar
M15 PSar
M60 SMA(13)
H4 CCI
M30 MACD
H1 RSI

Well, I hope these come in handy for some of you. Thanks Igor, for your fantastic coding skills. I've learned a lot just by studying your code.

Keris

EDIT:
Added #MTF Set 2.zip on 3/4/06 ---- (Bollinger Bands, Juice, Linear Price Bar, Price, Stochastic)
Attached Images
File Type: gif #mtf example.gif (17.0 KB, 32511 views)
Attached Files
File Type: zip #MTF Set 1.zip (6.6 KB, 6027 views)
File Type: zip #MTF Set 2.zip (9.2 KB, 5130 views)

Last edited by keris2112; 03-05-2006 at 02:11 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-20-2006, 11:12 PM
keris2112's Avatar
Senior Member
 
Join Date: Dec 2005
Location: California, US
Posts: 129
keris2112 is on a distinguished road
Linear Price Bar

Here's one more MTF indicator. It's based on a custom indicator (you can view the code to make your own).

It's called #MTF_LPB.mq4 (Linear Price Bar) Here's the link to the thread for info on the indicator: Linear Price Bar

Attached are 2 indicators. You need both in your indicators folder as the MTF version references the original indicator.

Linear Price Bar.mq4
#MTF_LPB.mq4

Keris
Attached Files
File Type: mq4 Linear Price Bar.mq4 (2.7 KB, 2226 views)
File Type: mq4 #MTF_LPB.mq4 (3.8 KB, 2099 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-21-2006, 03:49 AM
Senior Member
 
Join Date: Oct 2005
Posts: 223
sailor is on a distinguished road
thanks for info very usefull for me :-)

Sailor
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-21-2006, 06:13 AM
TheShanghai's Avatar
Junior Member
 
Join Date: Dec 2005
Posts: 23
TheShanghai is on a distinguished road
Just wanted to say thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-21-2006, 02:27 PM
Member
 
Join Date: Oct 2005
Location: Germany
Posts: 62
schwager is on a distinguished road
Mtf

Hello!
one of me!
Attached Files
File Type: mq4 MTF-Dinapoli_Target.mq4 (2.3 KB, 2560 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-21-2006, 05:14 PM
keris2112's Avatar
Senior Member
 
Join Date: Dec 2005
Location: California, US
Posts: 129
keris2112 is on a distinguished road
Quote:
Originally Posted by schwager
Hello!
one of me!
Thanks schwager!

Also, since Dinapoli Targets is a custom indicator, could you add the original DinapoliTargets.mq4 file to your post. People are going to need both files to make the MTF version work.

Keris
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-21-2006, 06:26 PM
Member
 
Join Date: Oct 2005
Location: Germany
Posts: 62
schwager is on a distinguished road
Dinapoli

ups sorry.........

http://www.forex-tsd.com/attachments...4?d=1129363521
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-22-2006, 01:39 AM
ycomp's Avatar
Member
 
Join Date: Jan 2006
Posts: 93
ycomp is on a distinguished road
maybe this is helpful to you

I wrote one for demarker the other day. I think I scrutinized it but can't remember exactly. Anyhow easy enough to check, just compare it with a real demarker on another chart.

Just change the getDeMarker function to getRSI() or getCustomIndicator() (and use iCustom in that function) or whatever, if you want to base it on another indicator.
Attached Files
File Type: mq4 MTF_DeMarker.mq4 (2.6 KB, 1831 views)

Last edited by ycomp; 02-22-2006 at 12:49 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 02-22-2006, 07:07 PM
Junior Member
 
Join Date: Nov 2005
Posts: 10
vimpson is on a distinguished road
Thanx Keris, you put well!!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 02-22-2006, 08:08 PM
ycomp's Avatar
Member
 
Join Date: Jan 2006
Posts: 93
ycomp is on a distinguished road
small bug in MTF_DeMarker

code I posted works but DeMarker is displayed as a period of 13 only. Here is the fixed copy that actually uses the DeMarkerPeriod variable.

can't seem to upload a file anymore though... it just says page not found.. therefore here are the instructions to change it:

just open in notepad and paste this text below and save it as "MTF_DeMarker_v1.mq4"

Code:
//---------------------------------------------------------------
//PARAMS:
//- TimeFramePeriod: # of minutes in TF. 
//  NOTE: I did not test non-standard TFs or a TimeFramePeriod
//        value less than that of current chart. So they probably
//        won't work.
// - DeMarkerPeriod: self explanatory
//---------------------------------------------------------------

#property copyright "Copyright  2006 ycomp"
#property link      "ycomp"

#define MIN_BARS_REQUIRED 200 // Just a safe amount here. Probably needs much less.


//--- Indicator Settings
#property indicator_separate_window

#property indicator_level1 0.3
#property indicator_level2 0.7

#property indicator_buffers 1

#property indicator_color1 DodgerBlue
#property indicator_width1 2

#property indicator_maximum 1
#property indicator_minimum 0

//---- input parameters

extern int TimeFramePeriod;

extern int DeMarkerPeriod = 14;

//---- buffers
double buff[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  if (Bars < MIN_BARS_REQUIRED) return (-1);

  IndicatorDigits(Digits);
    
  SetIndexStyle(0, DRAW_LINE, STYLE_SOLID, 2);
  SetIndexBuffer(0, buff);  
  
  string paramDesc =
    "(" +
      getPeriodDesc(TimeFramePeriod) + ", " +
      DeMarkerPeriod +
    ")";
                      
  IndicatorShortName("MTF_DeMarker" + paramDesc);

  // Set Index Labels
  SetIndexLabel(0, "MTF_DeM" + paramDesc);   

  return(0);
 }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }

string getPeriodDesc(int aNumMinutes) {
  switch (aNumMinutes) {
    case PERIOD_M1 : return("M1");
    case PERIOD_M15: return("M15");
    case PERIOD_M30: return("M30");
    case PERIOD_H1 : return("H1");
    case PERIOD_H4 : return("H4");
    case PERIOD_D1 : return("D1");
    case PERIOD_W1 : return("W1");
    case PERIOD_MN1: return("MN1");
    case 0: return ("Chart");
    default: return ("M" + aNumMinutes);
  }
}


double getDeMarker(int aShift) {
  return (iDeMarker(NULL, TimeFramePeriod, DeMarkerPeriod, iBarShift(NULL, TimeFramePeriod, Time[aShift])));
}


int start() {

  for(int shift=Bars-1;shift>=0;shift--)
  {
  
    buff[shift] = getDeMarker(shift);
    
  }

  return(0);
 
}
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Tags
forex, histogram, mtf bband, TRO SAK MULTIPAIR

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 On
Forum Jump

LinkBacks (?)
LinkBack to this Thread: http://www.forex-tsd.com/indicators-metatrader-4/1077-multi-timeframe-indicators.html
Posted By For Type Date
һ԰Ѵʱڵľ߷Сʱϵָ - mt4ܽϵͳ - ̳ ̳|㿪|㱣֤|FXSOL This thread Refback 08-31-2008 07:31 AM
yMT4zMetaTrader Part8y^g[_[z Post #0 Refback 08-17-2008 12:55 PM
: fractals.mq4 This thread Refback 08-07-2008 06:37 PM
Multi Timeframe Indicators - Page 91 - Forex Trading This thread Refback 08-02-2008 09:22 PM
MTF Stochastic 4TF Post #2168 Refback 08-02-2008 07:13 PM
4 ?? - Trading4Living This thread Refback 07-23-2008 06:20 PM
Multi Timeframe Indicators - Page 117 - Forex Trading This thread Refback 07-20-2008 03:49 AM
4 ?? - Trading4Living This thread Refback 07-13-2008 04:55 PM
4 ?? - Trading4Living This thread Refback 07-13-2008 04:12 PM
4 - Forex This thread Refback 07-12-2008 08:08 AM
4 - Forex This thread Refback 07-12-2008 05:41 AM
Weekly_HILO. - MQL4 代码基地 Post #2066 Refback 07-10-2008 08:39 PM
Multi Timeframe Indicators - Page 62 - Forex Trading This thread Refback 07-05-2008 10:25 PM
eNjJɂ‚Č낤part2 This thread Refback 07-05-2008 11:05 AM
BZ_TL_SkylineM - MQL4 Code Base Post #1684 Refback 07-05-2008 07:12 AM
MTF BB-Squeeze - MQL4 Code Base Post #1870 Refback 07-03-2008 03:32 AM
Weekly_HILO. - MQL4 Code Base Post #2066 Refback 06-25-2008 05:45 AM
ڳΥMetaTrader鿴ѣڤȤѡ - MetaTraderޤȤWiki Post #1124 Refback 06-22-2008 01:31 PM
My MT4 modified indicators and collection - Page 7 Post #1177 Refback 06-22-2008 11:30 AM
Weekly_HILO. - MQL4 Code Base Post #2066 Refback 06-20-2008 04:56 AM
EESFX This thread Refback 06-19-2008 02:17 PM
Signal_Bars_MFI - MQL4 Code Base Post #2210 Refback 06-18-2008 10:24 PM
Signal_Bars_MFI - MQL4 Code Base Post #2210 Refback 06-17-2008 06:18 PM
Signal_Bars_MFI - MQL4 Code Base Post #2210 Refback 06-16-2008 10:29 PM
RSS-: Post #1652 Refback 06-15-2008 03:06 PM
4 - Forex This thread Refback 06-13-2008 06:00 PM
Блог Post #1652 Refback 06-12-2008 02:17 PM
eNjJɂ‚Č낤Part4 Post #977 Refback 06-11-2008 12:15 PM
Все индикаторы Форекс: Май 2008 Post #1684 Refback 06-09-2008 10:47 AM
LinearRegSlope_v1 - MQL4 代码基地 Post #1901 Refback 06-09-2008 08:52 AM
My MT4 modified indicators and collection - Page 7 Post #1177 Refback 06-08-2008 08:54 PM
My MT4 modified indicators and collection - Page 7 Post #1177 Refback 06-08-2008 04:15 PM
Tro_Range - MQL4 Code Base Post #1652 Refback 06-08-2008 07:06 AM
Tro_Range - MQL4 代码基地 Post #1652 Refback 06-07-2008 09:40 PM
Все индикаторы Форекс: Индикатор Tro_Range Post #1652 Refback 06-07-2008 06:32 PM
4 - Forex This thread Refback 06-06-2008 09:38 AM