Good evening!!! I have decided to write how to calculate the distance from the price to the nearest order above, and the nearest below. I count up to each order, going through the loop forwards and out of all this I choose the minimum number. Well, this turns out to be such a load of crap! Well, okay, the distance turns out sometimes great, 1162 points or more, I'm almost 100 percent sure well no way, well, okay! But if you divide 1162 by 40, that's four...
And it does come out, look at the log screenshot, there are exactly M equals 4, there in the line after the X+++ ...... I don't get it. Either I'm a moron or I don't understand the normalize double function... I don't get it! Or what? ...... Please tell me, I'm totally confused and am amazed !!!!
Have a look at Kim's function, you might find the solution to your problem here.
Please help, how can I write code to execute the program only when a new bar arrives and ignore the inter-bar ticks? Thank you.
or so -
Declare an integer variable before the initialisation block. For example, int g_time.
In the start function write:
//------- : ждём следующий барif (g_time == Time[0]) return (0); // возврат на начало кода, если условие не выпоняется программа работает дальше
g_time = Time[0];
Try to use the SRC (there's a button at the top of the text box) to insert your codes. It will be easier to read your posts.
I've noticed your search for shadows (top_ten=High-Close;). Why do you subtract Close and not Open? Think about it.
A white candlestick closes on a close, so the upper shadow will be counted as close, and if it is open, then it will be the upper shadow + the candlestick body
frixer: A white candlestick is closed by close, therefore the upper shadow will be considered as such; if it is open then it will be the upper shadow + the candlestick body
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Good evening!!! I have decided to write how to calculate the distance from the price to the nearest order above, and the nearest below. I count up to each order, going through the loop forwards and out of all this I choose the minimum number. Well, this turns out to be such a load of crap! Well, okay, the distance turns out sometimes great, 1162 points or more, I'm almost 100 percent sure well no way, well, okay! But if you divide 1162 by 40, that's four...
And it does come out, look at the log screenshot, there are exactly M equals 4, there in the line after the X+++ ...... I don't get it. Either I'm a moron or I don't understand the normalize double function... I don't get it! Or what? ...... Please tell me, I'm totally confused and am amazed !!!!
Can you please help me write code to execute the program only when a new bar arrives and ignore the inter-bar ticks? I don't know what's going on.
Can you please help me write code to execute the program only when a new bar arrives and ignore the inter-bar ticks? Thank you.
Declare an integer variable before the initialization block. For example, int MyBars;
Then in the initialisation block, assign this variable a value = zero. In the start function write:
Now tell me, what happens on the next tick? What will end up in the MyBars variable?Vladimir, I daresay nothing will happen. The MyBars variable will still contain Bars :(
Please help, how can I write code to execute the program only when a new bar arrives and ignore the inter-bar ticks? Thank you.
or so -
Declare an integer variable before the initialisation block. For example, int g_time.
In the start function write:
or so -
Declare an integer variable before the initialisation block. For example, int g_time
In the start function write:
You shouldn't be writing here. I would have deleted your post.
You shouldn't be writing here. I would have deleted your post.
I don't understand. Why not?
Try to use the SRC (there's a button at the top of the text box) to insert your codes. It will be easier to read your posts.
I've noticed your search for shadows (top_ten=High-Close;). Why do you subtract Close and not Open? Think about it.
A white candlestick is closed by close, therefore the upper shadow will be considered as such; if it is open then it will be the upper shadow + the candlestick body
Upper shadow (High-MathMax(Open. Close))
Low shadow (MathMin(Open, Close)-Low)