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?
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?
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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