Hi Nicolas,
I am revisiting this indicator to modify and improve it.
Is it possible to replace style(histogram) with style(candle) in the code?
I would like to see extremes and the wicks/shadows of candles as the histogram can’t show me that and thus the ARLS indicator applies to the close of the bar only.
My code and screenshot is below. Hope this is possible!
// Define variables
a=LinearRegression[30](close)
b=Close
// Calculation of difference between the 30 period regression line and the last price expressed as a percentage of the current price
c=(b-a)/b*100
if c>0 then
r=0
b=255
else
r=255
b=0
endif
//deviationP=1000
dev=std[deviationP](c)
return c coloured(r,0,b) style(histogram) as "ARLS", 0 as "Zero", 0+3*dev style(dottedline,2) as "plus 3 dev", 0+2*dev coloured(255,0,0) style(line,3) as "plus 2 dev", 0-3*dev style(dottedline,2) as "minus 3 dev", 0-2*dev coloured(255,0,0) style(line,3) as "minus 2 dev"
That should do the trick:
// Define variables
a=LinearRegression[30](close)
b=Close
ao=LinearRegression[30](open)
bo=open
ah=LinearRegression[30](high)
bh=high
al=LinearRegression[30](low)
bl=low
// Calculation of difference between the 30 period regression line and the last price expressed as a percentage of the current price
c=(b-a)/b*100
deviationP=1000
dev=std[deviationP](c)
oopen = (bo-ao)/bo*100
hhigh = (bh-ah)/bh*100
llow = (bl-al)/bl*100
if c>oopen then
r=0
b=255
else
r=255
b=0
endif
drawcandle(oopen,hhigh,llow,c) coloured(r,0,b)
return 0 as "Zero", 0+3*dev style(dottedline,2) as "plus 3 dev", 0+2*dev coloured(255,0,0) style(line,3) as "plus 2 dev", 0-3*dev style(dottedline,2) as "minus 3 dev", 0-2*dev coloured(255,0,0) style(line,3) as "minus 2 dev" //c coloured(r,0,b) style(histogram) as "ARLS",