[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 11
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
Hello programmers !
Please help me to understand the indicators. I have learned how to draw one line, but I do not know how to draw it through a candle and organize the work of the two buffers.
I have a strong request. Please write me two simple codes as examples.
First code: from high[i] to high[i-1] in red, then in green, and so on, in alternating colors. Second code: with one colour but through a candle.
The condition may be any other, at your discretion. The main thing is to make it as simple as possible for me to understand.
Thank you in advance. Thank you.
This is due to the peculiarities of drawing indicator lines. One indicator line can be drawn in one colour only. For the first condition you need to create objects. for the second one you can use DRAW_SECTION drawing style or two buffers and DRAW_ZIGZAG drawing style.
This is due to the peculiarities of drawing of indicator lines. One indicator line can only be drawn in one colour.
I understand that the code is not simple, I meant a simple CONDITION for drawing.
I don't understand how to apply theSwitch operator . Can you explain, please? I understand the logic. I don't understand the execution!
If I wanted to fix it, I would have to ask: "How do I fix it, and if you don't want it to look like this, it won't occur, because if there's no ticks, the program won't start (except for scripts) and the line won't be deleted. In general, there is a program - tick emulator for Expert Advisors and indicators (somewhere in kodobase). It is used to update the chart in the absence of quotes and to work with offline charts in the absence of the Internet.
Thank you. I'll look for an emulator (I'll see what kind of thing - in case it comes in handy).
I have one more question:
I am binding the text to the line price + 3*Point (i.e. I put it a bit higher), but still, when I change the size of the chart (window), the text is above the line, then below, then at the level of the line (it jumps)... Why does this happen? - I'm kind of giving the exact price coordinate. How is it solved?
Did you read it in the textbook? - https://book.mql4.com/ru/operators/switch
reading...
and this expression int Delta=NormalizeDouble((Bid-Level)Point,0);
is equal to two
int Delta;
Delta=NormalizeDouble((Bid-Level)Point,0);
???
Have you read the textbook? - https://book.mql4.com/ru/operators/switch
it seems thatSwitch is analogous to else only not for one, multiple variants ?
This is due to the peculiarities of drawing of indicator lines. One indicator line can be drawn only in one colour. For the first condition, objects should be created. For the second you can use the drawing style DRAW_SECTION or two buffers and the drawing style DRAW_ZIGZAG.
For example, as I tried if ( variable X == 0){ draw red Buf_0[i]=High[i]; Buf_0[i-1]=High[i-1]; X=1}
then loop through i if (X==1){ draw green Buf_1[i]=lou[i]; Buf_1[i-1]=lou[i-1]; X=0 }
I understand that I am missing something, that's why I want to understand. I have codes of other indicators, I tried to understand them, but they all contain a lot of conditions, loops, variables, etc. I want to focus only on the basic principles of building such indicators.
my tester has started to show some nonsense (just recently...) execution at non-existent prices. What would that mean? I've updated quotes, reloaded...downloaded...