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.
Perpustakaan Pine

Di dalam semangat sebenar TradingView, pengarang telah menerbitkan kod Pine ini sebagai perpustakaan sumber terbuka, jadi pengaturcara-pengaturcara Pine yang lain dari komuniti kami boleh menggunakannya semula. Sorakan kepada penulis! Anda boleh menggunakan perpustakaan ini secara peribadi atau pada penerbitan-penerbitan sumber terbuka lain, tetapi penggunaan semula kod ini di dalam penerbitan adalah ditadbir oleh Peraturan Dalaman.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.

Mahu gunakan perpustakaan ini?

Salin garisan ini dan tampalkan ia di dalam skrip anda.