اف اكس ارابيا..الموقع الرائد فى تعليم فوركس Forex

اف اكس ارابيا..الموقع الرائد فى تعليم فوركس Forex (https://fx-arabia.com/vb/index.php)
-   منتدى المؤشرات و الاكسبيرتات (https://fx-arabia.com/vb/forumdisplay.php?f=6)
-   -   دورة تعلم البرمجة باحتراف (https://fx-arabia.com/vb/showthread.php?t=27491)

MOVING_AVERAGE 15-02-2013 03:01 PM

رد: دورة تعلم البرمجة باحتراف
 
الكتابة التالية تكون كالتالي

[PHP]

#property indicator_color1 Red
#property indicator_color2 Blue
كتابة الاسهم السابقة

#property indicator_color3 Yellow
#property indicator_color4 Lime
كتابة الكائنات الجديدة لخطوط الموفينجات
[/PHP]

MOVING_AVERAGE 15-02-2013 03:02 PM

رد: دورة تعلم البرمجة باحتراف
 
كل الكتابة ستكون

[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
[/PHP]

MOVING_AVERAGE 15-02-2013 03:05 PM

رد: دورة تعلم البرمجة باحتراف
 
كتابة مصفوفتين لخطوط الموفينج

[PHP]
double FastMA[];
double SlowMA[];
[/PHP]

ستكون الكتابة الكلية كالتالي

[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



double CrossUp1[];
double CrossDown1[];

double FastMA[];
double SlowMA[];
[/PHP]

MOVING_AVERAGE 15-02-2013 03:08 PM

رد: دورة تعلم البرمجة باحتراف
 
الكائن الثالث يحمل الرقم 2 ولونه اصفر

الكائن الرابع يحمل الرقم 3 ولونه اخضر

MOVING_AVERAGE 15-02-2013 03:10 PM

رد: دورة تعلم البرمجة باحتراف
 
تحديد نوع الكائن 3 و 4

كما قلنا الكائن 3 و 4 عبارة عن خطوط لذا سيكون النوع هذه المرة خط

[PHP]
SetIndexStyle( 2, DRAW_LINE );
SetIndexStyle( 3, DRAW_LINE );
[/PHP]

MOVING_AVERAGE 15-02-2013 03:12 PM

رد: دورة تعلم البرمجة باحتراف
 
لاتوجد اشكال للخطوط

ربط الخط بالمصفوقة سيكون كالتالي

[PHP]
SetIndexBuffer( 2, FastMA );
SetIndexBuffer( 1, SlowMA );
[/PHP]

الكتابة الكلية تكون كالتالي

[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



double CrossUp1[];
double CrossDown1[];

double FastMA[];
double SlowMA[];



//+------------------------------------------------------------------+
//| 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( 1, SlowMA );


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

//----
return(0);
}
[/PHP]

MOVING_AVERAGE 15-02-2013 03:15 PM

رد: دورة تعلم البرمجة باحتراف
 
الان ندخل الي الدالة start

ونكتب حلقة for لاتكرارية

[PHP]
int start()
{
int x,i;
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++)
{



}

return(0);
}
[/PHP]

MOVING_AVERAGE 15-02-2013 03:18 PM

رد: دورة تعلم البرمجة باحتراف
 
الان نجمع اكواد الكائنات الرسومية مع الحلقة التكرارية سيكون لدينا التالي

[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



double CrossUp1[];
double CrossDown1[];

double FastMA[];
double SlowMA[];



//+------------------------------------------------------------------+
//| 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;
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++)
{



}

return(0);
}
[/PHP]

MOVING_AVERAGE 15-02-2013 03:34 PM

رد: دورة تعلم البرمجة باحتراف
 
نضع خطوط الموفينجات

وهنا خط الموفينج سياخذ اخر قيمة يعني سيكون بدلالة i

يجب ان نترك الموفينج مرن اي ممكن نتحكم باعدداته الخارجية له

الاعددات الخارجية التي تهمنا في الموفينج

1- دور الموفينج

سنستعمل متغيرين خارجيين للتعبير عم دور الموفينج

[PHP]
extern int ExtPeriodFastMA = 7;
extern int ExtPeriodSlowMA = 15;
[/PHP]سنكتب هذين المتغيرين خارج الدالة ستار

2-الاعتماد نوع الموفينج هل هو سمبل اكسبنشل او غيرها

سنستعمل ايضا متغيرين للتعبير عن النوع

[PHP]
extern int ExtModeFastMA = 1;
extern int ExtModeSlowMA = 1;
[/PHP]فرضنا اننا سنستخدم الاكسبنشل في النوعين

3- الاغلقات او الافتتحات

وكما سبق سنستعمل متغيرين خارجيين لتحديد هذ المتغير

[PHP]
extern int ExtPriceFastMA = 0;
extern int ExtPriceSlowMA = 0;
[/PHP]فرضا اننا استعملنا الاغلاقات في كلا الموفينجين

MOVING_AVERAGE 15-02-2013 03:38 PM

رد: دورة تعلم البرمجة باحتراف
 
تكون كتابة الموفينجين داخل الحلقة التكرارية كالتالي

[PHP]
FastMA[i] = iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i );
SlowMA[i] = iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i );
[/PHP]

كتابة كل الكود حتي الان

[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



double CrossUp1[];
double CrossDown1[];

double FastMA[];
double SlowMA[];

extern int ExtPeriodFastMA = 7;
extern int ExtPeriodSlowMA = 15;
extern int ExtModeFastMA = 1;
extern int ExtModeSlowMA = 1;
extern int ExtPriceFastMA = 0;
extern int ExtPriceSlowMA = 0;



//+------------------------------------------------------------------+
//| 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;
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++)
{

FastMA[i] = iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i );
SlowMA[i] = iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i );

}

return(0);
}
[/PHP]


الساعة الآن 05:31 AM

Powered by vBulletin® Copyright ©2000 - 2024

جميع الحقوق محفوظة الى اف اكس ارابيا www.fx-arabia.com