FDM Support and Resistance
Download scriptThis technical indicator is designed to analyze market trends and identify potential price action levels by tracking the relationship between price movement and moving averages. Below is a detailed breakdown of its operational logic:
Trend Detection Logic
The script operates by constantly monitoring the closing prices of candles relative to a 10-period Simple Moving Average (SMA). It looks for specific "crossovers"—moments where the price moves from above the average to below it, or vice versa. These transitions serve as the primary triggers for the tool to begin identifying key structural points in the market.
Key Price Level Identification
When a crossover is detected, the script performs a retrospective scan of the recent price history (specifically looking back over the last 20 bars) to find significant milestones:
- High Points: If the price drops below the moving average, the tool identifies the highest peak reached in that recent window.
- Low Points: If the price rises above the moving average, the tool identifies the lowest valley reached in that same timeframe.
Dynamic Visual Mapping
Once these high and low points are established, the script manages a visual "Fibonacci" object on your chart to represent the current trading range. The logic follows these rules:
- Price Action Tracking: It continuously monitors where the current price sits in relation to the identified High and Low levels.
- Automatic Adjustment: If the price breaks significantly above or below the identified range, the script automatically repositions the visual object.
- Zone Management: If the price remains trapped between the two identified points, the tool maintains the current range boundaries, providing a clear visual of the immediate area of interest.
Operational Constraints
The tool includes a built-in verification system to manage access. It checks the current system date against a pre-set expiration date; if the current time exceeds this limit, the script will issue an alert notifying the user that the trial version has concluded and providing instructions on how to obtain the full license.
/*
*/
#property copyright " Copyright © 2008, Forex Day Monster."
#property link " http://www.forexprofitmonster.com"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 White
double g_ibuf_80[];
double g_ibuf_84[];
void SetLoopCount(int ai_unused_0) {
}
void SetIndexValue(int ai_0, double ad_4) {
g_ibuf_80[ai_0] = ad_4;
}
void SetIndexValue2(int ai_0, double ad_4) {
g_ibuf_84[ai_0] = ad_4;
}
int MoveObject(string a_name_0, int ai_8, int a_datetime_12, double ad_16, int a_datetime_24 = 0, double ad_28 = 0.0, color a_color_36 = -1, int ai_unused_40 = 0, int ai_unused_44 = 0) {
int li_48;
if (ObjectFind(a_name_0) != -1) {
li_48 = ObjectType(a_name_0);
if (li_48 == 0 || li_48 == 1 || li_48 == 3 || li_48 == 21 || li_48 == 22 || li_48 == 23) return (ObjectMove(a_name_0, 0, a_datetime_12, ad_16));
if (li_48 == 7 || li_48 == 8 || li_48 == 9 || li_48 == 10 || li_48 == 11 || li_48 == 12 || li_48 == 13 || li_48 == 16 || li_48 == 18 || li_48 == 20 || li_48 == 2 ||
li_48 == 6 || li_48 == 4) return (ObjectMove(a_name_0, 0, a_datetime_12, ad_16) && ObjectMove(a_name_0, 1, a_datetime_24, ad_28));
} else return (ObjectCreate(a_name_0, ai_8, 0, a_datetime_12, ad_16, a_datetime_24, ad_28, 0, 0) && ObjectSet(a_name_0, OBJPROP_COLOR, a_color_36));
return (0);
}
int init() {
SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID);
SetIndexBuffer(0, g_ibuf_80);
SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID);
SetIndexBuffer(1, g_ibuf_84);
return (0);
}
int start() {
string ls_0 = "2015.11.01";
int l_str2time_8 = StrToTime(ls_0);
if (TimeCurrent() >= l_str2time_8) {
Alert(" Trial version has expired! Email support@forexprofitmonster.com with broker account number for rights to full version!");
return (0);
}
int li_12 = 0;
double l_high_16 = 0;
double l_low_24 = 0;
SetLoopCount(0);
for (li_12 = Bars - 1; li_12 >= 0; li_12--) {
if (Close[li_12 + 2] >= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, li_12 + 2) && Close[li_12 + 1] < iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, li_12 + 1)) l_high_16 = High[iHighest(NULL, 0, MODE_HIGH, li_12 + 20, 20)];
if (Close[li_12 + 2] <= iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, li_12 + 2) && Close[li_12 + 1] > iMA(NULL, 0, 10, 0, MODE_SMA, PRICE_CLOSE, li_12 + 1)) l_low_24 = Low[iLowest(NULL, 0, MODE_LOW, li_12 + 20, 20)];
SetIndexValue(li_12, l_high_16);
SetIndexValue2(li_12, l_low_24);
if (Close[li_12 + 1] < l_low_24) MoveObject("trade", OBJ_FIBO, Time[li_12 + 1], l_low_24, Time[li_12 + 1], l_high_16, Green, 1, 1);
else {
if (Close[li_12 + 1] > l_high_16) MoveObject("trade", OBJ_FIBO, Time[li_12 + 1], l_high_16, Time[li_12 + 1], l_low_24, Green, 1, 1);
else
if (Close[li_12 + 1] < l_high_16 && Close[li_12 + 1] > l_low_24) MoveObject("trade", OBJ_FIBO, Time[li_12 + 1], l_high_16, Time[li_12 + 1], l_low_24, Green, 1, 1);
}
}
return (0);
}
Comments