Highest and Lowest of Indicator

 

I want to capture the highest and lowest values of indicator (nor price) for given period of time. I tried to do this using iHighest in this way:


High[iHighest(NULL,0,SSB,P1,P2)]


where double SSB=iIchimoku(NULL, 0, 7, 22, 44, MODE_SENKOUSPANB, 0);


This doesn't work so what I should do?


thanks

 

Try something in the line of

High = 0 ( set this before the start() else it will reset to 0 every tick. )

"currant price" > High then High = currant Price.

Opposite for lowest.

This should then only update the high variable when the price is higher than the previos highest.

Set another variable to capture the time and when the given period is over, simply reset them to 0 again.

Hope this helps.

 

Hi again,

this seems related to capturing the highest price but I want to capture the highest value of indicator. At example, the highest value of OBV for the last 20 days. Any help?

 
Hi Jordan,
The iHighest function deals with the price mouvement and not every kind of value.
If you want to get the Highest and the Lowest value of your indicator results for a given period of time, then I suggest you code a loop reading all this values and selecting the Highest and the Lowest among them.
 
Blooper1980:

Try something in the line of

High = 0 ( set this before the start() else it will reset to 0 every tick. )

"currant price" > High then High = currant Price.

Opposite for lowest.

This should then only update the high variable when the price is higher than the previos highest.

Set another variable to capture the time and when the given period is over, simply reset them to 0 again.

Hope this helps.

how to code last 10 highest and lowest?

Reason: