Bulls_mod_rickW

Download script
Author: Copyright � 2005, MetaQuotes Software Corp.
Bulls_mod_rickW

This script is a custom technical analysis tool designed to track and visualize market momentum, specifically focusing on the strength of "bullish" (upward) price action. It provides traders with a visual representation of how far the current price is moving above its average trend, helping to identify potential overextensions or shifts in sentiment.

How the Logic Works

The tool operates by breaking down the market data into three distinct steps:

1. Establishing the Baseline (The Trend) First, the script calculates a moving average based on a specific timeframe (determined by the "BullsPeriod" setting). Instead of looking at just the most recent price, it looks back at a set number of past candles to determine the general direction and "smooth" out the daily noise. This acts as the baseline trend for the asset.

2. Calculating the Momentum (The Distance) Once the baseline is established, the script measures the gap between the highest point of each price candle and that calculated average.

  • If the price is significantly higher than the average, it indicates strong upward momentum.
  • This difference is plotted as a visual histogram. A larger bar signifies that the price is pushing aggressively away from its mean.

3. Smoothing the Signal (The Confirmation) Because raw price movements can be volatile and "jumpy," the script performs one final calculation. It takes all those momentum measurements and applies a second smoothing average to them. This creates a "Signal" line.

What this means for the user

By combining these steps, the tool provides two visual layers:

  • The Histogram: Shows you the raw strength of the current move relative to the trend.
  • The Signal Line: Provides a smoothed version of that strength, making it easier to see if the momentum is actually accelerating, slowing down, or starting to reverse.

In short, this script helps you visualize whether the current price "stretch" is healthy and sustained or if the market is becoming exhausted.

Indicators Used
Moving average indicatorMoving average indicator
Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
Bulls_mod_rickW
//+------------------------------------------------------------------+
//|                                                        Bulls.mq4 |
//|                      Copyright © 2005, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2005, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/"

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Green
#property indicator_color2 Red
//---- input parameters
extern int BullsPeriod=13;
extern int SignalSMA=3;
//---- buffers
double BullsBuffer[];
double BullsSignal[];
double TempBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
//---- 1 additional buffer used for counting.
   IndicatorBuffers(3);
   IndicatorDigits(Digits);
//---- indicator line
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,BullsBuffer);
   SetIndexBuffer(1,BullsSignal);
   SetIndexBuffer(2,TempBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="RickW00716 Bulls("+BullsPeriod+")";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Bulls Power                                                      |
//+------------------------------------------------------------------+
int start()
  {
   int i,counted_bars=IndicatorCounted();
//----
   if(Bars<=BullsPeriod) return(0);
//----
   int limit=Bars-counted_bars;
   if(counted_bars>0) limit++;
   for(i=0; i<limit; i++)
      TempBuffer[i]=iMA(NULL,0,BullsPeriod,0,MODE_EMA,PRICE_CLOSE,i);
//----
   i=Bars-counted_bars-1;
   while(i>=0)
     {
      BullsBuffer[i]=High[i]-TempBuffer[i];
      i--;
     }
     
     //----
   i=Bars-counted_bars-1;
   while(i>=0)
     {      
      BullsSignal[i]=iMAOnArray(BullsBuffer,Bars,SignalSMA,0,MODE_SMA,i);
      i--;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments