ممكن اضافة alert+sms لهذا المؤشر
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color4 Gold
double Up_Up[];
double Down_Up[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicator buffers mapping
SetIndexBuffer(0, Up_Up);
SetIndexBuffer(1, Down_Up);
//---- drawing settings
SetIndexStyle(0, DRAW_ARROW, STYLE_SOLID, 2);
SetIndexArrow(0, 251);
SetIndexStyle(1, DRAW_ARROW, STYLE_SOLID, 2);
SetIndexArrow(1, 119);
//----
SetIndexEmptyValue(0, EMPTY_VALUE);
SetIndexEmptyValue(1, EMPTY_VALUE);
//----
SetIndexLabel(0, "Up/Up");
SetIndexLabel(1, "Down/Up");
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int nBars, nCountedBars;
nCountedBars = IndicatorCounted();
//---- check for possible errors
if (nCountedBars < 0) return(-1);
//---- last counted bar will be recounted
if (nCountedBars > 1)
{
nCountedBars--;
nBars = Bars - nCountedBars;
if (nBars == Bars) nBars--;
}
else nBars = Bars - 1;
for (int i = 0; i < nBars; i++)
{
Up_Up[i] = EMPTY_VALUE;
Down_Up[i] = EMPTY_VALUE;
double MFI = iBWMFI(NULL, 0, i);
double MFI_prev = iBWMFI(NULL, 0, i + 1);
double Vol = iVolume(NULL, 0, i);
double Vol_prev = iVolume(NULL, 0, i + 1);
double MFI_diff = MFI - MFI_prev;
double Vol_diff = Vol - Vol_prev;
if ((MFI_diff >= 0) && (Vol_diff >= 0)) Up_Up[i] = High[i] + Point * 5;
else if ((MFI_diff < 0) && (Vol_diff >= 0)) Down_Up[i] = High[i] + Point * 5;
}
return(0);
}