Skip to content

Commit

Permalink
NOVA-678: scanner_data: fix epsilon calculation in the pine
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolay Dikanskiy committed Dec 12, 2024
1 parent be371be commit 9aa8771
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion links/24h_volume.pine.link
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ plot(close24hChangeAbs, title = "24h_close_change_abs", style = plot.style_colum

// 24h close change
float close24hChange = na
if na(close24hChangeAbs) or close24hPrev == 0 or (close24hPrev < 0 and close > 0)
float close24hPrevToCompare = close24hPrev * 1e+36 // for comparing very small numbers since pine has limited precision (1e-10)
if na(close24hChangeAbs) or close24hPrevToCompare != 0 or (close24hPrevToCompare < 0 and close > 0)
na
else
close24hChange := (close24hChangeAbs / math.abs(close24hPrev)) * 100
Expand Down

0 comments on commit 9aa8771

Please sign in to comment.