عرض مشاركة واحدة
قديم 28-03-2013, 05:18 PM   المشاركة رقم: 102
الكاتب
MOVING_AVERAGE
عضو فضى
الصورة الرمزية MOVING_AVERAGE

البيانات
تاريخ التسجيل: Feb 2012
رقم العضوية: 8190
الدولة: algeria
العمر: 42
المشاركات: 2,213
بمعدل : 0.45 يوميا

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

كاتب الموضوع : MOVING_AVERAGE المنتدى : منتدى المؤشرات و الاكسبيرتات
افتراضي رد: دورة تعليم برمجة الاكسبريت

المشاركة الأصلية كتبت بواسطة imaddine نقره لعرض الصورة في صفحة مستقلة
هذا هو الكود استاذ موفنج
[PHP]#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 Yellow
#property indicator_color4 Lime
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2

double CrossUp1[];
double CrossDown1[];
double FastMA[];
double SlowMA[];
int width=EMPTY;
color clr=CLR_NONE;

extern int ExtPeriodFastMA = 8;
extern int ExtPeriodSlowMA = 14;

extern int ExtModeFastMA = 0;
extern int ExtModeSlowMA = 0;

extern int ExtPriceFastMA = 0;
extern int ExtPriceSlowMA = 0;
extern bool showMA=true;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{

//---- indicators
SetIndexStyle( 0, DRAW_ARROW, EMPTY);
SetIndexArrow(0, 234);
SetIndexBuffer(0, CrossDown1);

SetIndexStyle( 1, DRAW_ARROW, EMPTY);
SetIndexArrow(1, 233);
SetIndexBuffer(1, CrossUp1);

SetIndexStyle( 2, DRAW_LINE );
SetIndexBuffer( 2, FastMA );
SetIndexStyle( 3, DRAW_LINE );
SetIndexBuffer( 3, SlowMA );


//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int x,i, counter;
double Range, AvgRange;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
x=Bars-counted_bars;

for(i =0 ; i<x ; i++)
{
if(showMA==true)
{
FastMA[i] = iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i );
SlowMA[i] = iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i );
}
Range=0;
AvgRange=0;
for (counter=i ;counter<=i+9;counter++)
{
AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
}
Range=AvgRange/10;
double fasterEMAprevious=iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i+1 );
double fasterEMAprevious1=iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i+2 );
double slowerEMAprevious =iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i+1 );
double slowerEMAprevious1 =iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i+2 );
if(fasterEMAprevious<slowerEMAprevious&&fasterEMAp revious1>slowerEMAprevious1)
{
CrossDown1[i+1]=High[i+1]+Range*0.5;
}
if(fasterEMAprevious>slowerEMAprevious&&fasterEMAp revious1<slowerEMAprevious1)
{
CrossUp1[i+1]=Low[i+1]-Range*0.5;

}


}

//----

//----
return(0);
}
//+------------------------------------------------------------------+[/PHP]
تمام هذا نفس المؤشر الذي شرحناه



التوقيع

نقره لعرض الصورة في صفحة مستقلة







عرض البوم صور MOVING_AVERAGE  
رد مع اقتباس
  #102  
قديم 28-03-2013, 05:18 PM
MOVING_AVERAGE MOVING_AVERAGE غير متواجد حالياً
عضو فضى
افتراضي رد: دورة تعليم برمجة الاكسبريت

المشاركة الأصلية كتبت بواسطة imaddine نقره لعرض الصورة في صفحة مستقلة
هذا هو الكود استاذ موفنج
[PHP]#property indicator_chart_window
#property indicator_buffers 4
#property indicator_color1 Red
#property indicator_color2 Blue
#property indicator_color3 Yellow
#property indicator_color4 Lime
#property indicator_width1 2
#property indicator_width2 2
#property indicator_width3 2
#property indicator_width4 2

double CrossUp1[];
double CrossDown1[];
double FastMA[];
double SlowMA[];
int width=EMPTY;
color clr=CLR_NONE;

extern int ExtPeriodFastMA = 8;
extern int ExtPeriodSlowMA = 14;

extern int ExtModeFastMA = 0;
extern int ExtModeSlowMA = 0;

extern int ExtPriceFastMA = 0;
extern int ExtPriceSlowMA = 0;
extern bool showMA=true;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{

//---- indicators
SetIndexStyle( 0, DRAW_ARROW, EMPTY);
SetIndexArrow(0, 234);
SetIndexBuffer(0, CrossDown1);

SetIndexStyle( 1, DRAW_ARROW, EMPTY);
SetIndexArrow(1, 233);
SetIndexBuffer(1, CrossUp1);

SetIndexStyle( 2, DRAW_LINE );
SetIndexBuffer( 2, FastMA );
SetIndexStyle( 3, DRAW_LINE );
SetIndexBuffer( 3, SlowMA );


//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int x,i, counter;
double Range, AvgRange;
int counted_bars=IndicatorCounted();
if(counted_bars<0) return(-1);
if(counted_bars>0) counted_bars--;
x=Bars-counted_bars;

for(i =0 ; i<x ; i++)
{
if(showMA==true)
{
FastMA[i] = iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i );
SlowMA[i] = iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i );
}
Range=0;
AvgRange=0;
for (counter=i ;counter<=i+9;counter++)
{
AvgRange=AvgRange+MathAbs(High[counter]-Low[counter]);
}
Range=AvgRange/10;
double fasterEMAprevious=iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i+1 );
double fasterEMAprevious1=iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i+2 );
double slowerEMAprevious =iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i+1 );
double slowerEMAprevious1 =iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i+2 );
if(fasterEMAprevious<slowerEMAprevious&&fasterEMAp revious1>slowerEMAprevious1)
{
CrossDown1[i+1]=High[i+1]+Range*0.5;
}
if(fasterEMAprevious>slowerEMAprevious&&fasterEMAp revious1<slowerEMAprevious1)
{
CrossUp1[i+1]=Low[i+1]-Range*0.5;

}


}

//----

//----
return(0);
}
//+------------------------------------------------------------------+[/PHP]
تمام هذا نفس المؤشر الذي شرحناه




رد مع اقتباس