oakscriptjs 0.24.0 → 0.25.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/README.md +25 -1
  2. package/bin/oakscript.mjs +10 -3
  3. package/dist/cjs/box/index.d.ts +348 -289
  4. package/dist/cjs/box/index.d.ts.map +1 -1
  5. package/dist/cjs/box/index.js.map +2 -2
  6. package/dist/cjs/check/node.d.ts.map +1 -1
  7. package/dist/cjs/check/node.js +1 -0
  8. package/dist/cjs/check/node.js.map +2 -2
  9. package/dist/cjs/check/preview.d.ts +31 -0
  10. package/dist/cjs/check/preview.d.ts.map +1 -0
  11. package/dist/cjs/check/preview.js +303 -0
  12. package/dist/cjs/check/preview.js.map +7 -0
  13. package/dist/cjs/color/index.d.ts +11 -11
  14. package/dist/cjs/color/index.js.map +1 -1
  15. package/dist/cjs/color/parse.d.ts +2 -0
  16. package/dist/cjs/color/parse.d.ts.map +1 -1
  17. package/dist/cjs/color/parse.js +6 -0
  18. package/dist/cjs/color/parse.js.map +2 -2
  19. package/dist/cjs/compare/index.d.ts +76 -12
  20. package/dist/cjs/compare/index.d.ts.map +1 -1
  21. package/dist/cjs/compare/index.js.map +2 -2
  22. package/dist/cjs/drawing/registry.d.ts +28 -5
  23. package/dist/cjs/drawing/registry.d.ts.map +1 -1
  24. package/dist/cjs/drawing/registry.js +14 -0
  25. package/dist/cjs/drawing/registry.js.map +2 -2
  26. package/dist/cjs/index.d.ts +1 -1
  27. package/dist/cjs/index.js +1 -1
  28. package/dist/cjs/index.js.map +1 -1
  29. package/dist/cjs/label/index.d.ts +265 -187
  30. package/dist/cjs/label/index.d.ts.map +1 -1
  31. package/dist/cjs/label/index.js +1 -1
  32. package/dist/cjs/label/index.js.map +2 -2
  33. package/dist/cjs/line/index.d.ts +247 -207
  34. package/dist/cjs/line/index.d.ts.map +1 -1
  35. package/dist/cjs/line/index.js.map +2 -2
  36. package/dist/cjs/linefill/index.d.ts +61 -89
  37. package/dist/cjs/linefill/index.d.ts.map +1 -1
  38. package/dist/cjs/linefill/index.js.map +2 -2
  39. package/dist/cjs/math/index.d.ts +49 -40
  40. package/dist/cjs/math/index.d.ts.map +1 -1
  41. package/dist/cjs/math/index.js.map +2 -2
  42. package/dist/cjs/polyline/index.d.ts +57 -78
  43. package/dist/cjs/polyline/index.d.ts.map +1 -1
  44. package/dist/cjs/polyline/index.js.map +2 -2
  45. package/dist/cjs/runtime/input-active.d.ts +2 -2
  46. package/dist/cjs/runtime/input-active.js.map +1 -1
  47. package/dist/cjs/runtime/series.d.ts +241 -161
  48. package/dist/cjs/runtime/series.d.ts.map +1 -1
  49. package/dist/cjs/runtime/series.js +223 -127
  50. package/dist/cjs/runtime/series.js.map +2 -2
  51. package/dist/cjs/script/api/alert.d.ts +37 -0
  52. package/dist/cjs/script/api/alert.d.ts.map +1 -0
  53. package/dist/cjs/script/api/alert.js +17 -0
  54. package/dist/cjs/script/api/alert.js.map +7 -0
  55. package/dist/cjs/script/api/calc.d.ts +232 -0
  56. package/dist/cjs/script/api/calc.d.ts.map +1 -0
  57. package/dist/cjs/script/api/calc.js +17 -0
  58. package/dist/cjs/script/api/calc.js.map +7 -0
  59. package/dist/cjs/script/api/color.d.ts +213 -0
  60. package/dist/cjs/script/api/color.d.ts.map +1 -0
  61. package/dist/cjs/script/api/color.js +17 -0
  62. package/dist/cjs/script/api/color.js.map +7 -0
  63. package/dist/cjs/script/api/context.d.ts +764 -0
  64. package/dist/cjs/script/api/context.d.ts.map +1 -0
  65. package/dist/cjs/script/api/context.js +17 -0
  66. package/dist/cjs/script/api/context.js.map +7 -0
  67. package/dist/cjs/script/api/log.d.ts +58 -0
  68. package/dist/cjs/script/api/log.d.ts.map +1 -0
  69. package/dist/cjs/script/api/log.js +17 -0
  70. package/dist/cjs/script/api/log.js.map +7 -0
  71. package/dist/cjs/script/api/strategy.d.ts +391 -0
  72. package/dist/cjs/script/api/strategy.d.ts.map +1 -0
  73. package/dist/cjs/script/api/strategy.js +17 -0
  74. package/dist/cjs/script/api/strategy.js.map +7 -0
  75. package/dist/cjs/script/api/ta.d.ts +1012 -0
  76. package/dist/cjs/script/api/ta.d.ts.map +1 -0
  77. package/dist/cjs/script/api/ta.js +17 -0
  78. package/dist/cjs/script/api/ta.js.map +7 -0
  79. package/dist/cjs/script/api/table.d.ts +479 -0
  80. package/dist/cjs/script/api/table.d.ts.map +1 -0
  81. package/dist/cjs/script/api/table.js +17 -0
  82. package/dist/cjs/script/api/table.js.map +7 -0
  83. package/dist/cjs/script/constants.d.ts +228 -83
  84. package/dist/cjs/script/constants.d.ts.map +1 -1
  85. package/dist/cjs/script/constants.js +87 -0
  86. package/dist/cjs/script/constants.js.map +2 -2
  87. package/dist/cjs/script/define.d.ts +94 -0
  88. package/dist/cjs/script/define.d.ts.map +1 -0
  89. package/dist/cjs/script/define.js +127 -0
  90. package/dist/cjs/script/define.js.map +7 -0
  91. package/dist/cjs/script/drawing-args.d.ts.map +1 -1
  92. package/dist/cjs/script/drawing-args.js +1 -1
  93. package/dist/cjs/script/drawing-args.js.map +2 -2
  94. package/dist/cjs/script/formula.d.ts +53 -0
  95. package/dist/cjs/script/formula.d.ts.map +1 -0
  96. package/dist/cjs/script/formula.js +402 -0
  97. package/dist/cjs/script/formula.js.map +7 -0
  98. package/dist/cjs/script/globals.d.ts +10 -0
  99. package/dist/cjs/script/globals.d.ts.map +1 -1
  100. package/dist/cjs/script/globals.js.map +1 -1
  101. package/dist/cjs/script/index.d.ts +1067 -1006
  102. package/dist/cjs/script/index.d.ts.map +1 -1
  103. package/dist/cjs/script/index.js +530 -60
  104. package/dist/cjs/script/index.js.map +3 -3
  105. package/dist/cjs/script/json.d.ts +117 -0
  106. package/dist/cjs/script/json.d.ts.map +1 -0
  107. package/dist/cjs/script/json.js +321 -0
  108. package/dist/cjs/script/json.js.map +7 -0
  109. package/dist/cjs/str/index.d.ts +50 -75
  110. package/dist/cjs/str/index.d.ts.map +1 -1
  111. package/dist/cjs/str/index.js +2 -2
  112. package/dist/cjs/str/index.js.map +2 -2
  113. package/dist/cjs/strategy/index.d.ts +102 -1
  114. package/dist/cjs/strategy/index.d.ts.map +1 -1
  115. package/dist/cjs/strategy/index.js.map +2 -2
  116. package/dist/cjs/table/index.d.ts +330 -49
  117. package/dist/cjs/table/index.d.ts.map +1 -1
  118. package/dist/cjs/table/index.js +55 -27
  119. package/dist/cjs/table/index.js.map +2 -2
  120. package/dist/cjs/text/index.d.ts +12 -14
  121. package/dist/cjs/text/index.d.ts.map +1 -1
  122. package/dist/cjs/text/index.js.map +2 -2
  123. package/dist/cjs/types/index.d.ts +15 -8
  124. package/dist/cjs/types/index.d.ts.map +1 -1
  125. package/dist/cjs/types/index.js +12 -3
  126. package/dist/cjs/types/index.js.map +2 -2
  127. package/dist/esm/box/index.d.ts +348 -289
  128. package/dist/esm/box/index.d.ts.map +1 -1
  129. package/dist/esm/box/index.js +276 -276
  130. package/dist/esm/box/index.js.map +1 -1
  131. package/dist/esm/check/node.d.ts.map +1 -1
  132. package/dist/esm/check/node.js +1 -0
  133. package/dist/esm/check/node.js.map +1 -1
  134. package/dist/esm/check/preview.d.ts +31 -0
  135. package/dist/esm/check/preview.d.ts.map +1 -0
  136. package/dist/esm/check/preview.js +296 -0
  137. package/dist/esm/check/preview.js.map +1 -0
  138. package/dist/esm/color/index.d.ts +11 -11
  139. package/dist/esm/color/index.js +11 -11
  140. package/dist/esm/color/parse.d.ts +2 -0
  141. package/dist/esm/color/parse.d.ts.map +1 -1
  142. package/dist/esm/color/parse.js +7 -0
  143. package/dist/esm/color/parse.js.map +1 -1
  144. package/dist/esm/compare/index.d.ts +76 -12
  145. package/dist/esm/compare/index.d.ts.map +1 -1
  146. package/dist/esm/compare/index.js +76 -12
  147. package/dist/esm/compare/index.js.map +1 -1
  148. package/dist/esm/drawing/registry.d.ts +28 -5
  149. package/dist/esm/drawing/registry.d.ts.map +1 -1
  150. package/dist/esm/drawing/registry.js +39 -3
  151. package/dist/esm/drawing/registry.js.map +1 -1
  152. package/dist/esm/index.d.ts +1 -1
  153. package/dist/esm/index.js +1 -1
  154. package/dist/esm/label/index.d.ts +265 -187
  155. package/dist/esm/label/index.d.ts.map +1 -1
  156. package/dist/esm/label/index.js +207 -177
  157. package/dist/esm/label/index.js.map +1 -1
  158. package/dist/esm/line/index.d.ts +247 -207
  159. package/dist/esm/line/index.d.ts.map +1 -1
  160. package/dist/esm/line/index.js +202 -194
  161. package/dist/esm/line/index.js.map +1 -1
  162. package/dist/esm/linefill/index.d.ts +61 -89
  163. package/dist/esm/linefill/index.d.ts.map +1 -1
  164. package/dist/esm/linefill/index.js +61 -89
  165. package/dist/esm/linefill/index.js.map +1 -1
  166. package/dist/esm/math/index.d.ts +49 -40
  167. package/dist/esm/math/index.d.ts.map +1 -1
  168. package/dist/esm/math/index.js +22 -9
  169. package/dist/esm/math/index.js.map +1 -1
  170. package/dist/esm/polyline/index.d.ts +57 -78
  171. package/dist/esm/polyline/index.d.ts.map +1 -1
  172. package/dist/esm/polyline/index.js +57 -78
  173. package/dist/esm/polyline/index.js.map +1 -1
  174. package/dist/esm/runtime/input-active.d.ts +2 -2
  175. package/dist/esm/runtime/input-active.js +2 -2
  176. package/dist/esm/runtime/series.d.ts +241 -161
  177. package/dist/esm/runtime/series.d.ts.map +1 -1
  178. package/dist/esm/runtime/series.js +241 -161
  179. package/dist/esm/runtime/series.js.map +1 -1
  180. package/dist/esm/script/api/alert.d.ts +37 -0
  181. package/dist/esm/script/api/alert.d.ts.map +1 -0
  182. package/dist/esm/script/api/alert.js +7 -0
  183. package/dist/esm/script/api/alert.js.map +1 -0
  184. package/dist/esm/script/api/calc.d.ts +232 -0
  185. package/dist/esm/script/api/calc.d.ts.map +1 -0
  186. package/dist/esm/script/api/calc.js +6 -0
  187. package/dist/esm/script/api/calc.js.map +1 -0
  188. package/dist/esm/script/api/color.d.ts +213 -0
  189. package/dist/esm/script/api/color.d.ts.map +1 -0
  190. package/dist/esm/script/api/color.js +6 -0
  191. package/dist/esm/script/api/color.js.map +1 -0
  192. package/dist/esm/script/api/context.d.ts +764 -0
  193. package/dist/esm/script/api/context.d.ts.map +1 -0
  194. package/dist/esm/script/api/context.js +7 -0
  195. package/dist/esm/script/api/context.js.map +1 -0
  196. package/dist/esm/script/api/log.d.ts +58 -0
  197. package/dist/esm/script/api/log.d.ts.map +1 -0
  198. package/dist/esm/script/api/log.js +6 -0
  199. package/dist/esm/script/api/log.js.map +1 -0
  200. package/dist/esm/script/api/strategy.d.ts +391 -0
  201. package/dist/esm/script/api/strategy.d.ts.map +1 -0
  202. package/dist/esm/script/api/strategy.js +7 -0
  203. package/dist/esm/script/api/strategy.js.map +1 -0
  204. package/dist/esm/script/api/ta.d.ts +1012 -0
  205. package/dist/esm/script/api/ta.d.ts.map +1 -0
  206. package/dist/esm/script/api/ta.js +6 -0
  207. package/dist/esm/script/api/ta.js.map +1 -0
  208. package/dist/esm/script/api/table.d.ts +479 -0
  209. package/dist/esm/script/api/table.d.ts.map +1 -0
  210. package/dist/esm/script/api/table.js +7 -0
  211. package/dist/esm/script/api/table.js.map +1 -0
  212. package/dist/esm/script/constants.d.ts +228 -83
  213. package/dist/esm/script/constants.d.ts.map +1 -1
  214. package/dist/esm/script/constants.js +110 -24
  215. package/dist/esm/script/constants.js.map +1 -1
  216. package/dist/esm/script/define.d.ts +94 -0
  217. package/dist/esm/script/define.d.ts.map +1 -0
  218. package/dist/esm/script/define.js +136 -0
  219. package/dist/esm/script/define.js.map +1 -0
  220. package/dist/esm/script/drawing-args.d.ts.map +1 -1
  221. package/dist/esm/script/drawing-args.js +2 -1
  222. package/dist/esm/script/drawing-args.js.map +1 -1
  223. package/dist/esm/script/formula.d.ts +53 -0
  224. package/dist/esm/script/formula.d.ts.map +1 -0
  225. package/dist/esm/script/formula.js +408 -0
  226. package/dist/esm/script/formula.js.map +1 -0
  227. package/dist/esm/script/globals.d.ts +10 -0
  228. package/dist/esm/script/globals.d.ts.map +1 -1
  229. package/dist/esm/script/globals.js.map +1 -1
  230. package/dist/esm/script/index.d.ts +1067 -1006
  231. package/dist/esm/script/index.d.ts.map +1 -1
  232. package/dist/esm/script/index.js +1096 -151
  233. package/dist/esm/script/index.js.map +1 -1
  234. package/dist/esm/script/json.d.ts +117 -0
  235. package/dist/esm/script/json.d.ts.map +1 -0
  236. package/dist/esm/script/json.js +375 -0
  237. package/dist/esm/script/json.js.map +1 -0
  238. package/dist/esm/str/index.d.ts +50 -75
  239. package/dist/esm/str/index.d.ts.map +1 -1
  240. package/dist/esm/str/index.js +51 -76
  241. package/dist/esm/str/index.js.map +1 -1
  242. package/dist/esm/strategy/index.d.ts +102 -1
  243. package/dist/esm/strategy/index.d.ts.map +1 -1
  244. package/dist/esm/strategy/index.js +1 -1
  245. package/dist/esm/strategy/index.js.map +1 -1
  246. package/dist/esm/table/index.d.ts +330 -49
  247. package/dist/esm/table/index.d.ts.map +1 -1
  248. package/dist/esm/table/index.js +372 -61
  249. package/dist/esm/table/index.js.map +1 -1
  250. package/dist/esm/text/index.d.ts +12 -14
  251. package/dist/esm/text/index.d.ts.map +1 -1
  252. package/dist/esm/text/index.js +12 -14
  253. package/dist/esm/text/index.js.map +1 -1
  254. package/dist/esm/types/index.d.ts +15 -8
  255. package/dist/esm/types/index.d.ts.map +1 -1
  256. package/dist/esm/types/index.js +15 -8
  257. package/dist/esm/types/index.js.map +1 -1
  258. package/docs/first-indicator.md +152 -0
  259. package/docs/guide.md +1185 -0
  260. package/docs/inventory.md +772 -0
  261. package/docs/no-code.md +207 -0
  262. package/docs/recipes.md +202 -0
  263. package/package.json +2 -1
  264. package/skills/oakscript/SKILL.md +8 -0
  265. package/skills/oakscript/reference/errors.md +3 -2
  266. package/src/box/index.ts +348 -289
  267. package/src/check/node.ts +1 -0
  268. package/src/check/preview.ts +307 -0
  269. package/src/color/index.ts +11 -11
  270. package/src/color/parse.ts +7 -0
  271. package/src/compare/index.ts +76 -12
  272. package/src/drawing/registry.ts +44 -5
  273. package/src/index.ts +1 -1
  274. package/src/label/index.ts +267 -189
  275. package/src/line/index.ts +248 -208
  276. package/src/linefill/index.ts +61 -89
  277. package/src/math/index.ts +51 -42
  278. package/src/polyline/index.ts +57 -78
  279. package/src/runtime/input-active.ts +2 -2
  280. package/src/runtime/series.ts +243 -163
  281. package/src/script/api/alert.ts +43 -0
  282. package/src/script/api/calc.ts +250 -0
  283. package/src/script/api/color.ts +245 -0
  284. package/src/script/api/context.ts +944 -0
  285. package/src/script/api/log.ts +60 -0
  286. package/src/script/api/strategy.ts +410 -0
  287. package/src/script/api/ta.ts +1115 -0
  288. package/src/script/api/table.ts +538 -0
  289. package/src/script/constants.ts +229 -25
  290. package/src/script/define.ts +221 -0
  291. package/src/script/drawing-args.ts +2 -1
  292. package/src/script/formula.ts +438 -0
  293. package/src/script/globals.ts +10 -0
  294. package/src/script/index.ts +1519 -239
  295. package/src/script/json.ts +457 -0
  296. package/src/str/index.ts +51 -76
  297. package/src/strategy/index.ts +102 -1
  298. package/src/table/index.ts +388 -62
  299. package/src/text/index.ts +12 -14
  300. package/src/types/index.ts +15 -8
