Hi Nicholas.
I have an indicator that identifies candle sequences – ascending sequences, and descending sequences.
I really want to continue his action.
And on the information obtained from it, create an indicator that identifies peak and low points.
Could you please direct me how to do this?
Here’s how it works –
The example is a peak search.
. On Sunday the sequence started to rise
. On Wednesday the rising sequence broke – and a descending sequence began
As soon as the descending sequence begins, the indicator searches between them for the candle with the highest peak of all the candles and marks it as a peak point – with a gray or black arrow down. (Above the candle)
I attach the existing code.
(When the full code is ready, I’d be happy to share it and what you can get from it extensively – with our community members)
// find the highest value from squence
if highSeq < high[1] and dec = 0 then
highSeq = high[1]
HBlow = low[1] // Low of highest bar in sequence
//Re-set the high of lowest bar
LBHigh = 10000000000/PIPSize
endif
// find the highest value from squence
if lowSeq > low[1] and inc = 0 then
lowSeq = low[1]
LBhigh = high[1]// High of lowest bar in sequence
//Re-set the Low of highest bar
HBlow = 0
endif
// Check if close is higher than high of lowest bar on the sequance
if LBhigh < Close and inc = 0 then
// If condition meet, make incremental as true or 1 and decrimental as 0 or false
inc = 1
dec = 0
// Re-sets decremental sequence
lowseq = 10000000000/PIPSize
// Darw arrow up when chart is shifted from incremental to decrimental
DRAWARROWUP(barindex, low - ArrowDistance*Pipsize) COLOURED(UpArrowRValue,UpArrowGValue,UpArrowBValue)
endif
// Check if close is lower than low of highest bar on the sequance
if HBlow > Close and dec = 0 then
dec = 1
inc = 0
// Re-sets incremental sequence
highseq = 0
// Darw arrow up when chart is shifted from incremental to decrimental
DRAWARROWDOWN(barindex, high+ArrowDistance*Pipsize) COLOURED(DownArrowRValue,DownArrowGValue,DownArrowBValue)
endif
// Only for drawing line on the chart
if inc = 1 and ShowMA then
DRAWSEGMENT(barindex[1],low[1],barindex,low[0]) COLOURED(0,255,0)
endif
if dec = 1 and ShowMA then
DRAWSEGMENT(barindex[1],high[1],barindex[0],high[0]) COLOURED(255,0,0)
endif
return //Nothing will be returned because it has to be shown in price
Edited by moderator to make “PRT code” format appear, please use “insert PRT code” button
I very much beg your help – and thank you in advance.