RicardoSantos

MathGeometryCurvesChaikin

Library "MathGeometryCurvesChaikin"
Implements the chaikin algorithm to create a curved path, from assigned points.

chaikin(points_x, points_y, closed) Chaikin algorithm method, uses provided points to generate a smoothed path.
Parameters:
  • points_x: float array, the x value of points.
  • points_y: float array, the y value of points.
  • closed: bool, default=false, is the path closed or not.
Returns: tuple with 2 float arrays.

smooth(points_x, points_y, iterations, closed) Iterate the chaikin algorithm, to smooth a sample of points into a curve path.
Parameters:
  • points_x: float array, the x value of points.
  • points_y: float array, the y value of points.
  • iterations: int, number of iterations to apply the smoothing.
  • closed: bool, default=false, is the path closed or not.
Returns: array of lines.

draw(path_x, path_y, closed) Draw the path.
Parameters:
  • path_x: float array, the x value of the path.
  • path_y: float array, the y value of the path.
  • closed: bool, default=false, is the path closed or not.
Returns: array of lines.
Библиотека Pine

В истинном духе TradingView автор опубликовал этот код Pine как библиотеку с открытым исходным кодом, чтобы другие разработчики Pine из нашего сообщества могли использовать его повторно. Поблагодарим автора! Вы можете использовать эту библиотеку приватно или в других публикациях с открытым исходным кодом, но повторное использование этого кода в публикации регулируется Правилами поведения.

Отказ от ответственности

Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.

Хотите использовать эту библиотеку?

Скопируйте текст в буфер обмена и вставьте в свой скрипт.