عرض مشاركة واحدة
قديم 20-06-2012, 12:50 PM   المشاركة رقم: 2
الكاتب
forex911
عضو جديد

البيانات
تاريخ التسجيل: May 2011
رقم العضوية: 4031
المشاركات: 33
بمعدل : 0.01 يوميا

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

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

أكيد موجود فيه الأمكانيات وأكثر تفضل كود فلترة ساعات عمل وقت محدد كمثال


#include <stdlib.mqh>
#include <WinUser32.mqh>

// exported variables
extern int HoursFrom1 = 1;
extern int HoursTo1 = 23;


// local variables
double PipValue=1; // this variable is here to support 5-digit brokers
bool Terminated = false;
string LF = "\n"; // use this in custom or utility blocks where you need line feeds
int NDigits = 4; // used mostly for NormalizeDouble in Flex type blocks
int ObjCount = 0; // count of all objects created on the chart, allows creation of objects with unique names
int current = 0;



int init()
{
NDigits = Digits;

if (false) ObjectsDeleteAll(); // clear the chart


Comment(""); // clear the chart
}

// Expert start
int start()
{
if (Bars < 10)
{
Comment("Not enough bars");
return (0);
}
if (Terminated == true)
{
Comment("EA Terminated.");
return (0);
}

OnEveryTick2();

}

void OnEveryTick2()
{
if (true == false && false) PipValue = 10;
if (true && (NDigits == 3 || NDigits == 5)) PipValue = 10;

HoursFilter1();

}

void HoursFilter1()
{
int datetime800 = TimeLocal();
int hour0 = TimeHour(datetime800);

if ((HoursFrom1 < HoursTo1 && hour0 >= HoursFrom1 && hour0 < HoursTo1) ||
(HoursFrom1 > HoursTo1 && (hour0 < HoursTo1 || hour0 >= HoursFrom1)))
{

}
}



int deinit()
{
if (false) ObjectsDeleteAll();


}



عرض البوم صور forex911  
رد مع اقتباس
  #2  
قديم 20-06-2012, 12:50 PM
forex911 forex911 غير متواجد حالياً
عضو جديد
افتراضي رد: سؤال عن امكانيات لغة MQL4

أكيد موجود فيه الأمكانيات وأكثر تفضل كود فلترة ساعات عمل وقت محدد كمثال


#include <stdlib.mqh>
#include <WinUser32.mqh>

// exported variables
extern int HoursFrom1 = 1;
extern int HoursTo1 = 23;


// local variables
double PipValue=1; // this variable is here to support 5-digit brokers
bool Terminated = false;
string LF = "\n"; // use this in custom or utility blocks where you need line feeds
int NDigits = 4; // used mostly for NormalizeDouble in Flex type blocks
int ObjCount = 0; // count of all objects created on the chart, allows creation of objects with unique names
int current = 0;



int init()
{
NDigits = Digits;

if (false) ObjectsDeleteAll(); // clear the chart


Comment(""); // clear the chart
}

// Expert start
int start()
{
if (Bars < 10)
{
Comment("Not enough bars");
return (0);
}
if (Terminated == true)
{
Comment("EA Terminated.");
return (0);
}

OnEveryTick2();

}

void OnEveryTick2()
{
if (true == false && false) PipValue = 10;
if (true && (NDigits == 3 || NDigits == 5)) PipValue = 10;

HoursFilter1();

}

void HoursFilter1()
{
int datetime800 = TimeLocal();
int hour0 = TimeHour(datetime800);

if ((HoursFrom1 < HoursTo1 && hour0 >= HoursFrom1 && hour0 < HoursTo1) ||
(HoursFrom1 > HoursTo1 && (hour0 < HoursTo1 || hour0 >= HoursFrom1)))
{

}
}



int deinit()
{
if (false) ObjectsDeleteAll();


}




رد مع اقتباس