Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ca1a4c4

Browse files
authored
Update README.md
1 parent c71eb24 commit ca1a4c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎faq_and_code/README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ In this case, when `close == open`, `upBar` will be false and `dnBar` true.
8181

8282
If you want to go one step further in defining what constitutes an up and down bar, you can use these functions. They are useful on smaller timeframes when price does not move during bars. Note that these functions taken together do not account for all possible situations, as none of them will return `true` when price does not move during a bar and the bar closes at the same level as the previous bar. These functions also use price values that are rounded to tick precision (see the following FAQ entry for the reasons why that can be useful):
8383
```js
84-
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]
85-
[o, h, l, c] = f_ohlcRoundedToTick()
84+
f_roundedToTickOHLC() =>
85+
[round_to_mintick(open), round_to_mintick(high), round_to_mintick(low), round_to_mintick(close)]
86+
[o, h, l, c] = f_roundedToTickOHLC()
8687
// ————— Function returning true when a bar is considered to be an up bar.
8788
f_barUp() =>
8889
// Dependencies: `o` and `c`, which are the open and close values rounded to tick precision.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /