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
Guys, I'm not good at this yet, how do I fill in the lines?
double sto1=(bar close price);
double sto2=(open price of the new bar) ;
iClose(NULL,0,1)
iOpen(NULL,0,0)
Read about these functions in the help
I don't know. If everything is slow to start with, maybe 10 ifs won't make a difference. But I already notice it on the third one. So the need for each new ife is carefully weighed.
There are only two reasons for the slowdown, the first is that the condition in the if statement is constructed incorrectly and the second is that after the if statement is triggered the further execution is written incorrectly inside the body.
I have a bar analyzer, there are much more than 3 if's with internal if's, it goes through all the bars and their values, fixes the sum and writes in the window that opens, all in a fraction of a second.
So the lags are not because of if but because of its incorrect use.
iClose(NULL,0,1)
iOpen(NULL,0,0)
Read about these functions in the help
There are only two reasons for the slowdown, the first is that the condition in the if statement is constructed incorrectly and the second is that after the if statement is triggered the further execution is written incorrectly inside the body.
I have a bar analyzer, there are much more than 3 if's with internal if's, it goes through all the bars and their values, fixes the sum and writes in the window that opens, all in a fraction of a second.
So, the slowdown is not because of if, but because it is used incorrectly.
What are you arguing with? That two ifs are twice as slow as one if? And three ifs are three times slower than one?
What about when explicitly "heavy code" is placed in the if body? If an if doesn't work, what's inside it doesn't count.
If an if doesn't work, it means that its conditions are
What I wanted to say is this: I have some rather heavy calculations. I usually do this to speed things up: I put the easiest calculations in if conditions, and hide the heavy code in its body.
If easy ones don't work, then the hard ones won't be checked at all.
What I wanted to say is this: I have some rather heavy calculations. I usually do this to speed things up: I put the easiest calculations in if conditions, and hide the heavy code in its body.
If light ones don't work, then the heavy ones are not checked at all.
What do you mean by heavy calculations? An example could be light and heavy!
Well, here's an example. There is a relatively light two-slide indicator and a heavy indicator. The "heavy" calculations are resource-intensive.
Well, here's an example. There is a relatively light two-slide indicator and a heavy indicator. The "heavy" calculations are resource-intensive.