@@ -1,11 +1,10 @@
1
1
  /**
2
- * Line namespace
3
- * Functions for creating and manipulating line drawing objects.
2
+ * Line namespace: functions that create, read, change and delete line drawings (`line.*`).
4
3
  *
5
4
  * @remarks
6
- * While lines are primarily visual in PineScript, the line.get_price() function provides
7
- * computational value for algorithmic trading - calculating trend line breakouts,
8
- * support/resistance levels, and pattern recognition.
5
+ * A line joins two points. Its x coordinates are bar indexes (`xloc.bar_index`, the default), UNIX times in ms
6
+ * (`xloc.bar_time`) or percents of the pane's width (`xloc.pane`); its y coordinates are prices. Besides drawing,
7
+ * `line.get_price()` reads the price of a trend line on any bar, for breakout tests.
9
8
  *
10
9
  * @version 6
11
10
  */
@@ -14,310 +13,351 @@ type LineXloc = 'bar_index' | 'bar_time' | 'pane';
14
13
  type LineExtend = 'none' | 'left' | 'right' | 'both';
15
14
  type LineStyle = 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both';
16
15
  /**
17
- * Creates a new line (PineScript `line.new`), with two chart points or with coordinates:
18
- *
19
- * - `line.new(first_point, second_point, xloc?, extend?, color?, style?, width?, force_overlay?)`
20
- * - `line.new(x1, y1, x2, y2, xloc?, extend?, color?, style?, width?, force_overlay?)`
21
- *
22
- * With chart points, x is `point.index` for `bar_index` lines and `point.time` for `bar_time` lines.
23
- *
16
+ * Draws a line between two chart points and returns its handle, to change or delete it later.
17
+ * With `xloc.bar_index` the x of a point is its `index`, with `xloc.bar_time` its `time`. Lines above
18
+ * `max_lines_count` (default 50) are deleted oldest first.
19
+ * @param first_point - Start of the line (`chart.point.from_index(...)`, `chart.point.now()`...).
20
+ * @param second_point - End of the line.
21
+ * @param xloc - What the x coordinates are: `xloc.bar_index`, `xloc.bar_time` or `xloc.pane`. Default: `xloc.bar_index`.
22
+ * @param extend - Extends the line past its points: `extend.none`, `extend.left`, `extend.right` or `extend.both`.
23
+ * Default: `extend.none`.
24
+ * @param lineColor - Line colour. Default: blue (#2962FF).
25
+ * @param style - `line.style_solid`, `line.style_dotted`, `line.style_dashed`, `line.style_arrow_left`,
26
+ * `line.style_arrow_right` or `line.style_arrow_both`. Default: `line.style_solid`.
27
+ * @param width - Line width in pixels. Default: 1.
28
+ * @param force_overlay - When true, the line is drawn on the price pane even if the script has its own pane.
29
+ * Default: false.
30
+ * @returns The new line.
24
31
  * @example
25
- * ```typescript
26
- * // Create a trend line from bar 0 (price 100) to bar 50 (price 150)
27
- * const trendLine = line.new(0, 100, 50, 150, 'bar_index', 'right');
28
- * const fromPoints = line.new(chartPoint.from_index(0, 100), chartPoint.from_index(50, 150));
29
- *
30
- * // Calculate price at bar 75 (extrapolated)
31
- * const price = line.get_price(trendLine, 75); // Returns 175
32
+ * ```js
33
+ * eachBar((c) => {
34
+ * if (c.i === c.n - 1) line.new(chart.point.from_index(c.i - 20, c.get(low, 20)), chart.point.now(c.high));
35
+ * });
32
36
  * ```
33
37
  */
34
38
  export declare function new_line(first_point: ChartPoint, second_point: ChartPoint, xloc?: LineXloc, extend?: LineExtend, lineColor?: color, style?: LineStyle, width?: number, force_overlay?: boolean): Line;
39
+ /**
40
+ * Draws a line from (x1, y1) to (x2, y2) and returns its handle, to change or delete it later.
41
+ * Inside `eachBar` a Series argument is read on the current bar; the optional arguments can also be given by name in
42
+ * an object after the coordinates. A bar index x is rounded down; it may be up to 500 bars after the last bar.
43
+ * Lines above `max_lines_count` (default 50) are deleted oldest first.
44
+ * @param x1 - x of the first point: a bar index, a UNIX time in ms (`xloc.bar_time`) or a percent of the pane's
45
+ * width (`xloc.pane`).
46
+ * @param y1 - Price of the first point.
47
+ * @param x2 - x of the second point, in the same unit as `x1`.
48
+ * @param y2 - Price of the second point.
49
+ * @param xloc - What the x coordinates are: `xloc.bar_index`, `xloc.bar_time` or `xloc.pane`. Default: `xloc.bar_index`.
50
+ * @param extend - Extends the line past its points: `extend.none`, `extend.left`, `extend.right` or `extend.both`.
51
+ * Default: `extend.none`.
52
+ * @param lineColor - Line colour. Default: blue (#2962FF).
53
+ * @param style - `line.style_solid`, `line.style_dotted`, `line.style_dashed`, `line.style_arrow_left`,
54
+ * `line.style_arrow_right` or `line.style_arrow_both`. Default: `line.style_solid`.
55
+ * @param width - Line width in pixels. Default: 1.
56
+ * @param force_overlay - When true, the line is drawn on the price pane even if the script has its own pane.
57
+ * Default: false.
58
+ * @returns The new line.
59
+ * @example
60
+ * ```js
61
+ * eachBar((c) => {
62
+ * if (c.i === c.n - 1) line.new(c.i - 20, c.get(low, 20), c.i, c.low, { color: "#2962FF", extend: extend.right });
63
+ * });
64
+ * ```
65
+ */
35
66
  export declare function new_line(x1: number, y1: number, x2: number, y2: number, xloc?: LineXloc, extend?: LineExtend, lineColor?: color, style?: LineStyle, width?: number, force_overlay?: boolean): Line;
