RSI_DeMarker_Super_Position

RSI_DeMarker_Super_Position

This technical tool, the Cronex Super Position, is designed to provide traders with a comprehensive overview of market momentum and potential price imbalances by combining several traditional analytical indicators into a single visual display. Instead of looking at separate charts for different tools, this script consolidates high-level data to help identify trends more clearly.

Core Components and Logic

The logic of the script follows a specific sequence of calculation to create a "Super Position" view:

1. Data Aggregation (RSI & DeMarker) The tool begins by pulling two primary types of data:

  • Relative Strength Index (RSI): This measures the speed and change of price movements.
  • DeMarker: This is used to identify whether a market is in a state of "overbought" or "oversold" conditions by looking at the relationship between high and low prices.

Rather than using just one single reading for these indicators, the script calculates four different versions of each (using varying time frames/steps) and averages them together. This creates a smoother, more reliable data stream that is less prone to "noise" or sudden, erratic price spikes.

2. The "Super Position" Calculation Once the smoothed RSI and DeMarker values are established, the script merges them together by calculating their average. This resulting value represents the Cronex Super Position. It serves as a unified momentum oscillator, showing the general health and direction of the market trend.

3. Signal Line Analysis To help traders determine the exact moment to act, the script applies two types of Moving Averages specifically to the "Super Position" data:

  • Fast Signal Line: A quicker moving average that reacts rapidly to price changes.
  • Slow Signal Line: A slower moving average that tracks the long-term trend.

By observing the relationship between these two lines (such as when the fast line crosses the slow line), traders can identify potential shifts in market direction.

4. Divergence Tracking Finally, the script includes a specific calculation to monitor "Divergence." This looks at the mathematical difference between the DeMarker and the RSI. It aims to highlight moments where the price movement and the underlying momentum are moving in opposite directions, which is often a warning sign of an upcoming trend reversal.

Summary for the User

In simple terms, this script takes raw market data, cleans it up by averaging several different indicators together, and then creates a "master line" (The Super Position). It then adds signal lines to that master line to help you see where the trend is going and includes a specific visual cue to alert you if the market's momentum is beginning to lose its strength.

Indicators Used
Relative strength indexDeMarker indicatorMoving average indicator
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
RSI_DeMarker_Super_Position
//+------------------------------------------------------------------+
//|                                        Cronex Super Position.mq4 |
//|                                        Copyright © 2007, Cronex. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property  copyright "Copyright © 2007, Cronex"
#property  link      "http://www.metaquotes.net/"
//---- indicator settings
#property  indicator_separate_window
#property  indicator_buffers 6
#property  indicator_color1  Silver
#property  indicator_color2  DarkOrange
#property  indicator_color3  Black
#property  indicator_color4  Red
#property  indicator_color5  Blue
#property  indicator_color6  SteelBlue

#property indicator_width4 2
#property indicator_width5 2

//-----Level lines   
#property  indicator_level1 -0.20
#property  indicator_level2  0.20
#property  indicator_level3  0.50
#property  indicator_level4  0.80
//---- indicator parameters
extern int RSI=10;
extern int DeMarker=10;
extern int SPStep=4;
extern int FastMA=10;
extern int SlowMA=18;
//---- indicator buffers
double     RSIBuffer[];
double     DeMarkerBuffer[];
double     SPBuffer[];
double     FastMABuffer[];
double     SlowMABuffer[];
double     TmpDiverBuff[];
double     DiverBuffer[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
  IndicatorBuffers(7);
//---- indicator buffers mapping
   SetIndexBuffer(0,RSIBuffer);
   SetIndexBuffer(1,DeMarkerBuffer);
   SetIndexBuffer(2,SPBuffer);
   SetIndexBuffer(3,FastMABuffer);
   SetIndexBuffer(4,SlowMABuffer);
   SetIndexBuffer(5,DiverBuffer);
   SetIndexBuffer(6,TmpDiverBuff);

//---- drawing settings
   SetIndexStyle(0,DRAW_LINE);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexStyle(2,DRAW_LINE);   
   SetIndexStyle(3,DRAW_LINE,EMPTY,2,Red);
   SetIndexStyle(4,DRAW_LINE,EMPTY,2,Blue);
   SetIndexStyle(5,DRAW_HISTOGRAM);
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("RSI DeMarker Super Position");
   SetIndexLabel(0,"RSI Super Position");
   SetIndexLabel(1,"DeMarker Super Position");  
   SetIndexLabel(2,"Cronex Super Position");
   SetIndexLabel(3,"Fast Signal Line");
   SetIndexLabel(4,"Slow Signal Line");
   SetIndexLabel(5,"Super Position Divergence");
   
//   SetIndexShift(3,-2);

//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Cronex RSI Super Position                                        |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- RSI counted in the 1-st buffer
   for(int i=0; i<limit; i++)
   {
      RSIBuffer[i]=(iRSI(NULL,0,RSI+SPStep*0,PRICE_WEIGHTED,i)+
                    iRSI(NULL,0,RSI+SPStep*1,PRICE_WEIGHTED,i)+
                    iRSI(NULL,0,RSI+SPStep*2,PRICE_WEIGHTED,i)+
                    iRSI(NULL,0,RSI+SPStep*3,PRICE_WEIGHTED,i))/400;
      DeMarkerBuffer[i]=(
                    iDeMarker(NULL,0,DeMarker+SPStep*0,i)+
                    iDeMarker(NULL,0,DeMarker+SPStep*1,i)+
                    iDeMarker(NULL,0,DeMarker+SPStep*2,i)+
                    iDeMarker(NULL,0,DeMarker+SPStep*3,i))/4;
    
      SPBuffer[i]=(RSIBuffer[i]+DeMarkerBuffer[i])/2;
      TmpDiverBuff[i]=DeMarkerBuffer[i]-RSIBuffer[i];
   }
                
//---- signal line counted in the 2-nd buffer
   for(i=0; i<limit; i++)
    {  
      FastMABuffer[i]=iMAOnArray(SPBuffer,Bars,FastMA,0,MODE_LWMA,i);
      SlowMABuffer[i]=iMAOnArray(SPBuffer,Bars,SlowMA,0,MODE_LWMA,i);
      DiverBuffer[i]=iMAOnArray(TmpDiverBuff,Bars,FastMA,0,MODE_LWMA,i)*2;
    } 
//---- done
   return(0);
  }
//+------------------------------------------------------------------+

Comments