DeMarkerB_MTF
Download scriptThis tool is a specialized technical analysis indicator designed for the MetaTrader platform. Its primary purpose is to help traders monitor market momentum by consolidating data from different time horizons into a single, easy-to-read visual display.
Core Functionality
The script utilizes a mathematical calculation known as the DeMarker. In trading, this is used to identify whether a market is "overbought" (too much buying pressure) or "oversold" (too much selling pressure). Rather than looking at these signals on just one specific timeframe, this tool allows you to view the DeMarker data from a higher timeframe while staying on your current chart.
How It Works
The logic follows a three-step process to provide a cohesive view of the market:
- Multi-Timeframe Synchronization: The tool is designed to "reach out" and grab data from a larger timeframe (e.g., looking at Hourly or Daily trends while you are currently viewing 5-minute candles). It automatically calculates the correct historical point to ensure the data aligns perfectly with your current view.
- Momentum Smoothing: It applies a specific period setting to the DeMarker calculation. This helps filter out minor "market noise," allowing the indicator to highlight more significant shifts in momentum rather than reacting to every tiny price fluctuation.
- Visual Mapping: The script takes these complex multi-timeframe calculations and plots them as a smooth line on a separate window at the bottom of your trading screen.
Key Features for the User
- Overbought/Oversold Levels: The indicator includes predefined visual boundaries (levels). When the line moves toward the top or bottom of these levels, it alerts you to potential exhaustion in the market trend.
- Dynamic Labeling: The tool automatically detects and labels which timeframe it is pulling data from, making it easy to identify at a glance what specific trend you are observing.
- Seamless Integration: By combining multiple timeframes into one line, the logic removes the need for a trader to constantly switch between different tabs or windows to gauge the "big picture" of the market.
//+------------------------------------------------------------------+
//|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 |
//+------------------------------------------------------------------+
//mod2008fxtsd ki
#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;
extern string TimeFrames = "M1;5,15,30,60H1;240H4;1440D1;10080W1;43200MN";
//---- buffers
double buff[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
if (Bars < MIN_BARS_REQUIRED) return(-1);
IndicatorDigits(Digits);
SetIndexStyle(0, DRAW_LINE);
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()
{
int counted_bars=IndicatorCounted();
int shift,limit;
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
limit = Bars-counted_bars;
limit = MathMax(limit,TimeFramePeriod/Period());
for(shift=limit; shift>=0; shift--)
{
buff[shift]=getDeMarker(shift);
}
return(0);
}
//+------------------------------------------------------------------+
Comments