36
67
  /**
37
- * Returns the price level of a line at a given bar index (PineScript `line.get_price`).
38
- *
39
- * @param id - Line object
40
- * @param x - Bar index to calculate price at
41
- * @returns Price level at the given bar index; NaN for a vertical line (x1 == x2) or a deleted line
42
- *
43
- * @remarks
44
- * As in PineScript (#174):
45
- * - the line is read as extended on both sides whatever its `extend`: a point before x1 or after x2 has a price
46
- * - the price is `y1 + (y2 - y1) * (x - x1) / (x2 - x1)`, in that order (bit for bit)
47
- * - a line placed with `xloc.bar_time` (or `xloc.pane`) throws "'line.get_price' must be used with lines created using
48
- * 'xloc=xloc.bar_index'." (runtime error RE10119)
49
- *
68
+ * Returns the price of the line at a bar index, for example to test whether the close crossed a trend line.
69
+ * The line is read as extended on both sides whatever its `extend`, so any bar has a price.
70
+ * Only for lines placed with `xloc.bar_index`: other lines throw an error.
71
+ * @param id - The line.
72
+ * @param x - Bar index to read the price at.
73
+ * @returns The price on the line at `x`; NaN for a vertical line (x1 equal to x2) or a deleted line.
50
74
  * @example
51
- * ```typescript
52
- * const trendLine = line.new(0, 100, 50, 150, 'bar_index', 'right');
53
- *
54
- * line.get_price(trendLine, 25); // 125
55
- * line.get_price(trendLine, 100); // 200
56
- * line.get_price(trendLine, -10); // 90: extended to the left too
75
+ * ```js
76
+ * eachBar((c) => {
77
+ * const l = line.new(c.i - 10, c.get(high, 10), c.i - 1, c.get(high, 1));
78
+ * if (c.close > line.get_price(l, c.i)) label.new(c.i, c.high, "Break");
79
+ * });
57
80
  * ```
58
81
  */
