版本:MT4 ver. 2.01
供需区域指标基于市场的支撑区和阻力区,非常适合用于外汇交易。这一指标将市场供应和需求的区域划分为更广泛的价格范围,有助于识别长期有效的交易区域。
使用指南
- – 供需区域定义:供应区通常形成于价格急剧下跌后,显示出卖压强劲;需求区则形成于价格急剧上涨后,显示出购买兴趣强烈。
- – 交易策略:在供应区域考虑卖出,在需求区域考虑买入。价格触及这些区域时,通常会见到相应的反弹,交易者可以利用这种可预测性进行交易。
适用对象
- 新手交易者:如果你难以识别单一的支撑位和阻力位,这个指标可能会更有用。
- 专业交易者:虽然专业交易者可能已经能够独立绘制这些区域,但指标的高准确性仍然使其成为分析供需关系时的有力工具。
区域类型
与支撑位和阻力位的区别
供需区域覆盖的是更广泛的价格范围,基于交易量和市场走势,因此比单一的支撑位和阻力位具有更长期的意义,而后者则通常由历史价格触及决定,更适合短期交易。
优点
– 准确性:基于实际市场活动的更可靠的进入/退出点。
– 持久性:随着时间的推移保持相关性,有助于长期交易规划。
参数:
Supply Demand.mq4 |
//|
property version "2.01"
property description "———————————————"
property description "EA、指标公式分享"
property description "EA、
property description "———————————————"
property description
property description
property description
property description "———————————————"
property indicator_chart_window
property indicator_buffers 2
//AHTF Timeframe template copy and paste start11
enum enTimeFrames
{
tf_cu = PERIOD_CURRENT, // Current time frame
tf_m1 = PERIOD_M1, // 1 minute
tf_m5 = PERIOD_M5, // 5 minutes
tf_m15 = PERIOD_M15, // 15 minutes
tf_m30 = PERIOD_M30, // 30 minutes
tf_h1 = PERIOD_H1, // 1 hour
tf_h4 = PERIOD_H4, // 4 hours
tf_d1 = PERIOD_D1, // Daily
tf_w1 = PERIOD_W1, // Weekly
tf_mn1 = PERIOD_MN1, // Monthly
tf_n1 = -1, // First higher time frame
tf_n2 = -2, // Second higher time frame
tf_n3 = -3, // Third higher time frame
tf_n4 = -4 // Fourth higher time frame
};
//AHTF Timeframe template copy and paste end11
//AHTF Timeframe template copy and paste start12
extern enTimeFrames TimeFrame = tf_cu; // Time frame
//AHTF Timeframe template copy and paste end12
extern bool draw_zones = true;
extern bool solid_zones = true;
extern bool solid_retouch = true;
extern bool recolor_retouch = true;
extern bool recolor_weak_retouch = false;
extern bool zone_strength = true;
extern bool no_weak_zones = true;
extern bool draw_edge_price = true;
extern color edge_price_color = clrDarkGray;
extern int zone_width = 1;
extern bool zone_fibs = false;
extern int fib_style = 0;
extern bool HUD_on = false;
extern bool timer_on = false;
extern int layer_zone = 0;
extern int layer_HUD = 20;
extern int corner_HUD = 2;
extern int pos_x = 100;
extern int pos_y = 20;
extern bool alert_on = false;
extern bool alert_popup = false;
extern string alert_sound = "alert.wav";
extern color color_sup_strong = clrIndianRed;
extern color color_sup_weak = clrOlive;
extern color color_sup_retouch = clrSandyBrown;
extern color color_dem_strong = clrSteelBlue;
extern color color_dem_weak = clrLightSteelBlue;
extern color color_dem_retouch = clrLightSteelBlue;
extern color color_fib = clrDodgerBlue;
extern color color_HUD_tf = clrDimGray;
extern color color_arrow_up = clrSeaGreen;
extern color color_arrow_dn = clrCrimson;
extern color color_timer_back = clrDarkGray;
extern color color_timer_bar = clrRed;
extern color color_shadow = clrDarkSlateGray;
extern bool limit_zone_vis = false;
extern bool same_tf_vis = true;
extern bool show_on_m1 = false;
extern bool show_on_m5 = true;
extern bool show_on_m15 = false;
extern bool show_on_m30 = false;
extern bool show_on_h1 = false;
extern bool show_on_h4 = false;
extern bool show_on_d1 = false;
extern bool show_on_w1 = false;
extern bool show_on_mn = false;
extern int Price_Width = 1;
extern int time_offset = 0;
extern bool globals = false;
//Forex-Station button template start41; copy and paste
extern string buttonnote1 = "——————————";
extern int btn_Subwindow = 0; // What window to put the button on. If <0, the button will use the same sub-window as the indicator.
extern ENUM_BASE_CORNER btn_corner = CORNER_LEFT_UPPER; // button corner on chart for anchoring
extern string btn_text = "S&R"; // a button name
extern string btn_Font = "Arial"; // button font name
extern int btn_FontSize = 9; // button font size
extern color btn_text_ON_color = clrLime; // ON color when the button is turned on
extern color btn_text_OFF_color = clrRed; // OFF color when the button is turned off
extern color btn_background_color = clrDimGray; // background color of the button
extern color btn_border_color = clrBlack; // border color the button
extern int button_x = 20; // x coordinate of the button
extern int button_y = 25; // y coordinate of the button
extern int btn_Width = 80; // button width
extern int btn_Height = 20; // button height
extern string UniqueButtonID = "SupplyDemandZones"; // Unique ID for each button
extern string button_note2 = "——————————";
bool show_data, recalc=false;
string IndicatorObjPrefix, buttonId;
double BuferUp1[];
double BuferDn1[];
double sup_RR[4];
double dem_RR[4];
double sup_width,dem_width;
string l_hud,l_zone;
int HUD_x;
string font_HUD = "Arial";
int font_HUD_size = 20;
string font_HUD_price = "Arial Bold";
int font_HUD_price_size = 12;
int arrow_UP = 0x70;
int arrow_DN = 0x71;
string font_arrow = "WingDings 3";
int font_arrow_size = 40;
int font_pair_size = 8;
string arrow_glance;
color color_arrow;
int visible;
int rotation=270;
int lenbase;
string s_base="|||||||||||||||||||||||";
string timer_font="Arial Bold";
int size_timer_font=8;
double min,max;
double iPeriod[4] = {3,8,13,34};
int Dev[4] = {2,5,8,13};
int Step[4] = {2,3,5,8};
datetime t1,t2;
double p1,p2;
string pair;
double point;
int digits;
int tf;
string TAG;
double fib_sup,fib_dem;
int SupCount,DemCount;
int SupAlert,DemAlert;
double up_cur,dn_cur;
double fib_level_array[13]={0,0.236,0.386,0.5,0.618,0.786,1,1.276,1.618,2.058,2.618,3.33,4.236};
string fib_level_desc[13]={"0","23.6%","38.6%","50%","61.8%","78.6%","100%","127.6%","161.8%","205.8%","261.80%","333%","423.6%"};
int hud_timer_x,hud_timer_y,hud_arrow_x,hud_arrow_y,hud_tf_x,hud_tf_y;
int hud_sup_x,hud_sup_y,hud_dem_x,hud_dem_y;
int hud_timers_x,hud_timers_y,hud_arrows_x,hud_arrows_y,hud_tfs_x,hud_tfs_y;
int hud_sups_x,hud_sups_y,hud_dems_x,hud_dems_y;
//+——————————————————————————————————————+
//Forex-Station button template start42; copy and paste
int OnInit()
{
IndicatorDigits(Digits);
IndicatorObjPrefix = "__" + btn_text + "__";
// The leading "" gives buttonId a unique prefix. Furthermore, prepending the swin is usually unique unless >2+ of THIS indy are displayed in the SAME sub-window. (But, if >2 used, be sure to shift the buttonId position)
buttonId = "" + UniqueButtonID + IndicatorObjPrefix + "BT";
if (ObjectFind(buttonId)<0)
createButton(buttonId, btn_text, btn_Width, btn_Height, btn_Font, btn_FontSize, btn_background_color, btn_border_color, btn_text_ON_color);
ObjectSetInteger(0, buttonId, OBJPROP_YDISTANCE, button_y);
ObjectSetInteger(0, buttonId, OBJPROP_XDISTANCE, button_x);
init2();
show_data = ObjectGetInteger(0, buttonId, OBJPROP_STATE);
if (show_data) ObjectSetInteger(0,buttonId,OBJPROP_COLOR,btn_text_ON_color);
else ObjectSetInteger(0,buttonId,OBJPROP_COLOR,btn_text_OFF_color);
return(INIT_SUCCEEDED);
}