Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 746

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
I want to ask you, dear programmers, please explain me in Russian how to search for past indicator readings with the code. For example stoploss when selling I need to put on 3 High ZigZag from the zero bar, or over the eighth upper fractal. wherever I read - either not that, or written not so :)
I want to ask you, dear programmers, please explain me in Russian how to search for past indicator readings with the code. For example stoploss when selling I need to put on 3 High ZigZag from the zero bar, or over the top eighth fractal. wherever I read - either not that, or written not so :)
Cycle from zero bar to the beginning of the chart, int x=0. In the cycle call the required indicator, for example, fractal. If the value is not empty, add 1 to x, when x reaches the required value - remember the loop iteration and exit the loop, the iteration value will theoretically be the number of the bar where the required fractal is located. Theoretically, because when the loop is running, one new bar can appear on M1 and then pointer will be shown to a wrong bar)))
Please, explain me in Russian how to search for the past indicator readings in the code? For example stoploss on the sale I need to put on 3 High ZigZag from the zero bar, or the top eighth fractal, wherever I read - or not something, or written not so :)
"Russian language" and "programming language" (want a code explanation) are not the same thing.
Algorithmically:
1) Define what value the ZigZag of interest returns, if it has no "fractal point" - it can be EMPTY_VALUE or 0.0.
2) Using iCustom() in the loop, obtain the value of the corresponding buffer indicator on the bar being checked in the loop, check it for difference from the "empty value" and keep a counter of those differences. When the counter is equal to 3 in your case - the number (N) of the bar will be the desired bar;
3) High[N]\Low[N] - will be the required level.
For the standard ZigZag High we are looking for something like this:
But before that, we have to change the number of displayed buffers in ZigZag code from 1 to 3:
Thanks for the answers, I will get back to them :) now the problem is
http://clip2net.com/s/j7xvk9
I can't figure out why it does not modify the order, but just opens new pending orders
Thanks for the answers, I will get back to them :) now the problem is
http://clip2net.com/s/j7xvk9
I can't figure out why it does not modify the order, but just opens new pending orders
Thanks for showing :)
1) Any strategy must be defined by the number of orders open at the same time. Accordingly, before opening the next order, we should check how many are already open.
2) On one bar, there cannot be UPPER and LOWER fractals at the same time, respectively, the check is classified as
belongs to the category of programmer's idiocy.
3) Before writing the conditions for returning buffer indicator values, you need to know exactly what value is "empty" for it? Have you checked that it is 0?
4) The construct.
Although it will work (in most cases), but is unnatural, because it is a "free-will" idea of the developer, and is uninformative for the trader. An alternative - the tracking of a new bar.
5) You have to start from the basics, because this:
Indicates that you don't understand what you're writing at all.
The best way to understand is to study how other people's codes work and modify them for your own purposes. Good luck.
2) There cannot be UPPER and LOWER fractals on the same bar at the same time, respectively, check
belongs to the category of programmer's idiocy.
So these quotes are only for idiots.