59
82
  export declare function get_price(id: Line, x: number): number;
60
83
  /**
61
- * Returns the first point's x coordinate.
62
- *
63
- * @param id - Line object
64
- * @returns X coordinate of the first point
65
- *
84
+ * Returns the x coordinate of the line's first point.
85
+ * @param id - The line.
86
+ * @returns A bar index, a UNIX time in ms or a pane percent, by the line's xloc; NaN for a deleted line.
66
87
  * @example
67
- * ```typescript
68
- * const line = line.new(10, 100, 50, 150);
69
- * const x1 = line.get_x1(line); // Returns 10
88
+ * ```js
89
+ * eachBar((c) => {
90
+ * const l = line.new(c.i - 10, c.get(low, 10), c.i, c.low);
91
+ * const length = c.i - line.get_x1(l); // 10
92
+ * });
70
93
  * ```
71
94
  */
72
95
  export declare function get_x1(id: Line): number;
73
96
  /**
74
- * Returns the second point's x coordinate.
75
- *
76
- * @param id - Line object
77
- * @returns X coordinate of the second point
78
- *
97
+ * Returns the x coordinate of the line's second point.
98
+ * @param id - The line.
99
+ * @returns A bar index, a UNIX time in ms or a pane percent, by the line's xloc; NaN for a deleted line.
79
100
  * @example
80
- * ```typescript
81
- * const line = line.new(10, 100, 50, 150);
82
- * const x2 = line.get_x2(line); // Returns 50
101
+ * ```js
102
+ * eachBar((c) => {
103
+ * const l = line.new(c.i - 10, c.get(low, 10), c.i, c.low);
104
+ * const bars = line.get_x2(l) - line.get_x1(l); // 10
105
+ * });
83
106
  * ```
84
107
  */
85
108
  export declare function get_x2(id: Line): number;
86
109
  /**
87
- * Returns the first point's y coordinate (price level).
88
- *
89
- * @param id - Line object
90
- * @returns Y coordinate (price) of the first point
91
- *
110
+ * Returns the price of the line's first point.
111
+ * @param id - The line.
112
+ * @returns The price of the first point; NaN for a deleted line.
92
113
  * @example
93
- * ```typescript
94
- * const line = line.new(10, 100, 50, 150);
95
- * const y1 = line.get_y1(line); // Returns 100
114
+ * ```js
115
+ * eachBar((c) => {
116
+ * const l = line.new(c.i - 10, c.get(low, 10), c.i, c.low);
117
+ * const rising = c.low > line.get_y1(l);
118
+ * });
96
119
  * ```
97
120
  */
