MTF_DeMarker

Download script
Author: Copyright � 2006 ycomp
MTF_DeMarker

This tool is designed to provide traders with a specialized visual aid that monitors market momentum by blending data from different time perspectives. Its primary purpose is to help identify overbought or oversold conditions by looking at "the big picture" while you are trading on a smaller, more immediate timeframe.

Core Logic and Functionality

Multi-Timeframe Analysis The standout feature of this script is its ability to bridge the gap between different charts. Instead of showing you what is happening only on your current screen (for example, a 5-minute chart), it can pull data from a much larger timeframe (such as the 1-hour or 4-hour chart). This allows you to see whether the broader market trend supports the price movements you are seeing in the moment.

Momentum Tracking (The DeMarker Indicator) At its heart, the script utilizes a specific mathematical calculation known as the DeMarker indicator. This type of analysis focuses on the relationship between closing prices and high/low price ranges. In simpler terms:

  • It helps determine if the current price movement is "exhausted."
  • It identifies when a market might be reaching an extreme point where it could potentially reverse direction.

Visual Interpretation The script plots a line on a separate window below your main price chart, moving between the values of 0 and 1. To make this easy to read at a glance, it includes two specific reference levels:

  • Upper Level (0.7): Indicates that the market may be entering an "overbought" zone.
  • Lower Level (0.3): Indicates that the market may be entering an "oversold" zone.

How it Works for the User

When you apply this tool, you define two main settings: which larger timeframe you want to monitor and how many previous data points the calculation should consider.

As the script runs, it constantly calculates the momentum of that larger timeframe and maps it onto your current screen. By watching where the line sits in relation to the 0.3 and 0.7 levels, you can gain a clearer sense of whether the broader market is pushing strongly in one direction or if it is becoming stretched thin, potentially signaling a cooling-off period or a trend change.

Indicators Used
DeMarker indicator
Miscellaneous
Implements a curve of type %1
16 Views
0 Downloads
0 Favorites
MTF_DeMarker
//---------------------------------------------------------------
//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, 13, iBarShift(NULL, TimeFramePeriod, Time[aShift])));
}


int start() {

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

  return(0);
 
}

Comments