[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 450
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
Can you suggest a script or an Expert Advisor to make a 6-hour chart?
There is such an innovative thing as a forum search. Try it, you'll be pleasantly surprised.
bool flag = true;
int i=0;
int w=0;
int start()
{
if (flag)
{
while(i<1)
{
w=w+1;
Alert(+w, "-й, и последний звонок ^_^");
i++
;
}
flag = false;
}
return(0);
}
bool flag=true;
int start()
{
if(flag) {
Alert("once");
flag=false;
}
return(0);
}
y=MathMod(r,t); //делим r/t
It's not like there's anything to share.
So it turns out that in mql4 it's impossible to execute a cycle once every 20 seconds, regardless of the ticks?
This is not a problem of mql4. This is a forex problem.
PS If prices have not changed over the last 20 seconds, what should we calculate?
Do you know a script or an Expert Advisor to make a 6-hour chart?
If you come across something new -- see help. It's not hard to use help. Why do you force others to write what has already been written before? Uh-huh?
Wait... I've looked at the help beforehand and described the examples .
The MathMod function calculates the real remainder f of x / y such that x = i * y + f , where i is an integer, f has the same sign as x, and the absolute value of f is less than the absolute value of y.
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I don't understand this ------>>>
What does this MathMod function have to do with it?
.
while(true)
{
if (MathMod(TimeLocal(), 20)==0) // every 20 seconds
while(i<10) { i++; } // useful loop
Sleep(10); // take a short nap to unload the processor
}
This procedure will check every 10 milliseconds --- whether the real remainder from dividing TimeLocal() by 20 = zero.
That's if you want nano precision regardless of computational cost. ;)
I don't understand this ------>>>
What does this MathMod function have to do with it?
MathMod() is division. The rest is pure mathematics: if we divide result from TimeLocal() by 20 every second (or more often), then every 20 seconds the remainder will be zero.
Conclusion: the same idea can be implemented in different ways.
Good afternoon.
Who can tell me how to normalize a number like this?
I.e. we need this function F(8,5464.00) = 85464.00
Thank you.