I'm new to this and I can't figure out why a specific hour is being checked more than one time.
I added this:
if (TimeHour(Time[2]) == 15 && TimeMinute(Time[2]) == 45)
Print("Test!");
I set the period to "M15"
and the "Test!" statement is printed more than one time.
Why is this happening?
- Display time
- Reading User's System Time
- How does one set chart display for specific time and days?
vushel: the "Test!" statement is printed more than one time.
How many ticks will there be in the one minute between 15:45 and 15:46?
I'm not sure.
How can I know?
How can I know?
vushel:
I'm not sure.
How can I know?
Look at the "volume" (tick count) on the specific M1 bar.
I'm not sure.
How can I know?
The volume of the bar of 15:45 is 2692.
vushel:
The volume of the bar of 15:45 is 2692.
That seems a lot for an M1 bar . . . but that is 2692 ticks, and for each of those ticks start() is called.
The volume of the bar of 15:45 is 2692.
vushel:
Yes, I get this.
But what I don't get, is why this volume thingy exists.
Why do I need it to check 2692?
I want my code will occur only once for each 15 minutes.
OK, so check when a new M15 bar has arrived and check then, cheeking once per bar has been disused many times, use the search top right of this page.
Yes, I get this.
But what I don't get, is why this volume thingy exists.
Why do I need it to check 2692?
I want my code will occur only once for each 15 minutes.
I thought that this code would do the job:
// Execute on bar open if(CheckOncePerBar) { int BarShift = 2; if (Time[0] != CurrentTimeStamp) { CurrentTimeStamp = Time[0]; bool NewBar = true; } else { NewBar = false; } } else { NewBar = true; BarShift = 0; }
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register