AstroBoy
New member
Hi Everyone!
I'm just trying to make a script to help measure Multi-Day Runners... On the daily chart, what's the highest high it's ever gotten in regular market hours in the past 10 days, compared to the lowest low in the past 10 days... And what Percent (%) higher is the highest high in comparison to the lowest low.
Problem: My script seems to be plotting out all the highs & lows each day on the daily chart, when really it should only be plotting a single line from the lowest low, and a single line from the highest high.
I was wondering if someone can take a look and help me?
I'm just trying to make a script to help measure Multi-Day Runners... On the daily chart, what's the highest high it's ever gotten in regular market hours in the past 10 days, compared to the lowest low in the past 10 days... And what Percent (%) higher is the highest high in comparison to the lowest low.
Problem: My script seems to be plotting out all the highs & lows each day on the daily chart, when really it should only be plotting a single line from the lowest low, and a single line from the highest high.
I was wondering if someone can take a look and help me?
Code:
input length = 0;
input aggregationPeriod = AggregationPeriod.DAY;
PLOT LowestPast10Days;
if !IsNaN (Lowest(low(period = aggregationPeriod)[-10])) {
LowestPast10Days = Double.NaN;
} else {
;
LowestPast10Days = Lowest(low(period = aggregationPeriod)[length]);
}
PLOT HighestPast10Days;
if !IsNaN (Highest(high(period = aggregationPeriod)[-10])) {
HighestPast10Days = Double.NaN;
} else {
;
HighestPast10Days = Highest(high(period = aggregationPeriod)[length]);
}
ADDLabel(yes, "%Higher: " + (((HighestPast10Days - LowestPast10Days) / LowestPast10Days) * 100), CreateColor(28, 168, 63));