HOW TO EXPLICITLY CONTROL BAR OPENING TIME IN EA
-
Hi everyone,
I have an EA that I am working on, it is being executed at every tick. I want the functions to be executed at the CLOSE of each bar (say if attached to a one hour chart) and not at every tick. I'd use this piece of code, but how to get something equivalent in fxDreema?
Thanks in advance
bool New_Bar=false;
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{
//------------------------------------------------------------------+
Fun_New_Bar();
if (New_Bar == false)
return;
//------------------------------------------------------------------+
{}
}
//+------------------------------------------------------------------+
void Fun_New_Bar()
{
static datetime New_Time = 0;
New_Bar = false;
if (New_Time!= Time[0])
{
New_Time = Time[0];
New_Bar = true;
}
}
//-------------------------------------------------------------------+ -
There is a block called "Once per bar", it does basically the same thing as in your example.
-
Thank you Radoslav. I've tried and it works correctly. Moreover now I get same result for both the testing models ("every tick" and "Open prices only")
