0_-_Renko_Range_Detector
Download scriptThis tool is designed to provide traders with a clear, real-time visual metric of market movement directly on their trading charts. Its primary purpose is to calculate and display the price distance covered during the previous completed candle, presenting this information in a simple, readable format.
Core Functionality
The script focuses on measuring "Range." In trading terms, it looks at the difference between the opening price and the closing price of the most recently finished candle. It then converts this raw price difference into a standardized numerical value based on the specific asset's decimal points (the "points" or "pips").
Key Features and Visuals
- Dynamic Calculations: The tool automatically detects the precision of the currency pair or asset you are viewing. Whether it is a 3-digit, 4-digit, or 5-digit price format, the script adjusts its internal math to ensure the displayed number is accurate and consistent.
- Real-Time Display: As new candles form and old ones close, the tool instantly updates the value on your screen. This allows you to see exactly how much "room" was moved in the last period at a glance.
- Customizable User Interface: The script provides several options to tailor the visual presentation to fit your specific chart layout:
- Text Styling: You can choose the color, size, and thickness (bold or regular) of the displayed text.
- Positioning: The tool allows you to adjust where on the screen the information appears, including its distance from the corners and edges, ensuring it doesn't obstruct your view of the price action.
- Labeling: It automatically combines a custom prefix (defaulted to "Renko") with the calculated range value so you always know exactly what data point you are looking at.
How it Benefits the Trader
Instead of manually subtracting prices to determine volatility or movement size, this script automates that calculation. It provides an immediate snapshot of price momentum, helping you quickly assess how far the market moved in the previous period without having to perform manual math or navigate through complex menus.
#property copyright "Copyright © 2012, File45"
#property link "http://codebase.mql4.com/en/author/file45"
#property indicator_chart_window
//+------------------------------------------------------------------+
//| START OF DEFAULT OPTIONS
//+------------------------------------------------------------------+
extern string Text = "Renko";
extern color Font_Color = DodgerBlue;
extern int Font_Size = 11;
extern bool Font_Bold = true;
extern int Left_Right = 25;
extern int Up_Down = 150;
extern int Corner = 1;
//+------------------------------------------------------------------+
//| END OF DEFAULT OPTIONS
//+------------------------------------------------------------------+
string The_Font;
double Pointz;
//+------------------------------------------------------------------+
//| Init
//+------------------------------------------------------------------+
int init()
{
Pointz = Point;
// 1, 3 & 5 digits pricing
if (Point == 0.1) Pointz =1;
if ((Point == 0.00001) || (Point == 0.001)) Pointz *= 10;
if(Font_Bold == true)
{
The_Font = "Arial Bold";
}
else
{
The_Font = "Arial";
}
return(0);
}
//+------------------------------------------------------------------+
//| Deinit
//+------------------------------------------------------------------+
int deinit()
{
ObjectDelete("RNG");
return(0);
}
//+------------------------------------------------------------------+
//| Start
//+------------------------------------------------------------------+
int start()
{
string name_rng, Renko_Range;
name_rng = "RNG";
Renko_Range = DoubleToStr(MathAbs((Open[1] - Close[1]) / Pointz), 2);
if (ObjectFind(name_rng) != -1) ObjectDelete(name_rng);
ObjectCreate(name_rng,OBJ_LABEL,0,0,0);
ObjectSetText(name_rng, Text + " " + Renko_Range, Font_Size, The_Font, Font_Color);
ObjectCreate(name_rng, OBJ_LABEL, 0,0,0 );
ObjectSet(name_rng, OBJPROP_CORNER, 1);
ObjectSet(name_rng, OBJPROP_XDISTANCE, Left_Right);
ObjectSet(name_rng, OBJPROP_YDISTANCE, Up_Down );//}
return(0);
}
Comments