But it gives me ten times the same value, even if the indicator is of course changing. In this example I put sleep(60000) because I checked at M1 period.
And the same happens whith RSI or copy/pasting the two command lines with iMomentum function after time pauses, without the loop.
Hello, I'm new here and trying to develop a simple tool using imomentum.
I am trying to check the Momentum value every candle, using this loop
for(int i=1; i <= 10; i++) {
double momentum = iMomentum(NULL,0,14,PRICE_OPEN,0);
double value = NormalizeDouble(momentum,4);
Print (value);
Sleep (60000);
}
But it gives me ten times the same value, even if the indicator is of course changing. In this example I put sleep(60000) because I checked at M1 period.
And the same happens whith RSI or copy/pasting the two command lines with iMomentum function after time pauses, without the loop.
What am I missing?