What is
TimeMinute(TimeCurrent())
supposed to do?
You are not counting bull and bear bars, you are counting the same bar every tick and then only if it is less than 36 minutes after the hour when the expert is attached to the chart
Hi!
int / int will return int.
You have to cast one int to double.
double bullbearRatio = (double) bullCount / bearCount;
What is
supposed to do?
You are not counting bull and bear bars, you are counting the same bar every tick and then only if it is less than 36 minutes after the hour when the expert is attached to the chart
What is
supposed to do?
You are not counting bull and bear bars, you are counting the same bar every tick and then only if it is less than 36 minutes after the hour when the expert is attached to the chart
As far as I understand it TimeMinute() returns the minute of the specified time. TimeCurrent() returns the time of the received handled tick.
Ive used these functions to take one time from the bar in tick form and count it as one using the int data type. And then count along each new bar using static modifier.
You can check this here :
void OnTick() { static int barCount = TimeMinute(TimeCurrent()); barCount++; Print(barCount); }
It always counts 1 bar whether its a 1m, 5m or 30m or more. It always only uses one bit of time and uses it to count with. Maybe im tricking the EA into counting a bar? Whatever, it appears to work for me.
Hi!
int / int will return int.
You have to cast one int to double.
void OnTick() { static int barCount = TimeMinute(TimeCurrent()); barCount++; Print(barCount); }
It always counts 1 bar whether its a 1m, 5m or 30m or more. It always only uses one bit of time and uses it to count with. Maybe im tricking the EA into counting a bar? Whatever, it appears to work for me.
That will increase barCount every tick, not every bar

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
In the code below I'm trying to count upto 36 bars then find the ratio of bull candles to bear candles and returns to log. But, the code returns 1 all the time. Ive tried + and % they work the way they are supposed to but not /.
I cant see why this is?