 |
 |
|
 |
|
لو سمحت ف المؤشر الى ف الدرس الثامن (الموفنج افرج) انا عملت عليه التعديل ده
علشان شايف ان كدا اسهل
انا صح و لا غلط !!؟
كود:
//+------------------------------------------------------------------+
//| auto ma.mq4 |
//| ahmed saleh |
//| facebook |
//+------------------------------------------------------------------+
#property copyright "ahmed saleh"
#property link "facebook"
#property indicator_chart_window
extern int maperiod =20;
extern int mashift =0;
extern int mamethod =0;
extern int appliedpriceto =0;
double mm ;
double MaCal[];
double auto_period;
int init()
{
int period = Period();
switch(period)
{
case 5: mm=12 ;break;
case 15: mm=4 ;break;
case 30: mm=2 ;break;
case 60: mm=1 ;break;
case 240:mm=0.25 ;break;
}
auto_period=maperiod*mm;
SetIndexBuffer(0,MaCal);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1,Red);
SetIndexDrawBegin(0,auto_period);
SetIndexLabel(0,"auto ma");
return(0);
}
int deinit()
{
return(0);
}
int start()
{
int counted_bars=IndicatorCounted();
if (counted_bars<0)
return(-1);
//if (counted_bars>0)//
//counted_bars--;//
// int uncounted_bars = Bars-counted_bars;//
for(int i=0;i<Bars;i++)
{
MaCal[i]= iMA(NULL,0,auto_period,mashift,mamethod,appliedpriceto,i);
}
return(0);
}
|
|
 |
|
 |
،،،بهذا التعديل انت تجبر المؤشر على حساب معادلة الموفينج لكل الشموع كل تك سعرى وهذا يتسبب فى تهنيج المنصة وتقليل كفاءة المؤشر،،،