http://docs.mql4.com/array/ArrayCopySeries
There is no real memory allocation for data array and nothing is copied. When such an array is accessed, the access is redirected.
I have this NewBar() function
Now my Question: I might need such for all possible TimeFrames.
is it better to do it like this: e.g. M15
OR like this:
There is no real memory allocation for data array and nothing is copied. When such an array is accessed, the access is redirected.
I have this NewBar() function
Inserted Code
bool NewBar()
{
static datetime dt = 0;
if (Time[0] != dt)
{
dt = Time[0];
return(true);
}
return(false);
} is it better to do it like this: e.g. M15
Inserted Code
//in the light of:
[i]//There is no real memory allocation for
//data array and nothing is copied.
//When such an array is accessed,
// the access is redirected.
[/i]
[color=Blue]datetime dtArTimeM15[];
ArrayCopySeries(dtArTimeM15, MODE_TIME, sPairName, [/color][color=Blue]PERIOD_M15);
[/color]
bool NewBarM15()
{
static datetime dt = 0;
if ([color=Blue]dtArTimeM15[0][/color] != dt)
{
dt =[color=Blue]dtArTimeM15[0];[/color]
return(true);
}
return(false);
} Inserted Code
bool NewBarM15()
{
static datetime dt = 0;
if ([color=Blue]iTime(sPairName, PERIOD_M15, 0)[/color] != dt)
{
dt =[color=Blue] iTime(sPairName, PERIOD_M15, 0)[/color];
return(true);
}
return(false);
} __Thanks__ MJ