أكيد موجود فيه الأمكانيات وأكثر تفضل كود فلترة ساعات عمل وقت محدد كمثال
#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();
}