اف اكس ارابيا..الموقع الرائد فى تعليم فوركس 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:41 PM

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

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

وفي كل قيمة للحلقة التكرارية وضعنا قيمة الموفينج المحدد في المصفوفة المرافقة

وعند جمع كل القيم تقوم المصفوفة باضهار خط يكون متوافق تمام مع خط الموفينج

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

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

MOVING_AVERAGE 15-02-2013 03:48 PM

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

سنستعمل متغير من النوع المنطقي

وهذا النوع كما قلنا من قبل يحمل قيمتين

سنجعل الخطوط تضهر علي حسب قيمة هذا المتغير

[PHP]
extern bool showMA=true
[/PHP]

ويكون كود الاضهار او عدم الاضهار كالتالي

[PHP]
if(showMA==true)
{
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


extern bool showMA=true;

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++)
{
if(showMA==true)
{
FastMA[i] = iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i );
SlowMA[i] = iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i );
}

}

return(0);
}

[/PHP]

انا تعبت من الكتابة ساخذ شوية راحة ونكمل ان شاء الله

MOVING_AVERAGE 22-02-2013 02:42 PM

رد: دورة تعلم البرمجة باحتراف
 
شباب اليوم ان شاء الله ساركز غلي الدورتين فقط لكي انتهي من اول مؤشر واول اكسبريت

Mohamed_Amr 22-02-2013 02:43 PM

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

MOVING_AVERAGE 22-02-2013 02:44 PM

رد: دورة تعلم البرمجة باحتراف
 
بالغودة الي ما سبق وصلنا في المؤشر الي رسم خطين ورسم سهمين علي الشارت

واختيار اضهارهما او لا

MOVING_AVERAGE 22-02-2013 02:51 PM

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

انا لا خضت ان خطوط الموفينج ليست واضحة كتيرا

فاريد الزيادة في سمكها

ساستخدم

[PHP]
#property indicator_width3 2
#property indicator_width4 2
[/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
#property indicator_width3 2
#property indicator_width4 2


extern bool showMA=true;

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++)
{
if(showMA==true)
{
FastMA[i] = iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i );
SlowMA[i] = iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i );
}

}

return(0);
}
[/PHP]

MOVING_AVERAGE 22-02-2013 03:28 PM

رد: دورة تعلم البرمجة باحتراف
 
الان ندخل علي التقاطعات وكما قلنا سابقا نعرف التقاطع اذا تغير ترتيب الموفينجات في الشمعة السابقة و الشمعة قبل السابقة

نكتب الشمعة قبل السابقة في الكود الخاص بنا

توجد عدة طرق لعمل التقاطع نحن سنستعمل الطريقة التي تترجم ما كتبناه سابقا

نستعمل 4 متغيرات جديدة

2 للشمعة السابقة و 2 للشمعة قبل السابقة

في المتغيرين للشمعة السابقة نضع قيم الموفينج 7 و 15

[PHP]
double fasterEMAprevious=iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i+1 );
double slowerEMAprevious =iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i+1 );
[/PHP]ونفس الشئ بالنسبة للشمعة قبل السابقة

[PHP]
double fasterEMAprevious1=iMA( NULL, 0, ExtPeriodFastMA, 0, ExtModeFastMA, ExtPriceFastMA, i+2 );
double slowerEMAprevious1 =iMA( NULL, 0, ExtPeriodSlowMA, 0, ExtModeSlowMA, ExtPriceSlowMA, i+2 );
[/PHP]

MOVING_AVERAGE 22-02-2013 03:33 PM

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

سنكتب التقاطع كما قلنا سابقا

الاتجاه يكون صاعد اذا كان الموفينج سابقا نازل ثم اصبح صاعد

وبترجمة الي لغة البرنامج

الاتجاه صاعد يعني

[PHP]
if(fasterEMAprevious>slowerEMAprevious&&fasterEMAp revious1<slowerEMAprevious1)
[/PHP]

الاتجاه نازل يعني

[PHP]
if(fasterEMAprevious<slowerEMAprevious&&fasterEMAp revious1>slowerEMAprevious1)
[/PHP]

MOVING_AVERAGE 22-02-2013 03:35 PM

رد: دورة تعلم البرمجة باحتراف
 
الان بعد ان وضعنا ترجمة الاتجاه الصاعد والنازل

سنضع ما نريد لما يتحقق الشرط

MOVING_AVERAGE 22-02-2013 03:36 PM

رد: دورة تعلم البرمجة باحتراف
 
ونحن نريد اضهار سهم صاعد لما يتحقق شرط الاتجاه الصاعد

وسهم نازل لما يتحقق شرط الاتجاه النازل


الساعة الآن 03:38 AM

Powered by vBulletin® Copyright ©2000 - 2024

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