Future Candles~
Download scriptThis tool is designed to analyze and project potential price movements on a trading chart by calculating "future" price levels based on historical averages. It functions as a visual guide, providing traders with estimated boundaries for upcoming candles.
Core Methodology
The script operates by establishing a baseline from the recent market history and then projecting that data forward. Here is how it processes the information:
- Historical Averaging: The logic begins by calculating two distinct averages. It looks back at the last 15 periods of closing prices to find a broad trend, and simultaneously examines a smaller, more recent window of 4 periods to capture immediate momentum.
- Price Normalization: The tool takes these averages and uses them as an anchor point. It then inspects the High, Low, Open, and Close prices of the most recent completed candles. By comparing these real-time figures against the calculated averages, it determines the "distance" or variance from the trend.
- Projection Logic: Instead of simply showing past data, the script applies the observed variance to estimate where the next candle might appear. It mathematically mirrors the current price action—calculating how far a price has deviated from the average—and projects that same distance into the "empty" space on the right side of the chart (the future).
Visual Representation
The script translates these complex calculations into six distinct visual layers on your chart:
- Projected Boundaries: It draws several histogram-style lines that represent predicted high, low, open, and close levels for upcoming price action.
- Dynamic Adjustments: The tool specifically calculates a "buffer" or offset (using the smallest price unit, known as a Point) to ensure that these projected boundaries are visually separated and clear.
- Visual Indicators: Depending on the settings, it distinguishes between "Bullish" and "Bearish" projections using different colors (such as White and Black), allowing you to see at a glance whether the tool anticipates an upward or downward movement.
Summary for the Trader
In essence, this script acts as a predictive overlay. It takes the current "rhythm" of the market—how far prices are swinging away from their averages—and projects that rhythm forward into the future. This allows you to see potential price zones before they actually occur on the chart, helping you visualize where the market might travel next based on recent behavior.
/*
Generated by EX4-TO-MQ4 decompiler V4.0.220.2c []
Website: http://purebeam.biz
E-mail : purebeam@gmail.com
*/
#property copyright "Copyright © 2008, Forex Prestige Software Ltd."
#property link "http://www.forex-prestige.myxosting.ru"
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Aqua
#property indicator_color2 Aqua
#property indicator_color3 Aqua
#property indicator_color4 Aqua
#property indicator_color5 White
#property indicator_color6 Black
double g_ibuf_76[];
double g_ibuf_80[];
double g_ibuf_84[];
double g_ibuf_88[];
double g_ibuf_92[];
double g_ibuf_96[];
extern color CandleBody = Aqua;
extern color BullCandle = Black;
extern color BearCandle = White;
extern bool IndicatorNameView = FALSE;
int init() {
SetIndexStyle(0, DRAW_HISTOGRAM, STYLE_SOLID, 1, CandleBody);
SetIndexBuffer(0, g_ibuf_76);
SetIndexStyle(1, DRAW_HISTOGRAM, STYLE_SOLID, 1, CandleBody);
SetIndexBuffer(1, g_ibuf_80);
SetIndexStyle(2, DRAW_HISTOGRAM, STYLE_SOLID, 3, CandleBody);
SetIndexBuffer(2, g_ibuf_84);
SetIndexStyle(3, DRAW_HISTOGRAM, STYLE_SOLID, 3, CandleBody);
SetIndexBuffer(3, g_ibuf_88);
SetIndexStyle(4, DRAW_HISTOGRAM, STYLE_SOLID, 2, BearCandle);
SetIndexBuffer(4, g_ibuf_92);
SetIndexStyle(5, DRAW_HISTOGRAM, STYLE_SOLID, 2, BullCandle);
SetIndexBuffer(5, g_ibuf_96);
SetIndexBuffer(0, g_ibuf_76);
SetIndexBuffer(1, g_ibuf_80);
SetIndexBuffer(2, g_ibuf_84);
SetIndexBuffer(3, g_ibuf_88);
SetIndexBuffer(4, g_ibuf_92);
SetIndexBuffer(5, g_ibuf_96);
SetIndexShift(0, 15);
SetIndexShift(1, 15);
SetIndexShift(2, 15);
SetIndexShift(3, 15);
SetIndexShift(4, 15);
SetIndexShift(5, 15);
return (0);
}
int deinit() {
ObjectDelete("Label_XObject1");
return (0);
}
int start() {
double ld_8;
double ld_16;
double ld_24;
double ld_32;
double ld_40;
double ld_48;
double l_close_56;
double ld_64;
double ld_72;
if (IndicatorNameView == TRUE) {
ObjectCreate("Label_XObject1", OBJ_LABEL, 0, 0, 0);
ObjectSet("Label_XObject1", OBJPROP_XDISTANCE, 230);
ObjectSet("Label_XObject1", OBJPROP_YDISTANCE, 2);
ObjectSetText("Label_XObject1", "Future Candles Pro", 10, "System", CandleBody);
}
int l_ind_counted_0 = IndicatorCounted();
int li_4 = 14;
double ld_112 = 0;
double ld_120 = 0;
double ld_128 = 0;
double ld_136 = 0;
double ld_144 = 0;
for (int li_152 = 14; li_152 >= 0; li_152--) {
l_close_56 = Close[li_152];
ld_128 += l_close_56;
}
ld_128 /= 15.0;
for (li_152 = 3; li_152 >= 0; li_152--) {
l_close_56 = Close[li_152];
ld_144 += l_close_56;
}
ld_144 /= 4.0;
ld_136 = ld_144;
while (li_4 >= 1) {
ld_8 = High[li_4];
if (ld_136 < ld_8) {
ld_112 = ld_8 - ld_136;
ld_8 = ld_136 - ld_112;
} else {
ld_112 = ld_136 - ld_8;
ld_8 = ld_136 + ld_112;
}
ld_16 = Low[li_4];
if (ld_136 < ld_16) {
ld_112 = ld_16 - ld_136;
ld_16 = ld_136 - ld_112;
} else {
ld_112 = ld_136 - ld_16;
ld_16 = ld_136 + ld_112;
}
ld_32 = Close[li_4];
if (ld_136 < ld_32) {
ld_112 = ld_32 - ld_136;
ld_32 = ld_136 - ld_112;
} else {
ld_112 = ld_136 - ld_32;
ld_32 = ld_136 + ld_112;
}
ld_24 = Open[li_4];
if (ld_136 < ld_24) {
ld_112 = ld_24 - ld_136;
ld_24 = ld_136 - ld_112;
} else {
ld_112 = ld_136 - ld_24;
ld_24 = ld_136 + ld_112;
}
g_ibuf_76[li_4] = ld_8;
g_ibuf_80[li_4] = ld_16;
g_ibuf_84[li_4] = ld_24;
g_ibuf_88[li_4] = ld_32;
if (ld_24 > ld_32) {
ld_40 = ld_24 - 1.0 * Point;
ld_48 = ld_32 + 1.0 * Point;
} else {
ld_40 = ld_24 + 1.0 * Point;
ld_48 = ld_32 - 1.0 * Point;
}
g_ibuf_92[li_4] = ld_40;
g_ibuf_96[li_4] = ld_48;
if (li_4 == 14) {
ld_64 = ld_24;
ld_72 = ld_32;
}
li_4--;
}
ld_112 = (Open[0] + Close[0]) / 2.0;
ld_120 = (ld_64 + ld_72) / 2.0;
g_ibuf_84[14] = ld_112;
g_ibuf_88[14] = ld_120;
if (ld_112 > ld_120) {
g_ibuf_92[14] = ld_112 - 1.0 * Point;
g_ibuf_96[14] = ld_120 + 1.0 * Point;
g_ibuf_80[14] = ld_112;
} else {
g_ibuf_92[14] = ld_112 + 1.0 * Point;
g_ibuf_96[14] = ld_120 - 1.0 * Point;
g_ibuf_76[14] = ld_120;
}
ld_112 = Open[0];
g_ibuf_76[15] = ld_112 + 10000.0 * Point;
g_ibuf_80[15] = ld_112 + 10000.0 * Point;
g_ibuf_84[15] = ld_112 + 10000.0 * Point;
g_ibuf_88[15] = ld_112 + 10000.0 * Point;
g_ibuf_92[15] = ld_112 + 10000.0 * Point;
g_ibuf_96[15] = ld_112 + 10000.0 * Point;
return (0);
}
Comments