98
121
  export declare function get_y1(id: Line): number;
99
122
  /**
100
- * Returns the second point's y coordinate (price level).
101
- *
102
- * @param id - Line object
103
- * @returns Y coordinate (price) of the second point
104
- *
123
+ * Returns the price of the line's second point.
124
+ * @param id - The line.
125
+ * @returns The price of the second point; NaN for a deleted line.
105
126
  * @example
106
- * ```typescript
107
- * const line = line.new(10, 100, 50, 150);
108
- * const y2 = line.get_y2(line); // Returns 150
127
+ * ```js
128
+ * eachBar((c) => {
129
+ * const l = line.new(c.i - 10, c.get(low, 10), c.i, c.low);
130
+ * const change = line.get_y2(l) - line.get_y1(l);
131
+ * });
109
132
  * ```
110
133
  */
111
134
  export declare function get_y2(id: Line): number;
112
135
  /**
113
- * Creates a copy of the line object.
114
- *
115
- * @param id - Line object to copy
116
- * @returns New line object with same properties
117
- *
118
- * @remarks
119
- * Creates a shallow copy of the line. Modifications to the copy won't affect the original.
120
- *
136
+ * Makes a new line with the same points and style as `id` (it counts toward `max_lines_count`).
137
+ * Changing the copy does not change the original.
138
+ * @param id - The line to copy.
139
+ * @returns The new line.
121
140
  * @example
122
- * ```typescript
123
- * const originalLine = line.new(0, 100, 50, 150);
124
- * const copiedLine = line.copy(originalLine);
125
- *
126
- * // Modify copy without affecting original
127
- * copiedLine.y2 = 200;
141
+ * ```js
142
+ * eachBar((c) => {
143
+ * const l = line.new(c.i - 10, c.high, c.i, c.high);
144
+ * line.set_y1(line.copy(l), c.low); // a second line from the same start bar, at the low
145
+ * });
128
146
  * ```
129
147
  */
130
148
  export declare function copy(id: Line): Line;
131
149
  /**
132
- * Sets the first point's x coordinate.
133
- *
134
- * @param id - Line object to modify
135
- * @param x - New x coordinate (bar index or timestamp)
136
- * @returns Modified line object
137
- *
150
+ * Moves the x coordinate of the line's first point. Does nothing on a deleted line.
151
+ * @param id - The line.
152
+ * @param x - New x: a bar index, a UNIX time in ms or a pane percent, by the line's xloc. A bar index is rounded down.
153
+ * @returns The same line.
138
154
  * @example
139
- * ```typescript
140
- * const line = line.new(0, 100, 50, 150);
141
- * line.set_x1(line, 10); // Move first point to bar 10
155
+ * ```js
156
+ * eachBar((c) => {
157
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
158
+ * line.set_x1(l, c.i - 20);
159
+ * });
142
160
  * ```
143
161
  */
144
162
  export declare function set_x1(id: Line, x: number): Line;
145
163
  /**
146
- * Sets the second point's x coordinate.
147
- *
148
- * @param id - Line object to modify
149
- * @param x - New x coordinate (bar index or timestamp)
150
- * @returns Modified line object
151
- *
164
+ * Moves the x coordinate of the line's second point. Does nothing on a deleted line.
165
+ * @param id - The line.
166
+ * @param x - New x: a bar index, a UNIX time in ms or a pane percent, by the line's xloc. A bar index is rounded down.
167
+ * @returns The same line.
152
168
  * @example
153
- * ```typescript
154
- * const line = line.new(0, 100, 50, 150);
155
- * line.set_x2(line, 60); // Move second point to bar 60
169
+ * ```js
170
+ * eachBar((c) => {
171
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
172
+ * line.set_x2(l, c.i + 10); // reach 10 bars into the future
173
+ * });
156
174
  * ```
157
175
  */
158
176
  export declare function set_x2(id: Line, x: number): Line;
159
177
  /**
160
- * Sets the first point's y coordinate (price level).
161
- *
162
- * @param id - Line object to modify
163
- * @param y - New y coordinate (price)
164
- * @returns Modified line object
165
- *
178
+ * Moves the price of the line's first point. Does nothing on a deleted line.
179
+ * @param id - The line.
180
+ * @param y - New price.
181
+ * @returns The same line.
166
182
  * @example
167
- * ```typescript
168
- * const line = line.new(0, 100, 50, 150);
169
- * line.set_y1(line, 110); // Move first point to price 110
183
+ * ```js
184
+ * eachBar((c) => {
185
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
186
+ * line.set_y1(l, c.get(low, 10));
187
+ * });
170
188
  * ```
171
189
  */
172
190
  export declare function set_y1(id: Line, y: number): Line;
173
191
  /**
174
- * Sets the second point's y coordinate (price level).
175
- *
176
- * @param id - Line object to modify
177
- * @param y - New y coordinate (price)
178
- * @returns Modified line object
179
- *
192
+ * Moves the price of the line's second point. Does nothing on a deleted line.
193
+ * @param id - The line.
194
+ * @param y - New price.
195
+ * @returns The same line.
180
196
  * @example
181
- * ```typescript
182
- * const line = line.new(0, 100, 50, 150);
183
- * line.set_y2(line, 160); // Move second point to price 160
197
+ * ```js
198
+ * eachBar((c) => {
199
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
200
+ * line.set_y2(l, c.high);
201
+ * });
184
202
  * ```
185
203
  */
186
204
  export declare function set_y2(id: Line, y: number): Line;
