'How to check if value is inside a area
I am attempting to create an indicator that if a value is inside an area it will plot a circle inside it, if it's less than zero the color will be red and if it's greater than zero the color must be green, for buy and sell indicator
p = hlc3
esa = ema(ap, n1)
d = ema(abs(ap - esa), n1)
ci = (ap - esa) / (0.015 * d)
tci = ema(ci, n2)
wt1 = tci
wt2 = sma(wt1,4)
area = wt1-wt2
plot(wt1, color=color.green)
plot(wt2, color=color.red, style=3)
plot(area, color=color.rgb(255,255,224,80), style=plot.style_area)
plot(wt1 > area ? wt1 : na, color = ( wt1 > area ? color.lime : na) , style = plot.style_circles, linewidth = 3, title="cross_value")
plot(wt1 < area ? wt1 : na, color = ( wt1 < area ? color.red : na) , style = plot.style_circles, linewidth = 3, title="cross_value")
I just can't figure out how to create this.
Here is the output
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

