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

 

Close[i+1]>Open[i+1] && Close[i+2]<Open[i+2] in this formation I need to get the price of minimumi+2

Close[i+1]<Open[i+1] && Close[i+2]>Open[i+2]in this formation I need to get the price ofmaximumi+2

then when it has broken the high/mid, the indicator should draw an icon for example. i see the breakout upwards asClose[i+1]>Maximum price(i+2) from the formation

Close[i+1]<Open[i+1] && Close[i+2]>Open[i+2]

 
Lankaster:

Close[i+1]>Open[i+1] && Close[i+2]<Open[i+2] in this formation I need to get the price of minimumi+2

Close[i+1]<Open[i+1] && Close[i+2]>Open[i+2]in this formation I need to get the price ofmaximumi+2

then when it has broken the high/mid, the indicator should draw an icon for example. i see the breakout upwards asClose[i+1]>Maximum price(i+2) from the formation

Close[i+1]<Open[i+1] && Close[i+2]>Open[i+2].


Didn't try it this way:

High[iHighest(Symbol(),Period(),2,i)]; - maximum from i to i+2

Low[iLowest(Symbol(),Period(),2,i)]; - minimum beginning from i to i+2

 
Vitalii Ananev:

Didn't try it this way:

High[iHighest(Symbol(),Period(),2,i)]; - maximum beginning from i to i+2

Low[iLowest(Symbol(),Period(),2,i)]; - minimum beginning from i to i+2


If I'm not mistaken, it will search for maxima and minima among 2 candlesticks regardless of their direction.

the maximum of a bullish candle from the first formation and the minimum of a bearish candle from the second formation.

I hope this is clear, my head is already boiling :)

 
Lankaster:

No, the indicator will draw using theClose[i+1]>Open[i+1] && Close[i+2]<Open[i+2]...Close[i+1]<Open[i+1] && Close[i+2]>Open[i+2] algorithm

I cannot find the prices of these levels, so when these formations (lines) are broken, the indicator draws an icon for example

Alas, I still don't get it, but it looks like a Doncian channel - look in the code base...
 
Aleksey Vyazmikin:
Alas, I still don't get it, but it looks like a Donchian channel - look in the code base...

Yes, you are right it looks like a Donchian channel on this link https://www.mql5.com/ru/code/10836 but I do not understand how to draw the icon when Close[i+1] closes above the channel for example on June 12, 2012 on the chart you can see that the indicator marked the high, but how will the code of this crossover look? Close[i+1]>Donchian channel? But how will this Close[i+1] know what value it crosses? Because between this maximum and the current price there are local highs that the channel has marked and those highs have their own indicator value

Канал Дончиана.
Канал Дончиана.
  • votes: 7
  • 2012.09.10
  • Лёха
  • www.mql5.com
Классический вариант индикатора со средней линией.
 
Lankaster:

Yes, you are right it looks like a Donchian channel on this link https://www.mql5.com/ru/code/10836 but I do not understand how to draw the icon when Close[i+1] closes above the channel for example on June 12, 2012 on the chart you can see that the indicator marked high, but how will the code of this crossing look? Close[i+1]>Donchian channel? But how will this Close[i+1] know what value it crosses?


You need to compare the price with the indicator - iCustom function.

 
Aleksey Vyazmikin:

You need to do a price comparison with an indicator - iCustom function.


I don't understand how to make this comparison. Perhaps, it would be easier to make a horizontal line drawing of maxima and minima and give each line a name and then, using ObjectGet, get the prices of these lines?

 
Lankaster:

I don't understand how to make this comparison. Perhaps it would be easier to make horizontal lines draw these highs and lows and give each line a name and then get the prices of these lines through ObjectGet?


Look at how the indicator is set up, maybe there will be some other ideas...

The idea is to find initial points of crossovers in the indicator, collect them in an array and translate them out of the indicator - so it will be less resource consuming if the calculation should be done for the entire chart and to access the data for several times per bar, for example in the Expert Advisor.

 
Aleksey Vyazmikin:

Look at how the indicator is set up, maybe there will be some other ideas...

I was planning to do something similar myself, but I'm not getting around to it. The idea is to find the points of primary crossovers in the indicator, collect them in a graphic array and translate them from the indicator - it will be less resource consuming if the calculation should be done on the entire chart and I need to access the data several times per bar, for example in the Expert Advisor.


Thank you, I will try.

 
Lankaster:

If I'm not mistaken, it will look for highs and lows of 2 candlesticks, independently of their direction, but it only needs to get the prices of up-down and down-up formations

the maximum of a bullish candle from the first formation and the minimum of a bearish candle from the second formation.

I hope I'm writing it clearly, my head is already boiling :)


It will search for local extrema from i to i+2. I do not know why you need it. But a maximum will always be a maximum, no matter what kind of candle is bearish or bullish.