Darvas Box Indicator For MT5
Table Of Contents:
- Darvas Box Indicator For MT5
- Cài đặt Darvas Box Indicator For MT5
- Các tham số của Darvas Box Indicator For MT5
- Bộ đệm của Darvas Box Indicator For MT5
- Các bộ phận chính của bộ luật
Darvas Box Indicator For MT5 dựa trên công trình của Nicolas Darvas. Hộp Darvas được sử dụng để giao dịch theo hướng của mức cao mới và mức thấp mới. Các hộp giúp dễ dàng phát hiện các đột phá như vậy. Chỉ báo này vẽ một kênh dựa trên tính toán hộp darvas. Ranh giới trên của kênh được vẽ bằng màu xanh lam trong khi ranh giới dưới của kênh được vẽ bằng màu tím.
Cài đặt Darvas Box Indicator For MT5
Sau khi bạn tải xuống chỉ báo qua biểu mẫu ở trên, bạn cần giải nén tệp zip. Sau đó, bạn cần sao chép tệp darvasboxes.mq5 vào thư mục MQL5Indicators cài đặt MT5 của bạn. Sau đó, vui lòng khởi động lại MT5 và sau đó bạn sẽ có thể thấy chỉ báo trong danh sách các chỉ báo.
Các tham số của Darvas Box Indicator For MT5
Darvas Box Indicator For MT5 có các tham số 2 để cấu hình.
input bool symmetry=false; input int Shift=0; // Horizontal shift of the indicator in bars
Bộ đệm của Darvas Box Indicator For MT5
Darvas Box Indicator For MT5 cung cấp bộ đệm 2 .
SetIndexBuffer(0,UpperBuffer,INDICATOR_DATA); SetIndexBuffer(1,LowerBuffer,INDICATOR_DATA);
Các bộ phận chính của bộ luật
int OnCalculate(const int rates_total, // number of bars in history at the current tick const int prev_calculated,// number of bars calculated at previous call const datetime &time[], const double &open[], const double &high[], const double &low[], const double &close[], const long &tick_volume[], const long &volume[], const int &spread[]) { //---- checking the number of bars to be enough for the calculation if(rates_total lt start) return(0); //---- indexing elements in arrays as timeseries ArraySetAsSeries(high,true); ArraySetAsSeries(low,true); //---- declaration of integer variables int limit,bar; //---- declaration of static variables static int state,STATE; static double box_top,box_bottom,BOX_TOP,BOX_BUTTOM; //---- calculations of the limit starting index for the bars recalculation loop if(prev_calculated gt rates_total || prev_calculated lt =0)// checking for the first start of the indicator calculation { limit=rates_total-start; // starting index for calculation of all bars BOX_TOP=high[limit+1]; BOX_BUTTOM=low[limit+1]; STATE=1; } else { limit=rates_total-prev_calculated; // starting index for calculation of new bars } //---- restore values of the variables state=STATE; box_top=BOX_TOP; box_bottom=BOX_BUTTOM; //---- main indicator calculation loop for(bar=limit; bar gt =0; bar--) { //---- store values of the variables before running at the current bar if(rates_total!=prev_calculated && bar==0) { STATE=state; BOX_TOP=box_top; BOX_BUTTOM=box_bottom; } switch(state) { case 1: box_top=high[bar]; if(symmetry)box_bottom=low[bar]; break; case 2: if(box_top lt =high[bar]) box_top=high[bar]; break; case 3: if(box_top gt high[bar]) box_bottom=low[bar]; else box_top=high[bar]; break; case 4: if(box_top gt high[bar]) {if(box_bottom gt = low[bar]) box_bottom=low[bar];} else box_top=high[bar]; break; case 5: if(box_top gt high[bar]) {if(box_bottom gt = low[bar]) box_bottom=low[bar];} else box_top=high[bar]; state=0; break; } UpperBuffer[bar] = box_top; LowerBuffer[bar] = box_bottom; state++; } //---- return(rates_total); } //+------------------------------------------------------------------+