187
205
  /**
188
- * Sets both coordinates of the first point.
189
- *
190
- * @param id - Line object to modify
191
- * @param x - New x coordinate
192
- * @param y - New y coordinate
193
- * @returns Modified line object
194
- *
206
+ * Moves the line's first point (x and price). Does nothing on a deleted line.
207
+ * @param id - The line.
208
+ * @param x - New x: a bar index, a UNIX time in ms or a pane percent, by the line's xloc. A bar index is rounded down.
209
+ * @param y - New price.
210
+ * @returns The same line.
195
211
  * @example
196
- * ```typescript
197
- * const line = line.new(0, 100, 50, 150);
198
- * line.set_xy1(line, 5, 105); // Move first point to (5, 105)
212
+ * ```js
213
+ * eachBar((c) => {
214
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
215
+ * line.set_xy1(l, c.i - 20, c.get(low, 20));
216
+ * });
199
217
  * ```
200
218
  */
201
219
  export declare function set_xy1(id: Line, x: number, y: number): Line;
202
220
  /**
203
- * Sets both coordinates of the second point.
204
- *
205
- * @param id - Line object to modify
206
- * @param x - New x coordinate
207
- * @param y - New y coordinate
208
- * @returns Modified line object
209
- *
221
+ * Moves the line's second point (x and price). Does nothing on a deleted line.
222
+ * @param id - The line.
223
+ * @param x - New x: a bar index, a UNIX time in ms or a pane percent, by the line's xloc. A bar index is rounded down.
224
+ * @param y - New price.
225
+ * @returns The same line.
210
226
  * @example
211
- * ```typescript
212
- * const line = line.new(0, 100, 50, 150);
213
- * line.set_xy2(line, 60, 160); // Move second point to (60, 160)
227
+ * ```js
228
+ * eachBar((c) => {
229
+ * const l = line.new(c.i - 10, c.low, c.i - 1, c.low);
230
+ * line.set_xy2(l, c.i, c.close);
231
+ * });
214
232
  * ```
215
233
  */
216
234
  export declare function set_xy2(id: Line, x: number, y: number): Line;
217
235
  /**
218
- * Sets the coordinate system for the line.
219
- *
220
- * @param id - Line object to modify
221
- * @param x1 - New first point x coordinate
222
- * @param x2 - New second point x coordinate
223
- * @param xloc - New coordinate system ('bar_index', 'bar_time' or 'pane')
224
- * @returns Modified line object
225
- *
226
- * @remarks
227
- * When changing xloc, you must provide appropriate x coordinates for the new system.
228
- *
236
+ * Changes what the line's x coordinates are and sets both of them in that unit. Does nothing on a deleted line.
237
+ * @param id - The line.
238
+ * @param x1 - New x of the first point, in the unit of `xloc`.
239
+ * @param x2 - New x of the second point, in the unit of `xloc`.
240
+ * @param xloc - `xloc.bar_index` (bar indexes), `xloc.bar_time` (UNIX times in ms) or `xloc.pane` (percents of the
241
+ * pane's width).
242
+ * @returns The same line.
229
243
  * @example
230
- * ```typescript
231
- * const line = line.new(0, 100, 50, 150);
232
- * // Change to timestamp-based coordinates
233
- * line.set_xloc(line, 1609459200000, 1609545600000, 'bar_time');
244
+ * ```js
245
+ * eachBar((c) => {
246
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
247
+ * line.set_xloc(l, c.time - 3600000, c.time, xloc.bar_time);
248
+ * });
234
249
  * ```
235
250
  */
236
251
  export declare function set_xloc(id: Line, x1: number, x2: number, xloc: 'bar_index' | 'bar_time' | 'pane'): Line;
237
252
  /**
238
- * Sets the extension mode of the line.
239
- *
240
- * @param id - Line object to modify
241
- * @param extend - New extension mode
242
- * @returns Modified line object
243
- *
253
+ * Sets whether the line continues past its points. Does nothing on a deleted line.
254
+ * @param id - The line.
255
+ * @param extend - `extend.none`, `extend.left`, `extend.right` or `extend.both`.
256
+ * @returns The same line.
244
257
  * @example
245
- * ```typescript
246
- * const line = line.new(0, 100, 50, 150);
247
- * line.set_extend(line, 'right'); // Extend line to the right
258
+ * ```js
259
+ * eachBar((c) => {
260
+ * const l = line.new(c.i - 10, c.get(low, 10), c.i, c.low);
261
+ * line.set_extend(l, extend.right);
262
+ * });
248
263
  * ```
249
264
  */
250
265
  export declare function set_extend(id: Line, extend: 'none' | 'left' | 'right' | 'both'): Line;
251
266
  /**
252
- * Sets the line color.
253
- *
254
- * @param id - Line object to modify
255
- * @param color - New line color
256
- * @returns Modified line object
257
- *
267
+ * Sets the line colour. Does nothing on a deleted line.
268
+ * @param id - The line.
269
+ * @param lineColor - New colour (`color.red`, `"#FF0000"`, `color.new(color.red, 50)`...).
270
+ * @returns The same line.
258
271
  * @example
259
- * ```typescript
260
- * const line = line.new(0, 100, 50, 150);
261
- * line.set_color(line, '#FF0000'); // Change to red
272
+ * ```js
273
+ * eachBar((c) => {
274
+ * const l = line.new(c.i - 10, c.get(close, 10), c.i, c.close);
275
+ * line.set_color(l, c.close > c.get(close, 10) ? color.green : color.red);
276
+ * });
262
277
  * ```
263
278
  */
264
279
  export declare function set_color(id: Line, lineColor: color): Line;
