Function on calculate
NFONSECA:
Hi experts, I have aproblem in an indicator.
I just want to compare a time in hour in on canculate function, but I don't know what is the format I must use, some help will bem welcome.
thanks,
for(int i=4; i<rates_total; i++)
{
if time[i] = 09:00:00
{
CompraBuffer[i]=low[i];
}
else
{
CompraBuffer[i]=0;
}
Hello,
Do it like this:
if (time[i] >= D'2018.07.25 09:00:00') { ... }
Atention 1: you are using equal signal as atribution. This is atribution "=", this is comparation "==".
Atention 2, if you use equal signal (==) to check the time, you have to have a tick with exactly the same date / time conted in seconds.

Você está perdendo oportunidades de negociação:
- Aplicativos de negociação gratuitos
- 8 000+ sinais para cópia
- Notícias econômicas para análise dos mercados financeiros
Registro
Login
Você concorda com a política do site e com os termos de uso
Se você não tem uma conta, por favor registre-se
Hi experts, I have aproblem in an indicator.
I just want to compare a time in hour in on canculate function, but I don't know what is the format I must use, some help will bem welcome.
thanks,
for(int i=4; i<rates_total; i++)
{
if time[i] = 09:00:00
{
CompraBuffer[i]=low[i];
}
else
{
CompraBuffer[i]=0;
}