oakscriptjs 0.8.2 → 0.9.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 (555) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +31 -9
  3. package/dist/cjs/array/index.d.ts +701 -0
  4. package/dist/cjs/array/index.d.ts.map +1 -0
  5. package/dist/cjs/array/index.js +393 -0
  6. package/dist/cjs/array/index.js.map +7 -0
  7. package/dist/cjs/box/index.d.ts +444 -0
  8. package/dist/cjs/box/index.d.ts.map +1 -0
  9. package/dist/cjs/box/index.js +246 -0
  10. package/dist/cjs/box/index.js.map +7 -0
  11. package/dist/cjs/callsite/index.d.ts +88 -0
  12. package/dist/cjs/callsite/index.d.ts.map +1 -0
  13. package/dist/cjs/callsite/index.js +112 -0
  14. package/dist/cjs/callsite/index.js.map +7 -0
  15. package/dist/cjs/chartpoint/index.d.ts +90 -0
  16. package/dist/cjs/chartpoint/index.d.ts.map +1 -0
  17. package/dist/cjs/chartpoint/index.js +56 -0
  18. package/dist/cjs/chartpoint/index.js.map +7 -0
  19. package/dist/cjs/color/index.d.ts +286 -0
  20. package/dist/cjs/color/index.d.ts.map +1 -0
  21. package/dist/cjs/color/index.js +122 -0
  22. package/dist/cjs/color/index.js.map +7 -0
  23. package/dist/cjs/color/parse.d.ts +29 -0
  24. package/dist/cjs/color/parse.d.ts.map +1 -0
  25. package/dist/cjs/color/parse.js +57 -0
  26. package/dist/cjs/color/parse.js.map +7 -0
  27. package/dist/cjs/compare/index.d.ts +26 -0
  28. package/dist/cjs/compare/index.d.ts.map +1 -0
  29. package/dist/cjs/compare/index.js +50 -0
  30. package/dist/cjs/compare/index.js.map +7 -0
  31. package/dist/cjs/drawing/registry.d.ts +42 -0
  32. package/dist/cjs/drawing/registry.d.ts.map +1 -0
  33. package/dist/cjs/drawing/registry.js +87 -0
  34. package/dist/cjs/drawing/registry.js.map +7 -0
  35. package/dist/cjs/index.d.ts +85 -0
  36. package/dist/cjs/index.d.ts.map +1 -0
  37. package/dist/cjs/index.js +184 -0
  38. package/dist/cjs/index.js.map +7 -0
  39. package/dist/cjs/indicator.d.ts +117 -0
  40. package/dist/cjs/indicator.d.ts.map +1 -0
  41. package/dist/cjs/indicator.js +74 -0
  42. package/dist/cjs/indicator.js.map +7 -0
  43. package/dist/cjs/input.d.ts +196 -0
  44. package/dist/cjs/input.d.ts.map +1 -0
  45. package/dist/cjs/input.js +197 -0
  46. package/dist/cjs/input.js.map +7 -0
  47. package/dist/cjs/label/index.d.ts +303 -0
  48. package/dist/cjs/label/index.d.ts.map +1 -0
  49. package/dist/cjs/label/index.js +190 -0
  50. package/dist/cjs/label/index.js.map +7 -0
  51. package/dist/cjs/lib/index.d.ts +8 -0
  52. package/dist/cjs/lib/index.d.ts.map +1 -0
  53. package/dist/cjs/lib/index.js +19 -0
  54. package/dist/cjs/lib/index.js.map +7 -0
  55. package/dist/{lib → cjs/lib}/zigzag/index.d.ts +4 -1
  56. package/dist/cjs/lib/zigzag/index.d.ts.map +1 -0
  57. package/dist/cjs/lib/zigzag/index.js +27 -0
  58. package/dist/cjs/lib/zigzag/index.js.map +7 -0
  59. package/dist/cjs/lib/zigzag/zigzag.d.ts +100 -0
  60. package/dist/cjs/lib/zigzag/zigzag.d.ts.map +1 -0
  61. package/dist/cjs/lib/zigzag/zigzag.js +207 -0
  62. package/dist/cjs/lib/zigzag/zigzag.js.map +7 -0
  63. package/dist/cjs/line/index.d.ts +342 -0
  64. package/dist/cjs/line/index.d.ts.map +1 -0
  65. package/dist/cjs/line/index.js +193 -0
  66. package/dist/cjs/line/index.js.map +7 -0
  67. package/dist/cjs/linefill/index.d.ts +124 -0
  68. package/dist/cjs/linefill/index.d.ts.map +1 -0
  69. package/dist/cjs/linefill/index.js +56 -0
  70. package/dist/cjs/linefill/index.js.map +7 -0
  71. package/dist/cjs/map/index.d.ts +69 -0
  72. package/dist/cjs/map/index.d.ts.map +1 -0
  73. package/dist/cjs/map/index.js +80 -0
  74. package/dist/cjs/map/index.js.map +7 -0
  75. package/dist/cjs/math/index.d.ts +560 -0
  76. package/dist/cjs/math/index.d.ts.map +1 -0
  77. package/dist/cjs/math/index.js +441 -0
  78. package/dist/cjs/math/index.js.map +7 -0
  79. package/dist/cjs/matrix/index.d.ts +1231 -0
  80. package/dist/cjs/matrix/index.d.ts.map +1 -0
  81. package/dist/cjs/matrix/index.js +1200 -0
  82. package/dist/cjs/matrix/index.js.map +7 -0
  83. package/dist/cjs/package.json +1 -0
  84. package/dist/cjs/plot.d.ts +76 -0
  85. package/dist/cjs/plot.d.ts.map +1 -0
  86. package/dist/cjs/plot.js +51 -0
  87. package/dist/cjs/plot.js.map +7 -0
  88. package/dist/cjs/polyline/index.d.ts +115 -0
  89. package/dist/cjs/polyline/index.d.ts.map +1 -0
  90. package/dist/cjs/polyline/index.js +76 -0
  91. package/dist/cjs/polyline/index.js.map +7 -0
  92. package/dist/cjs/runtime/adapters/LightweightChartsAdapter.d.ts +86 -0
  93. package/dist/cjs/runtime/adapters/LightweightChartsAdapter.d.ts.map +1 -0
  94. package/dist/cjs/runtime/adapters/LightweightChartsAdapter.js +141 -0
  95. package/dist/cjs/runtime/adapters/LightweightChartsAdapter.js.map +7 -0
  96. package/dist/cjs/runtime/adapters/SimpleInputAdapter.d.ts +59 -0
  97. package/dist/cjs/runtime/adapters/SimpleInputAdapter.d.ts.map +1 -0
  98. package/dist/cjs/runtime/adapters/SimpleInputAdapter.js +117 -0
  99. package/dist/cjs/runtime/adapters/SimpleInputAdapter.js.map +7 -0
  100. package/dist/{runtime → cjs/runtime}/index.d.ts +12 -5
  101. package/dist/cjs/runtime/index.d.ts.map +1 -0
  102. package/dist/cjs/runtime/index.js +49 -0
  103. package/dist/cjs/runtime/index.js.map +7 -0
  104. package/dist/cjs/runtime/inputs.d.ts +91 -0
  105. package/dist/cjs/runtime/inputs.d.ts.map +1 -0
  106. package/dist/cjs/runtime/inputs.js +262 -0
  107. package/dist/cjs/runtime/inputs.js.map +7 -0
  108. package/dist/cjs/runtime/runtime.d.ts +70 -0
  109. package/dist/cjs/runtime/runtime.d.ts.map +1 -0
  110. package/dist/cjs/runtime/runtime.js +148 -0
  111. package/dist/cjs/runtime/runtime.js.map +7 -0
  112. package/dist/cjs/runtime/series.d.ts +362 -0
  113. package/dist/cjs/runtime/series.d.ts.map +1 -0
  114. package/dist/cjs/runtime/series.js +560 -0
  115. package/dist/cjs/runtime/series.js.map +7 -0
  116. package/dist/cjs/runtime/types.d.ts +282 -0
  117. package/dist/cjs/runtime/types.d.ts.map +1 -0
  118. package/dist/cjs/runtime/types.js +17 -0
  119. package/dist/cjs/runtime/types.js.map +7 -0
  120. package/dist/cjs/script/index.d.ts +991 -0
  121. package/dist/cjs/script/index.d.ts.map +1 -0
  122. package/dist/cjs/script/index.js +1174 -0
  123. package/dist/cjs/script/index.js.map +7 -0
  124. package/dist/cjs/security/resample.d.ts +63 -0
  125. package/dist/cjs/security/resample.d.ts.map +1 -0
  126. package/dist/cjs/security/resample.js +84 -0
  127. package/dist/cjs/security/resample.js.map +7 -0
  128. package/dist/cjs/session/bars.d.ts +80 -0
  129. package/dist/cjs/session/bars.d.ts.map +1 -0
  130. package/dist/cjs/session/bars.js +219 -0
  131. package/dist/cjs/session/bars.js.map +7 -0
  132. package/dist/cjs/session/calendar.d.ts +70 -0
  133. package/dist/cjs/session/calendar.d.ts.map +1 -0
  134. package/dist/cjs/session/calendar.js +164 -0
  135. package/dist/cjs/session/calendar.js.map +7 -0
  136. package/dist/cjs/str/dateformat.d.ts +15 -0
  137. package/dist/cjs/str/dateformat.d.ts.map +1 -0
  138. package/dist/cjs/str/dateformat.js +149 -0
  139. package/dist/cjs/str/dateformat.js.map +7 -0
  140. package/dist/cjs/str/index.d.ts +459 -0
  141. package/dist/cjs/str/index.d.ts.map +1 -0
  142. package/dist/cjs/str/index.js +143 -0
  143. package/dist/cjs/str/index.js.map +7 -0
  144. package/dist/cjs/str/messageformat.d.ts +14 -0
  145. package/dist/cjs/str/messageformat.d.ts.map +1 -0
  146. package/dist/cjs/str/messageformat.js +114 -0
  147. package/dist/cjs/str/messageformat.js.map +7 -0
  148. package/dist/cjs/str/numberformat.d.ts +19 -0
  149. package/dist/cjs/str/numberformat.d.ts.map +1 -0
  150. package/dist/cjs/str/numberformat.js +170 -0
  151. package/dist/cjs/str/numberformat.js.map +7 -0
  152. package/dist/{strategy → cjs/strategy}/index.d.ts +50 -0
  153. package/dist/cjs/strategy/index.d.ts.map +1 -0
  154. package/dist/cjs/strategy/index.js +92 -0
  155. package/dist/cjs/strategy/index.js.map +7 -0
  156. package/dist/cjs/ta/index.d.ts +1400 -0
  157. package/dist/cjs/ta/index.d.ts.map +1 -0
  158. package/dist/cjs/ta/index.js +1719 -0
  159. package/dist/cjs/ta/index.js.map +7 -0
  160. package/dist/cjs/ta/running-sum.d.ts +30 -0
  161. package/dist/cjs/ta/running-sum.d.ts.map +1 -0
  162. package/dist/cjs/ta/running-sum.js +99 -0
  163. package/dist/cjs/ta/running-sum.js.map +7 -0
  164. package/dist/cjs/ta-series.d.ts +558 -0
  165. package/dist/cjs/ta-series.d.ts.map +1 -0
  166. package/dist/cjs/ta-series.js +606 -0
  167. package/dist/cjs/ta-series.js.map +7 -0
  168. package/dist/cjs/text/index.d.ts +14 -0
  169. package/dist/cjs/text/index.d.ts.map +1 -0
  170. package/dist/cjs/text/index.js +29 -0
  171. package/dist/cjs/text/index.js.map +7 -0
  172. package/dist/cjs/time/datestring.d.ts +23 -0
  173. package/dist/cjs/time/datestring.d.ts.map +1 -0
  174. package/dist/cjs/time/datestring.js +106 -0
  175. package/dist/cjs/time/datestring.js.map +7 -0
  176. package/dist/cjs/time/index.d.ts +89 -0
  177. package/dist/cjs/time/index.d.ts.map +1 -0
  178. package/dist/cjs/time/index.js +85 -0
  179. package/dist/cjs/time/index.js.map +7 -0
  180. package/dist/cjs/time/session.d.ts +17 -0
  181. package/dist/cjs/time/session.d.ts.map +1 -0
  182. package/dist/cjs/time/session.js +65 -0
  183. package/dist/cjs/time/session.js.map +7 -0
  184. package/dist/cjs/time/timezone.d.ts +40 -0
  185. package/dist/cjs/time/timezone.d.ts.map +1 -0
  186. package/dist/cjs/time/timezone.js +125 -0
  187. package/dist/cjs/time/timezone.js.map +7 -0
  188. package/dist/cjs/timeframe/index.d.ts +73 -0
  189. package/dist/cjs/timeframe/index.d.ts.map +1 -0
  190. package/dist/cjs/timeframe/index.js +85 -0
  191. package/dist/cjs/timeframe/index.js.map +7 -0
  192. package/dist/cjs/types/index.d.ts +343 -0
  193. package/dist/cjs/types/index.d.ts.map +1 -0
  194. package/dist/cjs/types/index.js +32 -0
  195. package/dist/cjs/types/index.js.map +7 -0
  196. package/dist/cjs/types/metadata.d.ts +300 -0
  197. package/dist/cjs/types/metadata.d.ts.map +1 -0
  198. package/dist/cjs/types/metadata.js +17 -0
  199. package/dist/cjs/types/metadata.js.map +7 -0
  200. package/dist/cjs/utils/index.d.ts +167 -0
  201. package/dist/cjs/utils/index.d.ts.map +1 -0
  202. package/dist/cjs/utils/index.js +209 -0
  203. package/dist/cjs/utils/index.js.map +7 -0
  204. package/dist/esm/array/index.d.ts +701 -0
  205. package/dist/esm/array/index.d.ts.map +1 -0
  206. package/dist/esm/array/index.js +984 -0
  207. package/dist/esm/array/index.js.map +1 -0
  208. package/dist/esm/box/index.d.ts +444 -0
  209. package/dist/esm/box/index.d.ts.map +1 -0
  210. package/dist/esm/box/index.js +602 -0
  211. package/dist/esm/box/index.js.map +1 -0
  212. package/dist/esm/callsite/index.d.ts +88 -0
  213. package/dist/esm/callsite/index.d.ts.map +1 -0
  214. package/dist/esm/callsite/index.js +176 -0
  215. package/dist/esm/callsite/index.js.map +1 -0
  216. package/dist/esm/chartpoint/index.d.ts +90 -0
  217. package/dist/esm/chartpoint/index.d.ts.map +1 -0
  218. package/dist/esm/chartpoint/index.js +113 -0
  219. package/dist/esm/chartpoint/index.js.map +1 -0
  220. package/dist/esm/color/index.d.ts +286 -0
  221. package/dist/esm/color/index.d.ts.map +1 -0
  222. package/dist/esm/color/index.js +350 -0
  223. package/dist/esm/color/index.js.map +1 -0
  224. package/dist/esm/color/parse.d.ts +29 -0
  225. package/dist/esm/color/parse.d.ts.map +1 -0
  226. package/dist/esm/color/parse.js +55 -0
  227. package/dist/esm/color/parse.js.map +1 -0
  228. package/dist/esm/compare/index.d.ts +26 -0
  229. package/dist/esm/compare/index.d.ts.map +1 -0
  230. package/dist/esm/compare/index.js +39 -0
  231. package/dist/esm/compare/index.js.map +1 -0
  232. package/dist/esm/drawing/registry.d.ts +42 -0
  233. package/dist/esm/drawing/registry.d.ts.map +1 -0
  234. package/dist/esm/drawing/registry.js +89 -0
  235. package/dist/esm/drawing/registry.js.map +1 -0
  236. package/dist/esm/index.d.ts +85 -0
  237. package/dist/esm/index.d.ts.map +1 -0
  238. package/dist/esm/index.js +96 -0
  239. package/dist/esm/index.js.map +1 -0
  240. package/dist/esm/indicator.d.ts +117 -0
  241. package/dist/esm/indicator.d.ts.map +1 -0
  242. package/dist/esm/indicator.js +84 -0
  243. package/dist/esm/indicator.js.map +1 -0
  244. package/dist/esm/input.d.ts +196 -0
  245. package/dist/esm/input.d.ts.map +1 -0
  246. package/dist/esm/input.js +183 -0
  247. package/dist/esm/input.js.map +1 -0
  248. package/dist/esm/label/index.d.ts +303 -0
  249. package/dist/esm/label/index.d.ts.map +1 -0
  250. package/dist/esm/label/index.js +417 -0
  251. package/dist/esm/label/index.js.map +1 -0
  252. package/dist/esm/lib/index.d.ts +8 -0
  253. package/dist/esm/lib/index.d.ts.map +1 -0
  254. package/dist/esm/lib/index.js +8 -0
  255. package/dist/esm/lib/index.js.map +1 -0
  256. package/dist/esm/lib/zigzag/index.d.ts +5 -0
  257. package/dist/esm/lib/zigzag/index.d.ts.map +1 -0
  258. package/dist/esm/lib/zigzag/index.js +5 -0
  259. package/dist/esm/lib/zigzag/index.js.map +1 -0
  260. package/dist/esm/lib/zigzag/zigzag.d.ts +100 -0
  261. package/dist/esm/lib/zigzag/zigzag.d.ts.map +1 -0
  262. package/dist/esm/lib/zigzag/zigzag.js +229 -0
  263. package/dist/esm/lib/zigzag/zigzag.js.map +1 -0
  264. package/dist/esm/line/index.d.ts +342 -0
  265. package/dist/esm/line/index.d.ts.map +1 -0
  266. package/dist/esm/line/index.js +470 -0
  267. package/dist/esm/line/index.js.map +1 -0
  268. package/dist/esm/linefill/index.d.ts +124 -0
  269. package/dist/esm/linefill/index.d.ts.map +1 -0
  270. package/dist/esm/linefill/index.js +144 -0
  271. package/dist/esm/linefill/index.js.map +1 -0
  272. package/dist/esm/map/index.d.ts +69 -0
  273. package/dist/esm/map/index.d.ts.map +1 -0
  274. package/dist/esm/map/index.js +106 -0
  275. package/dist/esm/map/index.js.map +1 -0
  276. package/dist/esm/math/index.d.ts +560 -0
  277. package/dist/esm/math/index.d.ts.map +1 -0
  278. package/dist/esm/math/index.js +495 -0
  279. package/dist/esm/math/index.js.map +1 -0
  280. package/dist/esm/matrix/index.d.ts +1231 -0
  281. package/dist/esm/matrix/index.d.ts.map +1 -0
  282. package/dist/esm/matrix/index.js +2450 -0
  283. package/dist/esm/matrix/index.js.map +1 -0
  284. package/dist/esm/plot.d.ts +76 -0
  285. package/dist/esm/plot.d.ts.map +1 -0
  286. package/dist/esm/plot.js +63 -0
  287. package/dist/esm/plot.js.map +1 -0
  288. package/dist/esm/polyline/index.d.ts +115 -0
  289. package/dist/esm/polyline/index.d.ts.map +1 -0
  290. package/dist/esm/polyline/index.js +157 -0
  291. package/dist/esm/polyline/index.js.map +1 -0
  292. package/dist/esm/runtime/adapters/LightweightChartsAdapter.d.ts +86 -0
  293. package/dist/esm/runtime/adapters/LightweightChartsAdapter.d.ts.map +1 -0
  294. package/dist/esm/runtime/adapters/LightweightChartsAdapter.js +140 -0
  295. package/dist/esm/runtime/adapters/LightweightChartsAdapter.js.map +1 -0
  296. package/dist/esm/runtime/adapters/SimpleInputAdapter.d.ts +59 -0
  297. package/dist/esm/runtime/adapters/SimpleInputAdapter.d.ts.map +1 -0
  298. package/dist/esm/runtime/adapters/SimpleInputAdapter.js +115 -0
  299. package/dist/esm/runtime/adapters/SimpleInputAdapter.js.map +1 -0
  300. package/dist/esm/runtime/index.d.ts +13 -0
  301. package/dist/esm/runtime/index.d.ts.map +1 -0
  302. package/dist/esm/runtime/index.js +14 -0
  303. package/dist/esm/runtime/index.js.map +1 -0
  304. package/dist/esm/runtime/inputs.d.ts +91 -0
  305. package/dist/esm/runtime/inputs.d.ts.map +1 -0
  306. package/dist/esm/runtime/inputs.js +334 -0
  307. package/dist/esm/runtime/inputs.js.map +1 -0
  308. package/dist/esm/runtime/runtime.d.ts +70 -0
  309. package/dist/esm/runtime/runtime.d.ts.map +1 -0
  310. package/dist/esm/runtime/runtime.js +193 -0
  311. package/dist/esm/runtime/runtime.js.map +1 -0
  312. package/dist/esm/runtime/series.d.ts +362 -0
  313. package/dist/esm/runtime/series.d.ts.map +1 -0
  314. package/dist/esm/runtime/series.js +583 -0
  315. package/dist/esm/runtime/series.js.map +1 -0
  316. package/dist/esm/runtime/types.d.ts +282 -0
  317. package/dist/esm/runtime/types.d.ts.map +1 -0
  318. package/dist/esm/runtime/types.js +7 -0
  319. package/dist/esm/runtime/types.js.map +1 -0
  320. package/dist/esm/script/index.d.ts +991 -0
  321. package/dist/esm/script/index.d.ts.map +1 -0
  322. package/dist/esm/script/index.js +1294 -0
  323. package/dist/esm/script/index.js.map +1 -0
  324. package/dist/esm/security/resample.d.ts +63 -0
  325. package/dist/esm/security/resample.d.ts.map +1 -0
  326. package/dist/esm/security/resample.js +110 -0
  327. package/dist/esm/security/resample.js.map +1 -0
  328. package/dist/esm/session/bars.d.ts +80 -0
  329. package/dist/esm/session/bars.d.ts.map +1 -0
  330. package/dist/esm/session/bars.js +232 -0
  331. package/dist/esm/session/bars.js.map +1 -0
  332. package/dist/esm/session/calendar.d.ts +70 -0
  333. package/dist/esm/session/calendar.d.ts.map +1 -0
  334. package/dist/esm/session/calendar.js +172 -0
  335. package/dist/esm/session/calendar.js.map +1 -0
  336. package/dist/esm/str/dateformat.d.ts +15 -0
  337. package/dist/esm/str/dateformat.d.ts.map +1 -0
  338. package/dist/esm/str/dateformat.js +136 -0
  339. package/dist/esm/str/dateformat.js.map +1 -0
  340. package/dist/esm/str/index.d.ts +459 -0
  341. package/dist/esm/str/index.d.ts.map +1 -0
  342. package/dist/esm/str/index.js +540 -0
  343. package/dist/esm/str/index.js.map +1 -0
  344. package/dist/esm/str/messageformat.d.ts +14 -0
  345. package/dist/esm/str/messageformat.d.ts.map +1 -0
  346. package/dist/esm/str/messageformat.js +111 -0
  347. package/dist/esm/str/messageformat.js.map +1 -0
  348. package/dist/esm/str/numberformat.d.ts +19 -0
  349. package/dist/esm/str/numberformat.d.ts.map +1 -0
  350. package/dist/esm/str/numberformat.js +189 -0
  351. package/dist/esm/str/numberformat.js.map +1 -0
  352. package/dist/esm/strategy/index.d.ts +245 -0
  353. package/dist/esm/strategy/index.d.ts.map +1 -0
  354. package/dist/esm/strategy/index.js +84 -0
  355. package/dist/esm/strategy/index.js.map +1 -0
  356. package/dist/esm/ta/index.d.ts +1400 -0
  357. package/dist/esm/ta/index.d.ts.map +1 -0
  358. package/dist/esm/ta/index.js +3236 -0
  359. package/dist/esm/ta/index.js.map +1 -0
  360. package/dist/esm/ta/running-sum.d.ts +30 -0
  361. package/dist/esm/ta/running-sum.d.ts.map +1 -0
  362. package/dist/esm/ta/running-sum.js +113 -0
  363. package/dist/esm/ta/running-sum.js.map +1 -0
  364. package/dist/esm/ta-series.d.ts +558 -0
  365. package/dist/esm/ta-series.d.ts.map +1 -0
  366. package/dist/esm/ta-series.js +910 -0
  367. package/dist/esm/ta-series.js.map +1 -0
  368. package/dist/esm/text/index.d.ts +14 -0
  369. package/dist/esm/text/index.d.ts.map +1 -0
  370. package/dist/esm/text/index.js +14 -0
  371. package/dist/esm/text/index.js.map +1 -0
  372. package/dist/esm/time/datestring.d.ts +23 -0
  373. package/dist/esm/time/datestring.d.ts.map +1 -0
  374. package/dist/esm/time/datestring.js +94 -0
  375. package/dist/esm/time/datestring.js.map +1 -0
  376. package/dist/esm/time/index.d.ts +89 -0
  377. package/dist/esm/time/index.d.ts.map +1 -0
  378. package/dist/esm/time/index.js +108 -0
  379. package/dist/esm/time/index.js.map +1 -0
  380. package/dist/esm/time/session.d.ts +17 -0
  381. package/dist/esm/time/session.d.ts.map +1 -0
  382. package/dist/esm/time/session.js +69 -0
  383. package/dist/esm/time/session.js.map +1 -0
  384. package/dist/esm/time/timezone.d.ts +40 -0
  385. package/dist/esm/time/timezone.d.ts.map +1 -0
  386. package/dist/esm/time/timezone.js +144 -0
  387. package/dist/esm/time/timezone.js.map +1 -0
  388. package/dist/esm/timeframe/index.d.ts +73 -0
  389. package/dist/esm/timeframe/index.d.ts.map +1 -0
  390. package/dist/esm/timeframe/index.js +131 -0
  391. package/dist/esm/timeframe/index.js.map +1 -0
  392. package/dist/esm/types/index.d.ts +343 -0
  393. package/dist/esm/types/index.d.ts.map +1 -0
  394. package/dist/esm/types/index.js +17 -0
  395. package/dist/esm/types/index.js.map +1 -0
  396. package/dist/esm/types/metadata.d.ts +300 -0
  397. package/dist/esm/types/metadata.d.ts.map +1 -0
  398. package/dist/esm/types/metadata.js +7 -0
  399. package/dist/esm/types/metadata.js.map +1 -0
  400. package/dist/esm/utils/index.d.ts +167 -0
  401. package/dist/esm/utils/index.d.ts.map +1 -0
  402. package/dist/esm/utils/index.js +295 -0
  403. package/dist/esm/utils/index.js.map +1 -0
  404. package/package.json +53 -23
  405. package/src/array/index.ts +1057 -0
  406. package/src/box/index.ts +680 -0
  407. package/src/callsite/index.ts +178 -0
  408. package/src/chartpoint/index.ts +126 -0
  409. package/src/color/index.ts +389 -0
  410. package/src/color/parse.ts +56 -0
  411. package/src/compare/index.ts +46 -0
  412. package/src/drawing/registry.ts +106 -0
  413. package/src/index.ts +201 -0
  414. package/src/indicator.ts +185 -0
  415. package/src/input.ts +280 -0
  416. package/src/label/index.ts +490 -0
  417. package/src/lib/index.ts +8 -0
  418. package/src/lib/zigzag/index.ts +13 -0
  419. package/src/lib/zigzag/zigzag.ts +318 -0
  420. package/src/line/index.ts +530 -0
  421. package/src/linefill/index.ts +152 -0
  422. package/src/map/index.ts +115 -0
  423. package/src/math/index.ts +1071 -0
  424. package/src/matrix/index.ts +2697 -0
  425. package/src/plot.ts +121 -0
  426. package/src/polyline/index.ts +184 -0
  427. package/src/runtime/adapters/LightweightChartsAdapter.ts +201 -0
  428. package/src/runtime/adapters/SimpleInputAdapter.ts +132 -0
  429. package/src/runtime/index.ts +52 -0
  430. package/src/runtime/inputs.ts +377 -0
  431. package/src/runtime/runtime.ts +241 -0
  432. package/src/runtime/series.ts +644 -0
  433. package/src/runtime/types.ts +292 -0
  434. package/src/script/index.ts +1870 -0
  435. package/src/security/resample.ts +119 -0
  436. package/src/session/bars.ts +262 -0
  437. package/src/session/calendar.ts +199 -0
  438. package/src/str/dateformat.ts +104 -0
  439. package/src/str/index.ts +557 -0
  440. package/src/str/messageformat.ts +109 -0
  441. package/src/str/numberformat.ts +197 -0
  442. package/src/strategy/index.ts +281 -0
  443. package/src/ta/index.ts +3587 -0
  444. package/src/ta/running-sum.ts +117 -0
  445. package/src/ta-series.ts +1036 -0
  446. package/src/text/index.ts +14 -0
  447. package/src/time/datestring.ts +96 -0
  448. package/src/time/index.ts +161 -0
  449. package/src/time/session.ts +79 -0
  450. package/src/time/timezone.ts +180 -0
  451. package/src/timeframe/index.ts +144 -0
  452. package/src/types/index.ts +398 -0
  453. package/src/types/metadata.ts +334 -0
  454. package/src/utils/index.ts +334 -0
  455. package/dist/array/index.d.ts +0 -57
  456. package/dist/array/index.d.ts.map +0 -1
  457. package/dist/box/index.d.ts +0 -37
  458. package/dist/box/index.d.ts.map +0 -1
  459. package/dist/callsite/index.d.ts +0 -7
  460. package/dist/callsite/index.d.ts.map +0 -1
  461. package/dist/chartpoint/index.d.ts +0 -8
  462. package/dist/chartpoint/index.d.ts.map +0 -1
  463. package/dist/color/index.d.ts +0 -28
  464. package/dist/color/index.d.ts.map +0 -1
  465. package/dist/compare/index.d.ts +0 -8
  466. package/dist/compare/index.d.ts.map +0 -1
  467. package/dist/drawing/registry.d.ts +0 -19
  468. package/dist/drawing/registry.d.ts.map +0 -1
  469. package/dist/index.cjs +0 -7981
  470. package/dist/index.d.ts +0 -64
  471. package/dist/index.d.ts.map +0 -1
  472. package/dist/index.mjs +0 -7964
  473. package/dist/indicator.d.ts +0 -42
  474. package/dist/indicator.d.ts.map +0 -1
  475. package/dist/input.d.ts +0 -47
  476. package/dist/input.d.ts.map +0 -1
  477. package/dist/label/index.d.ts +0 -30
  478. package/dist/label/index.d.ts.map +0 -1
  479. package/dist/lib/index.d.ts +0 -2
  480. package/dist/lib/index.d.ts.map +0 -1
  481. package/dist/lib/zigzag/index.d.ts.map +0 -1
  482. package/dist/lib/zigzag/zigzag.d.ts +0 -47
  483. package/dist/lib/zigzag/zigzag.d.ts.map +0 -1
  484. package/dist/line/index.d.ts +0 -30
  485. package/dist/line/index.d.ts.map +0 -1
  486. package/dist/linefill/index.d.ts +0 -10
  487. package/dist/linefill/index.d.ts.map +0 -1
  488. package/dist/map/index.d.ts +0 -14
  489. package/dist/map/index.d.ts.map +0 -1
  490. package/dist/math/index.d.ts +0 -53
  491. package/dist/math/index.d.ts.map +0 -1
  492. package/dist/matrix/index.d.ts +0 -52
  493. package/dist/matrix/index.d.ts.map +0 -1
  494. package/dist/plot.d.ts +0 -20
  495. package/dist/plot.d.ts.map +0 -1
  496. package/dist/polyline/index.d.ts +0 -11
  497. package/dist/polyline/index.d.ts.map +0 -1
  498. package/dist/runtime/adapters/LightweightChartsAdapter.d.ts +0 -15
  499. package/dist/runtime/adapters/LightweightChartsAdapter.d.ts.map +0 -1
  500. package/dist/runtime/adapters/SimpleInputAdapter.d.ts +0 -16
  501. package/dist/runtime/adapters/SimpleInputAdapter.d.ts.map +0 -1
  502. package/dist/runtime/index.cjs +0 -600
  503. package/dist/runtime/index.d.ts.map +0 -1
  504. package/dist/runtime/index.mjs +0 -577
  505. package/dist/runtime/inputs.d.ts +0 -13
  506. package/dist/runtime/inputs.d.ts.map +0 -1
  507. package/dist/runtime/runtime.d.ts +0 -16
  508. package/dist/runtime/runtime.d.ts.map +0 -1
  509. package/dist/runtime/series.d.ts +0 -60
  510. package/dist/runtime/series.d.ts.map +0 -1
  511. package/dist/runtime/types.d.ts +0 -126
  512. package/dist/runtime/types.d.ts.map +0 -1
  513. package/dist/script/index.cjs +0 -6377
  514. package/dist/script/index.d.ts +0 -713
  515. package/dist/script/index.d.ts.map +0 -1
  516. package/dist/script/index.mjs +0 -6360
  517. package/dist/security/resample.d.ts +0 -13
  518. package/dist/security/resample.d.ts.map +0 -1
  519. package/dist/session/bars.d.ts +0 -34
  520. package/dist/session/bars.d.ts.map +0 -1
  521. package/dist/session/calendar.d.ts +0 -31
  522. package/dist/session/calendar.d.ts.map +0 -1
  523. package/dist/str/dateformat.d.ts +0 -2
  524. package/dist/str/dateformat.d.ts.map +0 -1
  525. package/dist/str/index.d.ts +0 -24
  526. package/dist/str/index.d.ts.map +0 -1
  527. package/dist/str/messageformat.d.ts +0 -2
  528. package/dist/str/messageformat.d.ts.map +0 -1
  529. package/dist/str/numberformat.d.ts +0 -3
  530. package/dist/str/numberformat.d.ts.map +0 -1
  531. package/dist/strategy/index.d.ts.map +0 -1
  532. package/dist/ta/index.d.ts +0 -72
  533. package/dist/ta/index.d.ts.map +0 -1
  534. package/dist/ta/running-sum.d.ts +0 -3
  535. package/dist/ta/running-sum.d.ts.map +0 -1
  536. package/dist/ta-series.d.ts +0 -143
  537. package/dist/ta-series.d.ts.map +0 -1
  538. package/dist/text/index.d.ts +0 -4
  539. package/dist/text/index.d.ts.map +0 -1
  540. package/dist/time/datestring.d.ts +0 -2
  541. package/dist/time/datestring.d.ts.map +0 -1
  542. package/dist/time/index.d.ts +0 -15
  543. package/dist/time/index.d.ts.map +0 -1
  544. package/dist/time/session.d.ts +0 -2
  545. package/dist/time/session.d.ts.map +0 -1
  546. package/dist/time/timezone.d.ts +0 -13
  547. package/dist/time/timezone.d.ts.map +0 -1
  548. package/dist/timeframe/index.d.ts +0 -17
  549. package/dist/timeframe/index.d.ts.map +0 -1
  550. package/dist/types/index.d.ts +0 -181
  551. package/dist/types/index.d.ts.map +0 -1
  552. package/dist/types/metadata.d.ts +0 -132
  553. package/dist/types/metadata.d.ts.map +0 -1
  554. package/dist/utils/index.d.ts +0 -26
  555. package/dist/utils/index.d.ts.map +0 -1