265
280
  /**
266
- * Sets the line style.
267
- *
268
- * @param id - Line object to modify
269
- * @param style - New line style
270
- * @returns Modified line object
271
- *
281
+ * Sets the line style (solid, dotted, dashed, or with arrow heads). Does nothing on a deleted line.
282
+ * @param id - The line.
283
+ * @param style - `line.style_solid`, `line.style_dotted`, `line.style_dashed`, `line.style_arrow_left`,
284
+ * `line.style_arrow_right` or `line.style_arrow_both`.
285
+ * @returns The same line.
272
286
  * @example
273
- * ```typescript
274
- * const line = line.new(0, 100, 50, 150);
275
- * line.set_style(line, 'dashed'); // Change to dashed line
287
+ * ```js
288
+ * eachBar((c) => {
289
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
290
+ * line.set_style(l, line.style_dashed);
291
+ * });
276
292
  * ```
277
293
  */
278
294
  export declare function set_style(id: Line, style: 'solid' | 'dotted' | 'dashed' | 'arrow_left' | 'arrow_right' | 'arrow_both'): Line;
279
295
  /**
280
- * Sets the line width.
281
- *
282
- * @param id - Line object to modify
283
- * @param width - New line width in pixels
284
- * @returns Modified line object
285
- *
296
+ * Sets the line width. Does nothing on a deleted line.
297
+ * @param id - The line.
298
+ * @param width - New width in pixels.
299
+ * @returns The same line.
286
300
  * @example
287
- * ```typescript
288
- * const line = line.new(0, 100, 50, 150);
289
- * line.set_width(line, 3); // Make line thicker
301
+ * ```js
302
+ * eachBar((c) => {
303
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
304
+ * line.set_width(l, 3);
305
+ * });
290
306
  * ```
291
307
  */
292
308
  export declare function set_width(id: Line, width: number): Line;
293
309
  /**
294
- * Deletes the line object.
295
- *
296
- * @param id - Line object to delete
297
- *
298
- * @remarks
299
- * Removes the line from `line.all()`. As in PineScript, the deleted line is `na`: its getters
300
- * return NaN and its setters do nothing. Deleting it twice has no effect. Deleting a line also deletes the linefills that use it.
301
- *
310
+ * Removes the line from the chart and from `line.all`. The linefills that use it are deleted too.
311
+ * Afterwards its getters return NaN and its setters do nothing; deleting it again does nothing.
312
+ * @param id - The line to delete.
302
313
  * @example
303
- * ```typescript
304
- * const line = line.new(0, 100, 50, 150);
305
- * line.delete(line);
306
- * // line.all() no longer contains it
314
+ * ```js
315
+ * eachBar((c) => {
316
+ * const l = line.new(c.i - 1, c.get(close, 1), c.i, c.close);
317
+ * if (c.i < c.n - 1) line.delete(l); // keep only the line of the last bar
318
+ * });
307
319
  * ```
308
320
  */
309
321
  export declare function delete_line(id: Line): void;
310
322
  /**
311
- * All live lines, in creation order (PineScript `line.all`). A new array: later changes do not affect it.
323
+ * Returns the lines that are still on the chart, oldest first. The array is a copy: later changes do not affect it.
324
+ * (In a script, `line.all` is read as a value, without a call.)
325
+ * @returns The live lines in creation order.
326
+ * @example
327
+ * ```js
328
+ * eachBar((c) => {
329
+ * if (c.i === c.n - 1) for (const l of line.all) line.set_color(l, color.gray);
330
+ * });
331
+ * ```
312
332
  */
313
333
  export declare function all(): Line[];
314
334
  /**
315
- * Sets the first point of the line from a chart point: `point.index` for `bar_index` lines,
316
- * `point.time` for `bar_time` lines (`na` when the point does not have it), and `point.price`.
335
+ * Moves the line's first point to a chart point: its `index` for a `xloc.bar_index` line, its `time` for a
336
+ * `xloc.bar_time` line (NaN when the point has none), and its `price`. Does nothing on a deleted line.
337
+ * @param id - The line.
338
+ * @param point - The new first point.
339
+ * @returns The same line.
340
+ * @example
341
+ * ```js
342
+ * eachBar((c) => {
343
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
344
+ * line.set_first_point(l, chart.point.from_index(c.i - 20, c.get(low, 20)));
345
+ * });
346
+ * ```
317
347
  */
318
348
  export declare function set_first_point(id: Line, point: ChartPoint): Line;
319
349
  /**
320
- * Sets the second point of the line from a chart point (see {@link set_first_point}).
350
+ * Moves the line's second point to a chart point (see `line.set_first_point`). Does nothing on a deleted line.
351
+ * @param id - The line.
352
+ * @param point - The new second point.
353
+ * @returns The same line.
354
+ * @example
355
+ * ```js
356
+ * eachBar((c) => {
357
+ * const l = line.new(c.i - 10, c.low, c.i, c.low);
358
+ * line.set_second_point(l, chart.point.now(c.high));
359
+ * });
360
+ * ```
321
361
  */
322
362
  export declare function set_second_point(id: Line, point: ChartPoint): Line;
323
363
  export { new_line as new };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/line/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEjE,KAAK,QAAQ,GAAG,WAAW,GAAG,UAAU,GAAG,MAAM,CAAC;AAClD,KAAK,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;AACrD,KAAK,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;AAE7F;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CACtB,WAAW,EAAE,UAAU,EACvB,YAAY,EAAE,UAAU,EACxB,IAAI,CAAC,EAAE,QAAQ,EACf,MAAM,CAAC,EAAE,UAAU,EACnB,SAAS,CAAC,EAAE,KAAK,EACjB,KAAK,CAAC,EAAE,SAAS,EACjB,KAAK,CAAC,EAAE,MAAM,EACd,aAAa,CAAC,EAAE,OAAO,GACtB,IAAI,CAAC;AACR,wBAAgB,QAAQ,CACtB,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,IAAI,CAAC,EAAE,QAAQ,EACf,MAAM,CAAC,EAAE,UAAU,EACnB,SAAS,CAAC,EAAE,K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