Skip to content

Commit 8d69fe5

Browse files
authored
Update README.md
1 parent e579dc7 commit 8d69fe5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

coding_conventions/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@ Here is an example of a complete script:
5353
study("MACD")
5454

5555
// ————— Inputs
56-
fast = input(12, "Fast Length")
56+
i_fast = input(12, "Fast Length")
5757
// Calculates slow length from fast length and normalizes it if needed.
5858
f_getSlowLength(_len) =>
5959
_tempLen = _len * 2
6060
if _tempLen < 20 or _tempLen > 30
6161
_tempLen := 25
6262
_tempLen
63-
slow = f_getSlowLength(fast)
63+
slow = f_getSlowLength(i_fast)
6464

6565
// ————— Calculations
66-
fastMa = ema(close, fast)
66+
fastMa = ema(close, i_fast)
6767
slowMa = ema(close, slow)
6868
macd = fastMa - slowMa
6969
signal = sma(macd, 9)
@@ -105,11 +105,11 @@ daysInMonth(_year, _month) =>
105105

106106
When a function requires global scope variables to perform its calculations, these dependencies should be documented in comments. Dependencies are to be avoided whenever possible, as they jeopardize function portability and make code more difficult to read.
107107
```js
108-
lenMultiplier = input(2, "Length Multiplier")
108+
i_lenMultiplier = input(2, "Length Multiplier")
109109

110110
f_getSlowLength(_len) =>
111-
// Dependencies: lenMultiplier (initialized in inputs).
112-
_tempLen = _len * lenMultiplier
111+
// Dependencies: i_lenMultiplier (initialized in inputs).
112+
_tempLen = _len * i_lenMultiplier
113113
if _tempLen < 20 or _tempLen > 30
114114
_tempLen := 25
115115
_tempLen

0 commit comments

Comments
 (0)