الموضوع: MR.Moving average
عرض مشاركة واحدة
قديم 26-03-2013, 03:09 AM   المشاركة رقم: 1
الكاتب
gozila
عضو جديد

البيانات
تاريخ التسجيل: Sep 2010
رقم العضوية: 1504
العمر: 55
المشاركات: 14
بمعدل : 0.00 يوميا

الإتصالات
الحالة:
gozila غير متواجد حالياً
وسائل الإتصال:

المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي MR.Moving average

ممكن اضافة 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);
}



عرض البوم صور gozila  
رد مع اقتباس


  #1  
قديم 26-03-2013, 03:09 AM
gozila gozila غير متواجد حالياً
عضو جديد
افتراضي MR.Moving average

ممكن اضافة 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);
}





رد مع اقتباس