@@ -96,6 +96,30 @@ plotchar(close, "close", "", location.top, size = size.tiny)
96
96
```
97
97
![ .] ( built-ins_Chart_vs_built-in_discrepancies.png " Built-ins - Chart vs built-in discrepancies ")
98
98
99
+ You can also use this version of the function which returns rounded OHLC values in a single call:
100
+ ``` js
101
+ // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
102
+ // © PineCoders
103
+
104
+ // @version=4
105
+ study (" My Script" , precision = 8 )
106
+ f_ohlcRoundedToTick () => [round (open / syminfo .mintick ) * syminfo .mintick , round (high / syminfo .mintick ) * syminfo .mintick , round (low / syminfo .mintick ) * syminfo .mintick , round (close / syminfo .mintick ) * syminfo .mintick ]
107
+ f_color (_v1, _v2) => _v1 != _v2 ? color .red : color .blue
108
+
109
+ [o, h, l, c] = f_ohlcRoundedToTick ()
110
+
111
+ plotchar (o, " o" , " " , location .top , f_color (o, open))
112
+ plotchar (open, " open" , " " , location .top , f_color (o, open))
113
+ plotchar (h, " h" , " " , location .top , f_color (h, high))
114
+ plotchar (high, " high" , " " , location .top , f_color (h, high))
115
+ plotchar (l, " l" , " " , location .top , f_color (l, low))
116
+ plotchar (low, " low" , " " , location .top , f_color (l, low))
117
+ plotchar (c, " c" , " " , location .top , f_color (c, close))
118
+ plotchar (close, " close" , " " , location .top , f_color (c, close))
119
+
120
+ bgcolor (o != open or h != high or l != low or c != close ? color .red : na)
121
+ ```
122
+
99
123
** [ Back to top] ( #table-of-contents ) **
100
124
101
125
0 commit comments