@@ -0,0 +1,1400 @@
1
+ /**
2
+ * Technical Analysis (ta) namespace
3
+ * Mirrors PineScript's ta.* functions for technical analysis indicators and calculations.
4
+ *
5
+ * @remarks
6
+ * All technical analysis functions in this namespace follow PineScript v6 API specifications.
7
+ *
8
+ * @version 6
9
+ */
10
+ import type { series_float, series_bool, series_int, Source, simple_int, simple_float, simple_bool } from '../types/index.js';
11
+ /**
12
+ * Simple Moving Average - returns the moving average (sum of last y values divided by y).
13
+ *
14
+ * @param source - Series of values to process
15
+ * @param length - Number of bars (length)
16
+ * @returns Simple moving average of source for length bars back
17
+ *
18
+ * @remarks
19
+ * - `na` values (also +/-Infinity) in the source series are ignored: the mean of the last `length` non-`na`
20
+ * values, and a bar with an `na` source keeps the previous result (as in PineScript)
21
+ * - Returns NaN until `length` non-`na` values are available
22
+ * - The sum is a compensated running sum, as in PineScript, so the result can differ from the exact window mean in
23
+ * the last bits (bit for bit with PineScript)
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * const closePrices = [10, 11, 12, 13, 14];
28
+ * const sma5 = ta.sma(closePrices, 5); // Returns: [NaN, NaN, NaN, NaN, 12]
29
+ * ```
30
+ */
31
+ export declare function sma(source: Source, length: simple_int): series_float;
32
+ /**
33
+ * Exponential Moving Average - returns the exponentially weighted moving average.
34
+ *
35
+ * @param source - Series of values to process
36
+ * @param length - Number of bars (length)
37
+ * @returns Exponential moving average of source with alpha = 2 / (length + 1)
38
+ *
39
+ * @remarks
40
+ * - In EMA, weighting factors decrease exponentially
41
+ * - Formula: `EMA = alpha * source + (1 - alpha) * EMA[1]`, where `alpha = 2 / (length + 1)`
42
+ * - `na` values (also +/-Infinity) in the source series are ignored
43
+ * - The function calculates on the `length` quantity of non-`na` values
44
+ * - May cause indicator repainting
45
+ *
46
+ * @example
47
+ * ```typescript
48
+ * const closePrices = [10, 11, 12, 13, 14];
49
+ * const ema5 = ta.ema(closePrices, 5);
50
+ * ```
51
+ */
52
+ export declare function ema(source: Source, length: simple_int): series_float;
53
+ /**
54
+ * Relative Strength Index - momentum oscillator measuring speed and magnitude of price changes.
55
+ *
56
+ * @param source - Series of values to process
57
+ * @param length - Number of bars (length)
58
+ * @returns RSI series (values range from 0 to 100)
59
+ *
60
+ * @remarks
61
+ * - RSI values above 70 typically indicate overbought conditions
62
+ * - RSI values below 30 typically indicate oversold conditions
63
+ * - Uses `ta.rma()` (Relative Moving Average) for smoothing, matching PineScript v6
64
+ * - Formula: RSI = 100 - (100 / (1 + RS)), where RS = Average Gain / Average Loss
65
+ * - As in PineScript (`down == 0 ? 100 : up == 0 ? 0 : ...`): 100 when the average loss is 0, else 0 when the
66
+ * average gain is 0, both with the 1e-10 tolerance of the comparison operators
67
+ * - Average Gain and Average Loss are calculated using RMA (alpha = 1 / length)
68
+ * - `na` values in the source series are ignored
69
+ *
70
+ * @example
71
+ * ```typescript
72
+ * const rsi14 = ta.rsi(closePrices, 14);
73
+ * // Identify overbought/oversold conditions
74
+ * const overbought = rsi14.map(v => v > 70);
75
+ * const oversold = rsi14.map(v => v < 30);
76
+ * ```
77
+ */
78
+ export declare function rsi(source: Source, length: simple_int): series_float;
79
+ /**
80
+ * Moving Average Convergence Divergence - trend-following momentum indicator showing relationship
81
+ * between two moving averages.
82
+ *
83
+ * @param source - Series of values to process
84
+ * @param fastLength - Fast EMA length (typically 12)
85
+ * @param slowLength - Slow EMA length (typically 26)
86
+ * @param signalLength - Signal line EMA length (typically 9)
87
+ * @returns Tuple of [macdLine, signalLine, histogram]
88
+ *
89
+ * @remarks
90
+ * - MACD Line = Fast EMA - Slow EMA
91
+ * - Signal Line = EMA of MACD Line
92
+ * - Histogram = MACD Line - Signal Line
93
+ * - Crossovers between MACD and signal line indicate potential buy/sell signals
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const [macdLine, signal, histogram] = ta.macd(closePrices, 12, 26, 9);
98
+ * ```
99
+ */
100
+ export declare function macd(source: Source, fastLength: simple_int, slowLength: simple_int, signalLength: simple_int): [series_float, series_float, series_float];
101
+ /**
102
+ * Bollinger Bands - a technical analysis tool defined by lines plotted two standard deviations
103
+ * away from a simple moving average.
104
+ *
105
+ * @param series - Series of values to process
106
+ * @param length - Number of bars (length)
107
+ * @param mult - Standard deviation factor
108
+ * @returns Tuple of [middle, upper, lower] bands
109
+ *
110
+ * @remarks
111
+ * - Middle band is the SMA of the source
112
+ * - Upper band = middle + (mult * standard deviation)
113
+ * - Lower band = middle - (mult * standard deviation)
114
+ * - `na` values in the source series are ignored
115
+ *
116
+ * @example
117
+ * ```typescript
118
+ * const [middle, upper, lower] = ta.bb(closePrices, 20, 2);
119
+ * ```
120
+ */
121
+ export declare function bb(series: Source, length: simple_int, mult: simple_float): [series_float, series_float, series_float];
122
+ /**
123
+ * Standard deviation over the last `length` non-na values.
124
+ *
125
+ * @param source - Series of values to process
126
+ * @param length - Number of values
127
+ * @param biased - true (default): biased estimate (divides by `length`); false: unbiased (by `length - 1`)
128
+ * @returns Standard deviation series (na until `length` non-na values exist)
129
+ *
130
+ * @remarks
131
+ * As in PineScript: `na` values (also +/-Infinity) are skipped, the window holds the last
132
+ * `length` non-na values, and a bar whose own value is `na` keeps the previous result.
133
+ * The result is the square root of {@link variance} (0 when the variance is not positive), computed from
134
+ * compensated running sums of the values and of their squares, bit for bit as PineScript.
135
+ */
136
+ export declare function stdev(source: Source, length: simple_int, biased?: simple_bool): series_float;
137
+ /**
138
+ * Crossover - returns true when series1 crosses over series2 (moves from below to above).
139
+ *
140
+ * @param series1 - First series
141
+ * @param series2 - Second series
142
+ * @returns Boolean series (true at crossover points)
143
+ *
144
+ * @remarks
145
+ * - True when: series1[i]! > series2[i]! AND series1[i-1] <= series2[i-1]
146
+ * - First value is always false (no previous value to compare)
147
+ * - Useful for detecting bullish signals (e.g., fast MA crossing over slow MA)
148
+ *
149
+ * @example
150
+ * ```typescript
151
+ * const crossUp = ta.crossover(fastMA, slowMA);
152
+ * ```
153
+ */
154
+ export declare function crossover(series1: Source, series2: Source): series_bool;
155
+ /**
156
+ * Crossunder - returns true when series1 crosses under series2 (moves from above to below).
157
+ *
158
+ * @param series1 - First series
159
+ * @param series2 - Second series
160
+ * @returns Boolean series (true at crossunder points)
161
+ *
162
+ * @remarks
163
+ * - True when: series1[i]! < series2[i]! AND series1[i-1] >= series2[i-1]
164
+ * - First value is always false (no previous value to compare)
165
+ * - Useful for detecting bearish signals (e.g., fast MA crossing under slow MA)
166
+ *
167
+ * @example
168
+ * ```typescript
169
+ * const crossDown = ta.crossunder(fastMA, slowMA);
170
+ * ```
171
+ */
172
+ export declare function crossunder(series1: Source, series2: Source): series_bool;
173
+ /**
174
+ * Change - calculates the difference between the current value and its value length bars ago.
175
+ *
176
+ * @param source - Series of values to process
177
+ * @param length - Number of bars back (default: 1)
178
+ * @returns Change series (source[i]! - source[i - length])
179
+ *
180
+ * @remarks
181
+ * - Returns NaN for the first `length` values
182
+ * - Default length is 1 (difference from previous bar)
183
+ * - Positive values indicate increase, negative values indicate decrease
184
+ *
185
+ * @example
186
+ * ```typescript
187
+ * const change1 = ta.change(closePrices); // Daily change
188
+ * const change5 = ta.change(closePrices, 5); // 5-day change
189
+ * ```
190
+ */
191
+ export declare function change(source: Source, length?: simple_int): series_float;
192
+ /**
193
+ * True Range - measures market volatility by calculating the greatest of three price ranges.
194
+ *
195
+ * @param handle_na - Defines how the function calculates when previous close is na (default: false)
196
+ * @param high - High price series (required when not using context API)
197
+ * @param low - Low price series (required when not using context API)
198
+ * @param close - Close price series (required when not using context API)
199
+ * @returns True range series
200
+ *
201
+ * @remarks
202
+ * - **PineScript v6 signature**: `ta.tr(handle_na?)` - uses implicit chart data
203
+ * - **JavaScript signature**: Requires explicit `high`, `low`, `close` OR use `createContext()`
204
+ * - True Range = max(high - low, abs(high - close[1]), abs(low - close[1]))
205
+ * - When `handle_na` is true: returns `high - low` if previous close is na
206
+ * - When `handle_na` is false: returns na if previous close is na
207
+ * - Used as a component in ATR calculations
208
+ *
209
+ * @example
210
+ * ```typescript
211
+ * // Direct call with explicit data
212
+ * const trueRange = ta.tr(false, high, low, close);
213
+ *
214
+ * // Or use context API for cleaner syntax
215
+ * const { ta } = createContext({ chart: { high, low, close } });
216
+ * const trueRange = ta.tr(); // Matches PineScript!
217
+ * ```
218
+ */
219
+ export declare function tr(handle_na?: simple_bool, high?: Source, low?: Source, close?: Source): series_float;
220
+ /**
221
+ * Average True Range - returns the RMA (Relative Moving Average) of true range.
222
+ *
223
+ * @param length - Number of bars (length)
224
+ * @param high - High price series (required when not using context API)
225
+ * @param low - Low price series (required when not using context API)
226
+ * @param close - Close price series (required when not using context API)
227
+ * @returns Average true range series
228
+ *
229
+ * @remarks
230
+ * - **PineScript v6 signature**: `ta.atr(length)` - uses implicit chart data
231
+ * - **JavaScript signature**: Requires explicit `high`, `low`, `close` OR use `createContext()`
232
+ * - Uses `ta.rma()` (Relative Moving Average) for smoothing, matching PineScript v6
233
+ * - True range is max(high - low, abs(high - close[1]), abs(low - close[1]))
234
+ * - ATR is a measure of volatility, higher values indicate greater volatility
235
+ * - `na` values in the source series are ignored
236
+ * - The function calculates on the `length` quantity of non-`na` values
237
+ *
238
+ * @example
239
+ * ```typescript
240
+ * // Direct call with explicit data
241
+ * const atr14 = ta.atr(14, high, low, close);
242
+ *
243
+ * // Or use context API for cleaner syntax
244
+ * const { ta } = createContext({ chart: { high, low, close } });
245
+ * const atr14 = ta.atr(14); // Matches PineScript!
246
+ * ```
247
+ */
248
+ export declare function atr(length: simple_int, high?: Source, low?: Source, close?: Source): series_float;
249
+ /**
250
+ * SuperTrend Indicator - a trend-following indicator that helps identify trend direction.
251
+ *
252
+ * @param factor - The multiplier by which the ATR will get multiplied (series int/float)
253
+ * @param atrPeriod - Length of ATR (simple int)
254
+ * @param high - High price series (required when not using context API)
255
+ * @param low - Low price series (required when not using context API)
256
+ * @param close - Close price series (required when not using context API)
257
+ * @param wicks - Whether to use wicks for trend reversal (NOT in PineScript v6 API, default: false)
258
+ * @returns Tuple of [supertrend, direction] where direction is 1 (downtrend) or -1 (uptrend)
259
+ *
260
+ * @remarks
261
+ * - **PineScript v6 signature**: `ta.supertrend(factor, atrPeriod)` - uses implicit chart data
262
+ * - **JavaScript signature**: Requires explicit `high`, `low`, `close` OR use `createContext()`
263
+ * - The `wicks` parameter is NOT part of the official PineScript v6 API
264
+ * - Direction: 1 = downtrend (red), -1 = uptrend (green)
265
+ * - Uses hl2 (average of high and low) as the source
266
+ * - SuperTrend helps identify the current market trend and potential reversal points
267
+ *
268
+ * @example
269
+ * ```typescript
270
+ * // Direct call with explicit data
271
+ * const [supertrend, direction] = ta.supertrend(3, 10, high, low, close);
272
+ * // Plot uptrend when direction < 0
273
+ * // Plot downtrend when direction > 0
274
+ *
275
+ * // Or use context API for cleaner syntax
276
+ * const { ta } = createContext({ chart: { high, low, close } });
277
+ * const [supertrend, direction] = ta.supertrend(3, 10); // Matches PineScript!
278
+ * ```
279
+ */
280
+ export declare function supertrend(factor: simple_float, atrPeriod: simple_int, high?: Source, low?: Source, close?: Source, wicks?: simple_bool): [series_float, series_int];
281
+ /**
282
+ * Relative Moving Average (RMA) - exponentially weighted moving average with alpha = 1 / length.
283
+ *
284
+ * @param source - Series of values to process
285
+ * @param length - Number of bars (length)
286
+ * @returns RMA of source for length bars back
287
+ *
288
+ * @remarks
289
+ * - Moving average used in RSI calculation
290
+ * - Alpha = 1 / length (different from EMA which uses alpha = 2 / (length + 1))
291
+ * - First value is initialized with SMA, then uses exponential smoothing
292
+ * - Formula: `RMA = (source + (length - 1) * RMA[1]) / length`, evaluated in this order as in PineScript
293
+ * (equal to `alpha * source + (1 - alpha) * RMA[1]`, but bit for bit)
294
+ * - `na` values (also +/-Infinity) in the source series are ignored
295
+ * - The function calculates on the `length` quantity of non-`na` values
296
+ *
297
+ * @example
298
+ * ```typescript
299
+ * const rma14 = ta.rma(closePrices, 14);
300
+ * // Used internally by RSI:
301
+ * // avgGain = ta.rma(gains, 14);
302
+ * // avgLoss = ta.rma(losses, 14);
303
+ * ```
304
+ */
305
+ export declare function rma(source: Source, length: simple_int): series_float;
306
+ /**
307
+ * Weighted Moving Average (WMA) - moving average with linearly decreasing weights.
308
+ *
309
+ * @param source - Series of values to process
310
+ * @param length - Number of bars (length)
311
+ * @returns WMA of source for length bars back
312
+ *
313
+ * @remarks
314
+ * - Weighting factors decrease in arithmetical progression
315
+ * - Most recent value has weight `length`, previous has `length-1`, etc.
316
+ * - Formula: `sum(source[i]! * (length - i)) / sum(length - i)` for i = 0 to length-1
317
+ * - As in PineScript: na on a bar whose source is `na` (also +/-Infinity) and until `length` non-`na` values were
318
+ * received; an `na` value inside the window is replaced by the previous non-`na` value
319
+ * - More responsive to recent price changes than SMA
320
+ *
321
+ * @example
322
+ * ```typescript
323
+ * const wma20 = ta.wma(closePrices, 20);
324
+ * // WMA gives more weight to recent prices
325
+ * ```
326
+ */
327
+ export declare function wma(source: Source, length: simple_int): series_float;
328
+ /**
329
+ * Highest value over the last `length` bars.
330
+ *
331
+ * @param source - Series of values to process
332
+ * @param length - Number of bars
333
+ * @returns Highest value series (na on the first `length - 1` bars)
334
+ *
335
+ * @remarks
336
+ * As in PineScript: an `na` value ends the window, so only the values after the last `na`
337
+ * count, and a bar whose own value is `na` gives `na`.
338
+ * PineScript `ta.highest(length)` (source = high) is `ta.highest(length)` in the script API.
339
+ */
340
+ export declare function highest(source: Source, length: simple_int): series_float;
341
+ /**
342
+ * Lowest value over the last `length` bars.
343
+ *
344
+ * @param source - Series of values to process
345
+ * @param length - Number of bars
346
+ * @returns Lowest value series (na on the first `length - 1` bars)
347
+ *
348
+ * @remarks
349
+ * As in PineScript: an `na` value ends the window, so only the values after the last `na`
350
+ * count, and a bar whose own value is `na` gives `na`.
351
+ */
352
+ export declare function lowest(source: Source, length: simple_int): series_float;
353
+ /**
354
+ * Cumulative Sum - returns the total sum of all elements from the beginning.
355
+ *
356
+ * @param source - Series of values to process
357
+ * @returns Series containing the cumulative sum at each bar
358
+ *
359
+ * @remarks
360
+ * - Returns the running total of all values from index 0 to current index
361
+ * - As in PineScript: an `na` value adds nothing to the sum,
362
+ * and the result is `na` on that bar only; the sum continues on the next bars
363
+ * - Useful for calculating total volume, total trades, etc.
364
+ *
365
+ * @example
366
+ * ```typescript
367
+ * const cumulativeVolume = ta.cum(volume);
368
+ * const totalGains = ta.cum(gains);
369
+ * ```
370
+ */
371
+ export declare function cum(source: Source): series_float;
372
+ /**
373
+ * Cross - returns true when two series cross each other (either direction).
374
+ *
375
+ * @param source1 - First series
376
+ * @param source2 - Second series
377
+ * @returns Boolean series (true at cross points)
378
+ *
379
+ * @remarks
380
+ * - True when: (source1[i]! > source2[i]! AND source1[i-1] <= source2[i-1]) OR
381
+ * (source1[i]! < source2[i]! AND source1[i-1] >= source2[i-1])
382
+ * - First value is always false (no previous value to compare)
383
+ * - Detects any crossing (either over or under)
384
+ * - Use `ta.crossover()` or `ta.crossunder()` for directional crosses
385
+ *
386
+ * @example
387
+ * ```typescript
388
+ * const crossed = ta.cross(fastMA, slowMA);
389
+ * // Detect any MA crossover
390
+ * ```
391
+ */
392
+ export declare function cross(source1: Source, source2: Source): series_bool;
393
+ /**
394
+ * Rising - returns true if source is rising for length bars.
395
+ *
396
+ * @param source - Series of values to process
397
+ * @param length - Number of bars (length)
398
+ * @returns Boolean series (true when rising)
399
+ *
400
+ * @remarks
401
+ * PineScript rules:
402
+ * - each of the `length` steps is a rise larger than the 1e-10 tolerance
403
+ * - `na` values are skipped: the steps are between the last `length + 1` non-`na` values up to the current bar
404
+ * (on an `na` bar, the result of the last non-`na` bar)
405
+ * - false while there are fewer than `length + 1` non-`na` values
406
+ *
407
+ * @example
408
+ * ```typescript
409
+ * const isRising = ta.rising(close, 3);
410
+ * // Detect upward momentum
411
+ * ```
412
+ */
413
+ export declare function rising(source: Source, length: simple_int): series_bool;
414
+ /**
415
+ * Falling - returns true if source is falling for length bars.
416
+ *
417
+ * @param source - Series of values to process
418
+ * @param length - Number of bars (length)
419
+ * @returns Boolean series (true when falling)
420
+ *
421
+ * @remarks
422
+ * PineScript rules:
423
+ * - each of the `length` steps is a fall larger than the 1e-10 tolerance
424
+ * - `na` values are skipped: the steps are between the last `length + 1` non-`na` values up to the current bar
425
+ * (on an `na` bar, the result of the last non-`na` bar)
426
+ * - false while there are fewer than `length + 1` non-`na` values
427
+ *
428
+ * @example
429
+ * ```typescript
430
+ * const isFalling = ta.falling(close, 3);
431
+ * // Detect downward momentum
432
+ * ```
433
+ */
434
+ export declare function falling(source: Source, length: simple_int): series_bool;
435
+ /**
436
+ * Rate of Change (ROC) - percentage change between current value and value length bars ago.
437
+ *
438
+ * @param source - Series of values to process
439
+ * @param length - Number of bars (length)
440
+ * @returns ROC series as percentage
441
+ *
442
+ * @remarks
443
+ * - Formula: `100 * change(source, length) / source[length]`
444
+ * - Equivalent to: `100 * (source - source[length]) / source[length]`
445
+ * - Returns percentage change, e.g., 5.0 means 5% increase
446
+ * - `na` values in the source series are included in calculations and will produce an `na` result
447
+ * - Useful for momentum analysis and trend strength measurement
448
+ *
449
+ * @example
450
+ * ```typescript
451
+ * const roc10 = ta.roc(closePrices, 10);
452
+ * // Positive ROC indicates upward momentum
453
+ * // Negative ROC indicates downward momentum
454
+ * ```
455
+ */
456
+ export declare function roc(source: Source, length: simple_int): series_float;
457
+ /**
458
+ * Momentum (MOM) - difference between current value and value length bars ago.
459
+ *
460
+ * @param source - Series of values to process
461
+ * @param length - Offset from current bar to previous bar
462
+ * @returns Momentum series
463
+ *
464
+ * @remarks
465
+ * - Formula: `source - source[length]`
466
+ * - Equivalent to `ta.change(source, length)`
467
+ * - Positive momentum indicates upward movement
468
+ * - Negative momentum indicates downward movement
469
+ * - `na` values in the source series are included in calculations and will produce an `na` result
470
+ *
471
+ * @example
472
+ * ```typescript
473
+ * const mom10 = ta.mom(closePrices, 10);
474
+ * // Measures raw price momentum over 10 bars
475
+ * ```
476
+ */
477
+ export declare function mom(source: Source, length: simple_int): series_float;
478
+ /**
479
+ * Mean Absolute Deviation - measure of difference between series and its SMA.
480
+ *
481
+ * @param source - Series of values to process
482
+ * @param length - Number of bars (length)
483
+ * @returns Mean absolute deviation series
484
+ *
485
+ * @remarks
486
+ * - Measures average absolute distance from the mean
487
+ * - Formula: `sum(abs(source[i]! - sma)) / length` for i in 0 to length-1
488
+ * - Less sensitive to outliers than standard deviation
489
+ * - `na` values in the source series are ignored
490
+ * - The function calculates on the `length` quantity of non-`na` values
491
+ *
492
+ * @example
493
+ * ```typescript
494
+ * const dev10 = ta.dev(closePrices, 10);
495
+ * // Measures volatility using mean absolute deviation
496
+ * ```
497
+ */
498
+ export declare function dev(source: Source, length: simple_int): series_float;
499
+ /**
500
+ * Variance - expectation of squared deviation from mean.
501
+ *
502
+ * @param source - Series of values to process
503
+ * @param length - Number of bars (length)
504
+ * @param biased - Use biased (true) or unbiased (false) estimate (default: true)
505
+ * @returns Variance series
506
+ *
507
+ * @remarks
508
+ * - Measures how far values are spread out from their mean
509
+ * - If `biased` is true: divides by `length` (population variance)
510
+ * - If `biased` is false: divides by `length - 1` (sample variance)
511
+ * - Formula (biased): `sum((source[i]! - mean)^2) / length`
512
+ * - Formula (unbiased): `sum((source[i]! - mean)^2) / (length - 1)`
513
+ * - `na` values in the source series are ignored
514
+ * - The function calculates on the `length` quantity of non-`na` values
515
+ * - Relationship: `stdev = sqrt(variance)`
516
+ * - Computed as PineScript, bit for bit, from compensated running sums of the values and of their squares:
517
+ * biased `sumSq / length - mean * mean`, unbiased `sumSq / (length - 1) - mean * sum / (length - 1)`
518
+ *
519
+ * @example
520
+ * ```typescript
521
+ * const variance20 = ta.variance(closePrices, 20);
522
+ * const sampleVariance = ta.variance(closePrices, 20, false);
523
+ * ```
524
+ */
525
+ export declare function variance(source: Source, length: simple_int, biased?: simple_bool): series_float;
526
+ /**
527
+ * Median - returns the median (middle value) of the series.
528
+ *
529
+ * @param source - Series of values to process
530
+ * @param length - Number of bars (length)
531
+ * @returns Median series
532
+ *
533
+ * @remarks
534
+ * - Returns the middle value when values are sorted
535
+ * - For an even length, returns the average of the two middle values
536
+ * - As in PineScript: `na` values are skipped, the window holds the last `length` non-na values
537
+ * (going back as many bars as needed), and a bar whose own value is `na` still gets a result
538
+ * - Returns NaN until `length` non-na values exist
539
+ * - More robust to outliers than mean (SMA)
540
+ *
541
+ * @example
542
+ * ```typescript
543
+ * const median20 = ta.median(closePrices, 20);
544
+ * // Median is less affected by extreme values than SMA
545
+ * ```
546
+ */
547
+ export declare function median(source: Source, length: simple_int): series_float;
548
+ /**
549
+ * Symmetrically Weighted Moving Average (SWMA) - fixed length 4 with symmetric weights.
550
+ *
551
+ * @param source - Series of values to process
552
+ * @returns SWMA series
553
+ *
554
+ * @remarks
555
+ * - Fixed length of 4 bars
556
+ * - Weights: [1/6, 2/6, 2/6, 1/6] (symmetric)
557
+ * - Formula: `source[3] * 1/6 + source[2] * 2/6 + source[1] * 2/6 + source[0] * 1/6`
558
+ * - More weight given to middle values
559
+ * - `na` values in the source series are included in calculations and will produce an `na` result
560
+ * - Returns NaN for the first 3 bars
561
+ *
562
+ * @example
563
+ * ```typescript
564
+ * const swma = ta.swma(closePrices);
565
+ * // Smoothed price with symmetric weighting
566
+ * ```
567
+ */
568
+ export declare function swma(source: Source): series_float;
569
+ /**
570
+ * Volume Weighted Moving Average (VWMA) - moving average weighted by volume.
571
+ *
572
+ * @param source - Series of values to process
573
+ * @param length - Number of bars (length)
574
+ * @param volume - Volume series (required when not using context API)
575
+ * @returns VWMA series
576
+ *
577
+ * @remarks
578
+ * - **PineScript v6 signature**: `ta.vwma(source, length)` - uses implicit volume data
579
+ * - **JavaScript signature**: Requires explicit `volume` OR use `createContext()`
580
+ * - Formula: `sma(source * volume, length) / sma(volume, length)`
581
+ * - Gives more weight to bars with higher volume
582
+ * - `na` values in the source series are ignored
583
+ * - Useful for price analysis considering volume significance
584
+ *
585
+ * @example
586
+ * ```typescript
587
+ * // Direct call with explicit volume
588
+ * const vwma20 = ta.vwma(closePrices, 20, volumeData);
589
+ *
590
+ * // Or use context API for cleaner syntax
591
+ * const { ta } = createContext({ chart: { high, low, close, volume } });
592
+ * const vwma20 = ta.vwma(close, 20); // Matches PineScript!
593
+ * ```
594
+ */
595
+ export declare function vwma(source: Source, length: simple_int, volume?: Source): series_float;
596
+ /**
597
+ * Linear Regression - line that best fits prices using least squares method.
598
+ *
599
+ * @param source - Series of values to process
600
+ * @param length - Number of bars (length)
601
+ * @param offset - Offset (default: 0)
602
+ * @returns Linear regression value
603
+ *
604
+ * @remarks
605
+ * - Calculates line of best fit using least squares method
606
+ * - Formula: `linreg = intercept + slope * (length - 1 - offset)`
607
+ * - offset=0 gives current fitted value, offset<0 gives future projection
608
+ * - `na` values in the source series are included in calculations and will produce an `na` result
609
+ * - Useful for trend detection and prediction
610
+ *
611
+ * @example
612
+ * ```typescript
613
+ * const linreg20 = ta.linreg(closePrices, 20, 0);
614
+ * const linregFuture = ta.linreg(closePrices, 20, -5); // Project 5 bars ahead
615
+ * ```
616
+ */
617
+ export declare function linreg(source: Source, length: simple_int, offset?: simple_int): series_float;
618
+ /**
619
+ * Correlation Coefficient - measures degree to which two series deviate from their means together.
620
+ *
621
+ * @param source1 - First series
622
+ * @param source2 - Second series
623
+ * @param length - Number of bars (length)
624
+ * @returns Correlation coefficient (-1 to +1)
625
+ *
626
+ * @remarks
627
+ * - Returns value between -1 and +1
628
+ * - +1 = perfect positive correlation
629
+ * - -1 = perfect negative correlation
630
+ * - 0 = no correlation
631
+ * - Measures linear relationship between two series
632
+ * - `na` values in the source series are ignored
633
+ * - The function calculates on the `length` quantity of non-`na` values
634
+ *
635
+ * @example
636
+ * ```typescript
637
+ * const corr = ta.correlation(series1, series2, 20);
638
+ * // Values close to +1 or -1 indicate strong relationship
639
+ * ```
640
+ */
641
+ export declare function correlation(source1: Source, source2: Source, length: simple_int): series_float;
642
+ /**
643
+ * Percent Rank - percentage of how many previous values were less than or equal to current value.
644
+ *
645
+ * @param source - Series of values to process
646
+ * @param length - Number of bars (length)
647
+ * @returns Percent rank (0 to 100)
648
+ *
649
+ * @remarks
650
+ * - Returns value between 0 and 100
651
+ * - 0 = current value is lowest in the period
652
+ * - 100 = current value is highest in the period
653
+ * - 50 = current value is at median
654
+ * - Useful for identifying relative strength within a period
655
+ *
656
+ * PineScript rules:
657
+ * - percentrank = count(source[k] <= source, k = 1..length) / length * 100
658
+ * - a value from bar `length` on, when the current source is not `na`; an `na` value in the window counts as not
659
+ * `<=` the current value
660
+ * - the comparison uses the 1e-10 tolerance
661
+ *
662
+ * @example
663
+ * ```typescript
664
+ * const pctrank = ta.percentrank(closePrices, 100);
665
+ * // Values near 100 indicate recent strength
666
+ * // Values near 0 indicate recent weakness
667
+ * ```
668
+ */
669
+ export declare function percentrank(source: Source, length: simple_int): series_float;
670
+ /**
671
+ * Commodity Channel Index (CCI) - measures deviation from average price.
672
+ *
673
+ * @param source - Series of values to process
674
+ * @param length - Number of bars (length)
675
+ * @returns CCI series
676
+ *
677
+ * @remarks
678
+ * - CCI = (Typical Price - SMA of TP) / (0.015 * Mean Deviation)
679
+ * - Typical Price = (High + Low + Close) / 3
680
+ * - Mean Deviation = Average of absolute differences from mean
681
+ * - Scaled by 0.015 to provide more readable numbers
682
+ * - As in PineScript: when the mean deviation is 0 (1e-10 tolerance, a flat window), the CCI of the previous bar
683
+ * - Values above +100 indicate overbought conditions
684
+ * - Values below -100 indicate oversold conditions
685
+ * - \`na\` values in the source series are ignored
686
+ *
687
+ * @example
688
+ * \`\`\`typescript
689
+ * const cci20 = ta.cci(typicalPrice, 20);
690
+ * // Overbought when cci > 100
691
+ * // Oversold when cci < -100
692
+ * \`\`\`
693
+ */
694
+ export declare function cci(source: Source, length: simple_int): series_float;
695
+ /**
696
+ * Stochastic Oscillator - momentum indicator comparing closing price to price range.
697
+ *
698
+ * @param source - Source series (typically close)
699
+ * @param high - High price series
700
+ * @param low - Low price series
701
+ * @param length - Number of bars (length)
702
+ * @returns Stochastic %K series (values range from 0 to 100)
703
+ *
704
+ * @remarks
705
+ * - Formula: 100 * (close - lowest(low, length)) / (highest(high, length) - lowest(low, length))
706
+ * - Measures where close is relative to the high-low range
707
+ * - Values above 80 typically indicate overbought
708
+ * - Values below 20 typically indicate oversold
709
+ * - Returns NaN when range is zero (high equals low)
710
+ * - \`na\` values in the source series are ignored
711
+ *
712
+ * @example
713
+ * \`\`\`typescript
714
+ * const stochK = ta.stoch(close, high, low, 14);
715
+ * // Smooth with SMA for %D line:
716
+ * const stochD = ta.sma(stochK, 3);
717
+ * \`\`\`
718
+ */
719
+ export declare function stoch(source: Source, high: Source, low: Source, length: simple_int): series_float;
720
+ /**
721
+ * Money Flow Index (MFI) - volume-weighted RSI measuring buying and selling pressure.
722
+ *
723
+ * @param source - Source series (typically hlc3 or close)
724
+ * @param length - Number of bars (length)
725
+ * @param volume - Volume series (required when not using context API)
726
+ * @returns MFI series (values range from 0 to 100)
727
+ *
728
+ * @remarks
729
+ * - **PineScript v6 signature**: `ta.mfi(source, length)` - uses implicit volume data
730
+ * - **JavaScript signature**: Requires explicit `volume` OR use `createContext()`
731
+ * - Combines price and volume to identify overbought/oversold conditions
732
+ * - Formula: 100 - (100 / (1 + Positive Money Flow / Negative Money Flow))
733
+ * - Values above 80 indicate overbought
734
+ * - Values below 20 indicate oversold
735
+ * - `na` values in the source series are ignored
736
+ *
737
+ * @example
738
+ * ```typescript
739
+ * // Direct call with explicit volume
740
+ * const mfi14 = ta.mfi(hlc3, 14, volume);
741
+ *
742
+ * // Or use context API for cleaner syntax
743
+ * const { ta } = createContext({ chart: { high, low, close, volume } });
744
+ * const mfi14 = ta.mfi(hlc3, 14); // Matches PineScript!
745
+ * ```
746
+ */
747
+ export declare function mfi(source: Source, length: simple_int, volume?: Source): series_float;
748
+ /**
749
+ * Hull Moving Average (HMA) - improved moving average with reduced lag.
750
+ *
751
+ * @param source - Series of values to process
752
+ * @param length - Number of bars (length)
753
+ * @returns Hull moving average series
754
+ *
755
+ * @remarks
756
+ * - Formula: WMA(2 * WMA(src, len/2) - WMA(src, len), sqrt(len))
757
+ * - Significantly reduces lag compared to traditional moving averages
758
+ * - Smoother than WMA while being more responsive
759
+ * - Created by Alan Hull
760
+ * - `na` values in the source series are ignored
761
+ *
762
+ * @example
763
+ * ```typescript
764
+ * const hma20 = ta.hma(closePrices, 20);
765
+ * // Faster response to price changes than SMA or EMA
766
+ * ```
767
+ */
768
+ export declare function hma(source: Source, length: simple_int): series_float;
769
+ /**
770
+ * Parabolic SAR (Stop and Reverse) - trend-following indicator.
771
+ *
772
+ * @param start - Acceleration factor start value (typically 0.02)
773
+ * @param inc - Acceleration factor increment (typically 0.02)
774
+ * @param max - Maximum acceleration factor (typically 0.2)
775
+ * @param high - High price series (required when not using context API)
776
+ * @param low - Low price series (required when not using context API)
777
+ * @param close - Close price series (required when not using context API)
778
+ * @returns SAR series
779
+ *
780
+ * @remarks
781
+ * - **PineScript v6 signature**: `ta.sar(start, inc, max)` - uses implicit chart data
782
+ * - **JavaScript signature**: Requires explicit `high`, `low`, `close` OR use `createContext()`
783
+ * - SAR below price indicates uptrend, above price indicates downtrend
784
+ * - Created by J. Welles Wilder Jr.
785
+ *
786
+ * @example
787
+ * ```typescript
788
+ * const sar = ta.sar(0.02, 0.02, 0.2, high, low, close);
789
+ * ```
790
+ */
791
+ export declare function sar(start: simple_float, inc: simple_float, max: simple_float, high?: Source, low?: Source, close?: Source): series_float;
792
+ /**
793
+ * Pivot High - detects pivot high points in the price series.
794
+ *
795
+ * @param sourceOrLeftbars - Source series or leftbars (overloaded)
796
+ * @param leftbarsOrRightbars - Leftbars or rightbars (overloaded)
797
+ * @param rightbars - Number of bars to the right (optional)
798
+ * @param high - High price series (used in 2-param version)
799
+ * @returns Series with the pivot high value on the bar where the pivot is confirmed
800
+ * (`rightbars` bars after the pivot bar), NaN elsewhere
801
+ *
802
+ * @remarks
803
+ * - As in PineScript, the value appears `rightbars` bars after the pivot bar: the pivot bar
804
+ * index is `i - rightbars`
805
+ * - A pivot high may equal values on its left but must be higher than all values on its right
806
+ * - An `na` neighbour ends the check on its side
807
+ *
808
+ * @example
809
+ * ```typescript
810
+ * const pivotHighs = ta.pivothigh(high, 2, 2);
811
+ * // pivotHighs[i] is high[i - 2] when bar i - 2 is a pivot high
812
+ * ```
813
+ */
814
+ export declare function pivothigh(sourceOrLeftbars: Source | simple_int, leftbarsOrRightbars: simple_int, rightbars?: simple_int, high?: Source): series_float;
815
+ /**
816
+ * Pivot Low - detects pivot low points in the price series.
817
+ *
818
+ * @param sourceOrLeftbars - Source series or leftbars (overloaded)
819
+ * @param leftbarsOrRightbars - Leftbars or rightbars (overloaded)
820
+ * @param rightbars - Number of bars to the right (optional)
821
+ * @param low - Low price series (used in 2-param version)
822
+ * @returns Series with the pivot low value on the bar where the pivot is confirmed
823
+ * (`rightbars` bars after the pivot bar), NaN elsewhere
824
+ *
825
+ * @remarks
826
+ * - As in PineScript, the value appears `rightbars` bars after the pivot bar: the pivot bar
827
+ * index is `i - rightbars`
828
+ * - A pivot low may equal values on its left but must be lower than all values on its right
829
+ * - An `na` neighbour ends the check on its side
830
+ *
831
+ * @example
832
+ * ```typescript
833
+ * const pivotLows = ta.pivotlow(low, 2, 2);
834
+ * // pivotLows[i] is low[i - 2] when bar i - 2 is a pivot low
835
+ * ```
836
+ */
837
+ export declare function pivotlow(sourceOrLeftbars: Source | simple_int, leftbarsOrRightbars: simple_int, rightbars?: simple_int, low?: Source): series_float;
838
+ /**
839
+ * Bars Since - returns number of bars since condition was true.
840
+ *
841
+ * @param condition - Boolean series condition
842
+ * @returns Series with number of bars since condition was last true
843
+ *
844
+ * @remarks
845
+ * - Returns 0 when condition is currently true
846
+ * - Increments by 1 for each bar condition remains false
847
+ * - Returns NaN if condition has never been true
848
+ *
849
+ * @example
850
+ * ```typescript
851
+ * const crossovers = ta.crossover(fastMA, slowMA);
852
+ * const barsSinceCross = ta.barssince(crossovers);
853
+ * ```
854
+ */
855
+ export declare function barssince(condition: series_bool): series_float;
856
+ /**
857
+ * Value When - returns the value when condition was true.
858
+ *
859
+ * @param condition - Boolean series condition
860
+ * @param source - Source series to get value from
861
+ * @param occurrence - Which occurrence to get (0 = most recent)
862
+ * @returns Series with values from when condition was true
863
+ *
864
+ * @remarks
865
+ * - occurrence=0 returns value from most recent true condition
866
+ * - occurrence=1 returns value from second most recent, etc.
867
+ * - Returns NaN if condition hasn't been true occurrence+1 times yet
868
+ *
869
+ * @example
870
+ * ```typescript
871
+ * const crossovers = ta.crossover(fastMA, slowMA);
872
+ * const lastCrossPrice = ta.valuewhen(crossovers, close, 0);
873
+ * ```
874
+ */
875
+ export declare function valuewhen(condition: series_bool, source: Source, occurrence: simple_int): series_float;
876
+ /**
877
+ * Directional Movement Index - returns Directional Movement indicators.
878
+ *
879
+ * @param diLength - DI averaging length
880
+ * @param adxSmoothing - ADX smoothing length
881
+ * @returns Tuple of [plusDI, minusDI, ADX]
882
+ *
883
+ * @remarks
884
+ * - +DI and -DI measure directional movement
885
+ * - ADX measures trend strength (0-100)
886
+ * - ADX above 25 typically indicates strong trend
887
+ * - Requires high, low, and close data from context
888
+ *
889
+ * @example
890
+ * ```typescript
891
+ * const [plusDI, minusDI, adx] = ta.dmi(14, 14);
892
+ * // When +DI > -DI and ADX > 25, strong uptrend
893
+ * // When -DI > +DI and ADX > 25, strong downtrend
894
+ * ```
895
+ */
896
+ export declare function dmi(diLength: simple_int, adxSmoothing: simple_int, high: Source, low: Source, close: Source): [series_float, series_float, series_float];
897
+ /**
898
+ * True Strength Index - momentum oscillator based on double smoothed momentum.
899
+ *
900
+ * @param source - Series of values to process
901
+ * @param shortLength - Short smoothing length
902
+ * @param longLength - Long smoothing length
903
+ * @returns TSI series
904
+ *
905
+ * @remarks
906
+ * - TSI oscillates between +100 and -100
907
+ * - Positive values indicate bullish momentum
908
+ * - Negative values indicate bearish momentum
909
+ * - Crossovers of zero line can signal trend changes
910
+ * - Less sensitive to short-term price fluctuations than RSI
911
+ *
912
+ * @example
913
+ * ```typescript
914
+ * const tsi = ta.tsi(close, 13, 25);
915
+ * // TSI > 0: bullish momentum
916
+ * // TSI < 0: bearish momentum
917
+ * ```
918
+ */
919
+ export declare function tsi(source: Source, shortLength: simple_int, longLength: simple_int): series_float;
920
+ /**
921
+ * Chande Momentum Oscillator - momentum indicator similar to RSI.
922
+ *
923
+ * @param source - Series of values to process
924
+ * @param length - Number of bars
925
+ * @returns CMO series
926
+ *
927
+ * @remarks
928
+ * - CMO oscillates between +100 and -100
929
+ * - CMO > +50: overbought conditions
930
+ * - CMO < -50: oversold conditions
931
+ * - Unlike RSI, CMO uses sum of gains/losses instead of averages
932
+ * - More volatile than RSI
933
+ *
934
+ * @example
935
+ * ```typescript
936
+ * const cmo = ta.cmo(close, 14);
937
+ * // CMO > 50: overbought
938
+ * // CMO < -50: oversold
939
+ * ```
940
+ */
941
+ export declare function cmo(source: Source, length: simple_int): series_float;
942
+ /**
943
+ * Keltner Channels - volatility-based envelope indicator.
944
+ *
945
+ * @param source - Series of values to process
946
+ * @param length - Number of bars for EMA
947
+ * @param mult - Multiplier for the range
948
+ * @param useTrueRange - Use True Range (default: true) or high-low
949
+ * @returns Tuple of [middle, upper, lower]
950
+ *
951
+ * @remarks
952
+ * - Middle band is EMA of source
953
+ * - Upper/lower bands are middle ± (range EMA × multiplier)
954
+ * - When useTrueRange=true, uses ATR for volatility
955
+ * - When useTrueRange=false, uses high-low range
956
+ * - Price breaking out of bands may signal trend continuation
957
+ * - Requires high, low, close data from context when useTrueRange=true
958
+ *
959
+ * @example
960
+ * ```typescript
961
+ * const [middle, upper, lower] = ta.kc(close, 20, 2, true);
962
+ * // Price above upper: potential uptrend
963
+ * // Price below lower: potential downtrend
964
+ * ```
965
+ */
966
+ export declare function kc(source: Source, length: simple_int, mult: simple_float, useTrueRange?: simple_bool, high?: Source, low?: Source, close?: Source): [series_float, series_float, series_float];
967
+ /**
968
+ * Bollinger Bands Width - measures the width of Bollinger Bands.
969
+ *
970
+ * @param source - Series of values to process
971
+ * @param length - Number of bars
972
+ * @param mult - Standard deviation multiplier
973
+ * @returns BBW series (percentage)
974
+ *
975
+ * @remarks
976
+ * - BBW = ((upper band - lower band) / middle band) × 100
977
+ * - Low BBW values indicate low volatility (potential breakout setup)
978
+ * - High BBW values indicate high volatility
979
+ * - BBW squeeze (narrowing bands) often precedes strong moves
980
+ * - Works with existing bb() function
981
+ *
982
+ * @example
983
+ * ```typescript
984
+ * const bbw = ta.bbw(close, 20, 2);
985
+ * // Low BBW: potential breakout coming
986
+ * // High BBW: high volatility period
987
+ * ```
988
+ */
989
+ export declare function bbw(source: Source, length: simple_int, mult: simple_float): series_float;
990
+ /**
991
+ * Williams %R (Williams Percent Range)
992
+ *
993
+ * Williams %R is a momentum indicator that measures overbought/oversold levels.
994
+ * It compares the closing price to the high-low range over a specified period.
995
+ *
996
+ * Values range from -100 (oversold) to 0 (overbought):
997
+ * - Above -20: Overbought
998
+ * - Below -80: Oversold
999
+ *
1000
+ * @param high - High price series
1001
+ * @param low - Low price series
1002
+ * @param close - Close price series
1003
+ * @param length - Lookback period (default: 14)
1004
+ * @returns Williams %R series
1005
+ *
1006
+ * @example
1007
+ * ```typescript
1008
+ * const wpr = ta.wpr(high, low, close, 14);
1009
+ * // wpr < -80: oversold
1010
+ * // wpr > -20: overbought
1011
+ * ```
1012
+ */
1013
+ export declare function wpr(high: Source, low: Source, close: Source, length?: simple_int): series_float;
1014
+ /**
1015
+ * Volume Weighted Average Price, restarted on each bar where `anchor` is true.
1016
+ *
1017
+ * @param source - Source series (PineScript default `hlc3`)
1018
+ * @param volume - Volume series
1019
+ * @param anchor - Reset condition per bar (PineScript `anchor`). Without it the sums never restart;
1020
+ * PineScript's default anchor is a new day (`timeframe.change("1D")`), which needs the exchange session
1021
+ * @param stdev_mult - When given, also returns the bands `vwap ± stdev_mult × stdev`
1022
+ * @returns The VWAP series, or `[vwap, upper, lower]` when `stdev_mult` is given
1023
+ *
1024
+ * @remarks
1025
+ * As in PineScript: the sums restart on anchor bars; the standard deviation is
1026
+ * `sqrt(Σ(volume × source²) / Σvolume − vwap²)`.
1027
+ */
1028
+ export declare function vwap(source: Source, volume: Source, anchor?: ArrayLike<boolean | number>): series_float;
1029
+ export declare function vwap(source: Source, volume: Source, anchor: ArrayLike<boolean | number> | undefined, stdev_mult: simple_float): [series_float, series_float, series_float];
1030
+ /**
1031
+ * Arnaud Legoux Moving Average (ALMA)
1032
+ *
1033
+ * ALMA uses a Gaussian distribution for weighting, reducing lag while maintaining smoothness.
1034
+ * It's particularly good at tracking price action with minimal lag.
1035
+ *
1036
+ * @param source - Source series
1037
+ * @param length - Window size (default: 9)
1038
+ * @param offset - Controls the center of the Gaussian curve. 0.85 = focus on recent prices (default: 0.85)
1039
+ * @param sigma - Standard deviation of the Gaussian. Controls smoothness (default: 6)
1040
+ * @returns ALMA series
1041
+ *
1042
+ * @example
1043
+ * ```typescript
1044
+ * const alma = ta.alma(close, 9, 0.85, 6);
1045
+ * // offset closer to 1: more responsive
1046
+ * // offset closer to 0: smoother
1047
+ * ```
1048
+ */
1049
+ export declare function alma(source: Source, length?: simple_int, offset?: simple_float, sigma?: simple_float, floor?: boolean): series_float;
1050
+ /**
1051
+ * Keltner Channels Width (KCW)
1052
+ *
1053
+ * Measures the width of Keltner Channels as a percentage of the middle line.
1054
+ * Similar to BBW but uses ATR instead of standard deviation.
1055
+ *
1056
+ * Low KCW suggests consolidation/low volatility.
1057
+ * High KCW suggests expansion/high volatility.
1058
+ *
1059
+ * @param source - Source series
1060
+ * @param length - Number of bars for EMA and ATR (default: 20)
1061
+ * @param mult - ATR multiplier (default: 2)
1062
+ * @param useTrueRange - Use True Range instead of high-low (default: true)
1063
+ * @param high - High price series
1064
+ * @param low - Low price series
1065
+ * @param close - Close price series
1066
+ * @returns KCW series
1067
+ *
1068
+ * @example
1069
+ * ```typescript
1070
+ * const kcw = ta.kcw(close, 20, 2, true, high, low, close);
1071
+ * // Low KCW: potential breakout coming
1072
+ * // High KCW: high volatility period
1073
+ * ```
1074
+ */
1075
+ export declare function kcw(source: Source, length?: simple_int, mult?: simple_float, useTrueRange?: simple_bool, high?: Source, low?: Source, close?: Source): series_float;
1076
+ /**
1077
+ * Difference between the highest and the lowest value over the last `length` non-na values
1078
+ * (PineScript `ta.range(source, length)`).
1079
+ *
1080
+ * @remarks
1081
+ * As in PineScript: `na` values are skipped (the window holds the last `length` non-na
1082
+ * values), and a bar whose own value is `na` still gets a result.
1083
+ */
1084
+ export declare function range(source: Source, length: simple_int): series_float;
1085
+ /**
1086
+ * Offset to the bar with the highest value over the last `length` bars: 0 for the current bar,
1087
+ * -1 for the previous bar, and so on (as in PineScript, the offset is negative).
1088
+ *
1089
+ * @remarks
1090
+ * As in PineScript: on equal values the oldest bar wins; an `na` value ends the window;
1091
+ * 0 when the window has no value.
1092
+ */
1093
+ export declare function highestbars(source: Source, length: simple_int): series_int;
1094
+ /**
1095
+ * Offset to the bar with the lowest value over the last `length` bars: 0 for the current bar,
1096
+ * -1 for the previous bar, and so on (as in PineScript, the offset is negative).
1097
+ *
1098
+ * @remarks
1099
+ * As in PineScript: on equal values the oldest bar wins; an `na` value ends the window;
1100
+ * 0 when the window has no value.
1101
+ */
1102
+ export declare function lowestbars(source: Source, length: simple_int): series_int;
1103
+ /**
1104
+ * All-time highest value of `source` up to each bar (PineScript `ta.max(source)`).
1105
+ *
1106
+ * @remarks
1107
+ * As in PineScript: `na` values are skipped, the value carries over `na` bars, and the
1108
+ * result is `na` until the first non-na value.
1109
+ */
1110
+ export declare function max(source: Source): series_float;
1111
+ /**
1112
+ * All-time lowest value of `source` up to each bar (PineScript `ta.min(source)`).
1113
+ *
1114
+ * @remarks
1115
+ * As in PineScript: `na` values are skipped, the value carries over `na` bars, and the
1116
+ * result is `na` until the first non-na value.
1117
+ */
1118
+ export declare function min(source: Source): series_float;
1119
+ /**
1120
+ * Center of Gravity (COG)
1121
+ *
1122
+ * The Center of Gravity indicator is an oscillator developed by John Ehlers.
1123
+ * It identifies turning points with minimal lag and provides clear signals.
1124
+ *
1125
+ * The COG calculates a weighted average where more recent prices have higher weights,
1126
+ * similar to a moving average but with a focus on momentum shifts.
1127
+ *
1128
+ * @param source - Source series (typically close)
1129
+ * @param length - Lookback period (default: 10)
1130
+ * @returns COG series
1131
+ *
1132
+ * @example
1133
+ * ```typescript
1134
+ * const cogValue = ta.cog(close, 10);
1135
+ * // Use COG crossovers as signals:
1136
+ * // - COG crossing above 0: potential buy signal
1137
+ * // - COG crossing below 0: potential sell signal
1138
+ * ```
1139
+ */
1140
+ export declare function cog(source: Source, length?: simple_int): series_float;
1141
+ /**
1142
+ * Mode (Most Frequent Value)
1143
+ *
1144
+ * Returns the mode of the series - the most frequently occurring value.
1145
+ * If there are several values with the same frequency, it returns the smallest value.
1146
+ *
1147
+ * @param source - Series of values to process
1148
+ * @param length - Number of bars to look back
1149
+ * @returns The most frequently occurring value
1150
+ *
1151
+ * @example
1152
+ * ```typescript
1153
+ * const values = [1, 2, 2, 3, 3, 3, 4, 4];
1154
+ * const modeValue = ta.mode(values, 8); // Returns 3 (most frequent)
1155
+ * ```
1156
+ *
1157
+ * @remarks
1158
+ * - `na` values in the source series are ignored
1159
+ * - If no mode exists, returns the smallest value
1160
+ * - Returns NaN for the first (length - 1) values where there's insufficient data
1161
+ */
1162
+ export declare function mode(source: Source, length: simple_int): series_float;
1163
+ /**
1164
+ * Percentile (Linear Interpolation Method)
1165
+ *
1166
+ * Calculates the percentile using the method of linear interpolation between
1167
+ * the two nearest ranks. This method may return values that are not members
1168
+ * of the input data set.
1169
+ *
1170
+ * @param source - Series of values to process
1171
+ * @param length - Number of bars to look back
1172
+ * @param percentage - Percentile to calculate (0-100)
1173
+ * @returns The calculated percentile value
1174
+ *
1175
+ * @example
1176
+ * ```typescript
1177
+ * const p50 = ta.percentile_linear_interpolation(close, 20, 50); // Median
1178
+ * const p75 = ta.percentile_linear_interpolation(close, 20, 75); // 75th percentile
1179
+ * ```
1180
+ *
1181
+ * @remarks
1182
+ * - The result will NOT always be a member of the input data set
1183
+ * - Uses linear interpolation between adjacent values when needed
1184
+ * - Returns NaN for the first (length - 1) values where there's insufficient data
1185
+ *
1186
+ * PineScript rules:
1187
+ * - position in the sorted window: `percentage / 100 * length - 0.5`, clamped to the first / last value, linear
1188
+ * interpolation between the two neighbours (na when a neighbour is na, also at an exact position)
1189
+ * - `na` values stay in the window (window size = `length`). The window is kept sorted from bar to bar: the new
1190
+ * value is inserted before the first value `>=` it, passing the `na` values (an `na` goes last), then the value
1191
+ * leaving the window is removed. So the place of an `na` depends on the history: at the start of a series the
1192
+ * `na` values are before all numbers
1193
+ */
1194
+ export declare function percentile_linear_interpolation(source: Source, length: simple_int, percentage: number): series_float;
1195
+ /**
1196
+ * Percentile (Nearest Rank Method)
1197
+ *
1198
+ * Calculates the percentile using the Nearest Rank method. This method
1199
+ * always returns a value that is a member of the input data set.
1200
+ *
1201
+ * @param source - Series of values to process
1202
+ * @param length - Number of bars to look back
1203
+ * @param percentage - Percentile to calculate (0-100)
1204
+ * @returns The calculated percentile value
1205
+ *
1206
+ * @example
1207
+ * ```typescript
1208
+ * const p50 = ta.percentile_nearest_rank(close, 20, 50); // Median
1209
+ * const p90 = ta.percentile_nearest_rank(close, 20, 90); // 90th percentile
1210
+ * ```
1211
+ *
1212
+ * @remarks
1213
+ * - The result will ALWAYS be a member of the input data set
1214
+ * - The 100th percentile is defined as the largest value
1215
+ * - Using this method on lengths < 100 may result in the same value for multiple percentiles
1216
+ * - Returns NaN for the first (length - 1) values where there's insufficient data
1217
+ *
1218
+ * PineScript rules:
1219
+ * - the value at rank `ceil(percentage / 100 * length)` of the sorted window (na when that rank holds an `na`)
1220
+ * - `na` values stay in the window, sorted from bar to bar as in `ta.percentile_linear_interpolation`
1221
+ */
1222
+ export declare function percentile_nearest_rank(source: Source, length: simple_int, percentage: number): series_float;
1223
+ /**
1224
+ * Rank Correlation Index (RCI)
1225
+ *
1226
+ * Calculates the Rank Correlation Index using Spearman's rank correlation coefficient.
1227
+ * RCI measures the directional consistency of price movements, indicating whether
1228
+ * the source consistently increased (positive values) or decreased (negative values).
1229
+ *
1230
+ * @param source - Series of values to process
1231
+ * @param length - Number of bars to look back
1232
+ * @returns RCI value scaled to range -100 to 100
1233
+ *
1234
+ * @example
1235
+ * ```typescript
1236
+ * const rci9 = ta.rci(close, 9);
1237
+ * // RCI near +100: strong upward consistency
1238
+ * // RCI near -100: strong downward consistency
1239
+ * // RCI near 0: no clear trend
1240
+ * ```
1241
+ *
1242
+ * @remarks
1243
+ * - Result is scaled to -100 to 100 range
1244
+ * - +100 indicates source consistently increased over the period
1245
+ * - -100 indicates source consistently decreased over the period
1246
+ * - 0 indicates no directional consistency
1247
+ * - Returns NaN for the first (length - 1) values where there's insufficient data
1248
+ */
1249
+ export declare function rci(source: Source, length: simple_int): series_float;
1250
+ /**
1251
+ * Pivot Point Levels
1252
+ *
1253
+ * Calculates pivot point levels using various calculation methods.
1254
+ * Returns an array containing: [P, R1, S1, R2, S2, R3, S3, R4, S4, R5, S5]
1255
+ *
1256
+ * @param type - Calculation type: "Traditional", "Fibonacci", "Woodie", "Classic", "DM", "Camarilla"
1257
+ * @param anchor - Condition that triggers reset of calculations
1258
+ * @param developing - If true, pivots recalculate continuously; if false, use last anchor values
1259
+ * @param high - High price series (optional, uses context if not provided)
1260
+ * @param low - Low price series (optional, uses context if not provided)
1261
+ * @param close - Close price series (optional, uses context if not provided)
1262
+ * @param open - Open price series (optional, uses context if not provided)
1263
+ * @returns Array of 11 pivot levels
1264
+ *
1265
+ * @example
1266
+ * ```typescript
1267
+ * const weekChange = [false, false, false, false, true, false, ...]; // Weekly anchor
1268
+ * const pivots = ta.pivot_point_levels("Traditional", weekChange, false, high, low, close);
1269
+ * // pivots[i]! = [P, R1, S1, R2, S2, R3, S3, R4, S4, R5, S5]
1270
+ * ```
1271
+ *
1272
+ * @remarks
1273
+ * - Woodie type cannot use developing=true (will error in PineScript)
1274
+ * - DM type only calculates P, R1, S1 (other levels are NaN)
1275
+ * - All calculations follow PineScript v6 specifications
1276
+ */
1277
+ export declare function pivot_point_levels(type: series_float | string, anchor: series_bool, developing?: series_bool | boolean, high?: Source, low?: Source, close?: Source, open?: Source): series_float[];
1278
+ /**
1279
+ * Ichimoku Kinko Hyo (Ichimoku Cloud) - Japanese charting technique for trend identification.
1280
+ *
1281
+ * @param conversionPeriods - Period for Tenkan-sen (Conversion Line), default: 9
1282
+ * @param basePeriods - Period for Kijun-sen (Base Line), default: 26
1283
+ * @param laggingSpan2Periods - Period for Senkou Span B (Leading Span B), default: 52
1284
+ * @param displacement - Displacement for Senkou Spans and Chikou Span, default: 26
1285
+ * @param high - High price series
1286
+ * @param low - Low price series
1287
+ * @param close - Close price series
1288
+ * @returns Tuple of [tenkanSen, kijunSen, senkouSpanA, senkouSpanB, chikouSpan]
1289
+ *
1290
+ * @remarks
1291
+ * - **Tenkan-sen (Conversion Line)**: `(highest(high, conversionPeriods) + lowest(low, conversionPeriods)) / 2`
1292
+ * - **Kijun-sen (Base Line)**: `(highest(high, basePeriods) + lowest(low, basePeriods)) / 2`
1293
+ * - **Senkou Span A (Leading Span A)**: `(tenkan + kijun) / 2` offset forward by `displacement` periods
1294
+ * - **Senkou Span B (Leading Span B)**: `(highest(high, laggingSpan2Periods) + lowest(low, laggingSpan2Periods)) / 2` offset forward by `displacement` periods
1295
+ * - **Chikou Span (Lagging Span)**: `close` offset backward by `displacement` periods
1296
+ *
1297
+ * The forward offset for Senkou Spans means they are projected into the future (NaN values at the end).
1298
+ * The backward offset for Chikou Span means it shows past prices (NaN values at the beginning).
1299
+ *
1300
+ * @example
1301
+ * ```typescript
1302
+ * const [tenkan, kijun, senkouA, senkouB, chikou] = ta.ichimoku(9, 26, 52, 26, high, low, close);
1303
+ *
1304
+ * // Tenkan-sen crosses above Kijun-sen = bullish signal
1305
+ * const bullishSignal = ta.crossover(tenkan, kijun);
1306
+ *
1307
+ * // Price above cloud = bullish trend
1308
+ * // Cloud = area between senkouSpanA and senkouSpanB
1309
+ * ```
1310
+ */
1311
+ export declare function ichimoku(conversionPeriods: simple_int, basePeriods: simple_int, laggingSpan2Periods: simple_int, displacement: simple_int, high: Source, low: Source, close: Source): [series_float, series_float, series_float, series_float, series_float];
1312
+ /**
1313
+ * ZigZag indicator - identifies significant trend reversals by filtering out minor price movements.
1314
+ *
1315
+ * @param deviation - Minimum percentage price change to form a new pivot (default: 5.0)
1316
+ * @param depth - Minimum bars between pivots for pivot detection (default: 10)
1317
+ * @param backstep - Bars to look back for confirmation (default: 3)
1318
+ * @param source - Price source (optional, typically close)
1319
+ * @param high - High price series (optional, for high/low mode)
1320
+ * @param low - Low price series (optional, for high/low mode)
1321
+ * @returns Tuple of [zigzag values, direction, pivot flags (boolean)]
1322
+ *
1323
+ * @remarks
1324
+ * - **Parameter order differs from PineScript**: JavaScript signature puts deviation first,
1325
+ * while PineScript uses `ta.zigzag(source, deviation, depth, backstep)`. This allows
1326
+ * deviation to have a default value and makes the API more ergonomic for JS users.
1327
+ * - **JavaScript signature**: Requires explicit `source`, `high`, `low` OR use `createContext()`
1328
+ * - Returns the pivot price at pivot points, NaN for non-pivot bars
1329
+ * - Direction: 1 = uptrend (from low to high), -1 = downtrend (from high to low)
1330
+ * - The ZigZag indicator **repaints** by design - the last segment can change as new data arrives
1331
+ * - Supports two modes:
1332
+ * - Single source mode: uses same series for highs and lows
1333
+ * - High/Low mode: uses high for pivot highs, low for pivot lows
1334
+ *
1335
+ * @example
1336
+ * ```typescript
1337
+ * // Using high/low for more accurate pivots
1338
+ * const [zigzag, direction, isPivot] = ta.zigzag(5, 10, 3, undefined, high, low);
1339
+ *
1340
+ * // Find pivot prices
1341
+ * for (let i = 0; i < zigzag.length; i++) {
1342
+ * if (!isNaN(zigzag[i]!)) {
1343
+ * console.log(`Pivot at bar ${i}: ${zigzag[i]!}, direction: ${direction[i]! === 1 ? 'UP' : 'DOWN'}`);
1344
+ * }
1345
+ * }
1346
+ * ```
1347
+ */
1348
+ export declare function zigzag(deviation?: simple_float, depth?: simple_int, backstep?: simple_int, source?: Source, high?: Source, low?: Source): [series_float, series_int, series_bool];
1349
+ /**
1350
+ * On Balance Volume: `ta.cum(math.sign(ta.change(close)) * volume)`.
1351
+ *
1352
+ * @param close - Close price series
1353
+ * @param volume - Volume series
1354
+ * @returns OBV series (`na` on the first bar, and on bars without volume)
1355
+ */
1356
+ export declare function obv(close: Source, volume: Source): series_float;
1357
+ /**
1358
+ * Price-Volume Trend: `ta.cum((ta.change(close) / close[1]) * volume)`.
1359
+ *
1360
+ * @param close - Close price series
1361
+ * @param volume - Volume series
1362
+ * @returns PVT series (`na` on the first bar, and on bars without volume)
1363
+ */
1364
+ export declare function pvt(close: Source, volume: Source): series_float;
1365
+ /**
1366
+ * Accumulation/Distribution index: the running sum of
1367
+ * `(2 * close - low - high) / (high - low) * volume`, with 0 on bars where `high == low`.
1368
+ */
1369
+ export declare function accdist(high: Source, low: Source, close: Source, volume: Source): series_float;
1370
+ /**
1371
+ * Intraday Intensity Index: `(2 * close - high - low) / (high - low) * volume`.
1372
+ *
1373
+ * The PineScript built-in value is this formula. The formula shown in the PineScript reference,
1374
+ * `(2 * close - high - low) / ((high - low) * volume)`, gives other values.
1375
+ *
1376
+ * @returns III series (`na` where `high == low`)
1377
+ */
1378
+ export declare function iii(high: Source, low: Source, close: Source, volume: Source): series_float;
1379
+ /**
1380
+ * Williams Variable Accumulation/Distribution: `(close - open) / (high - low) * volume`.
1381
+ *
1382
+ * @returns WVAD series (`na` where `high == low`)
1383
+ */
1384
+ export declare function wvad(open: Source, high: Source, low: Source, close: Source, volume: Source): series_float;
1385
+ /**
1386
+ * Williams Accumulation/Distribution: the running sum of `close - min(low, close[1])` on up
1387
+ * closes, `close - max(high, close[1])` on down closes, and 0 otherwise (first bar included).
1388
+ */
1389
+ export declare function wad(high: Source, low: Source, close: Source): series_float;
1390
+ /**
1391
+ * Negative Volume Index: moves with the close change only on bars where volume falls.
1392
+ * Starts at 1.
1393
+ */
1394
+ export declare function nvi(close: Source, volume: Source): series_float;
1395
+ /**
1396
+ * Positive Volume Index: moves with the close change only on bars where volume rises.
1397
+ * Starts at 1.
1398
+ */
1399
+ export declare function pvi(close: Source, volume: Source): series_float;
1400
+ //# sourceMappingURL=index.d.ts.map