Skip to content

Commit

Permalink
Update edge.R
Browse files Browse the repository at this point in the history
  • Loading branch information
Emanuele Guidotti committed Aug 11, 2024
1 parent 8311ced commit c75196b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion r/R/edge.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ edge <- function(open, high, low, close, sign = FALSE){
s2 <- (v2*e1 + v1*e2) / (v1 + v2)

s <- sqrt(abs(s2))
if(sign & s2 < 0)
if(sign & !is.na(s2) & s2 < 0)
s <- -s

return(s)
Expand Down

0 comments on commit c75196b

Please sign in to comment.