LuxAlgo

Cubic Bézier Curve Extrapolation [LuxAlgo]

The following script allows for the extrapolation of a Cubic Bézier Curve fit using custom set control points and can be used as a drawing tool allowing users to estimate underlying price trends or to forecast future price trends.

Settings

  • Extrapolation Length: Number of extrapolated observations.
  • Source: Source input of the script.

Style

  • Width: Bézier curve line width.
  • Colors: The curve is colored based on the direction it's taking, the first color is used when the curve is rising, and the second when it is declining.

The other settings determine the locations of the control points. The user does not need to change them from the settings, instead only requiring adjusting their location on the chart like with a regular drawing tool. Setting these control points is required when adding the indicator to your chart.

Usage


Bézier curves are widely used in a lot of scientific and artistic fields. Using them for technical analysis can be interesting due to their extrapolation capabilities as well as their ease of calculation.

A cubic Bézier curve is based on four control points. Maxima/Minimas can be used as control points or the user can set them such that part of the extrapolated observation better fits the most recent price observations.


A possible disadvantage of Bézier curves is that obtaining a good fit with the data is not their primary goal. Rational Bézier curves can be used if obtaining a good fit is the primary user goal.

Details

At their core, Bézier curves are obtained from nested linear interpolation between each control point and the resulting linearly interpolated results. The Bézier curve point located at the first control point P0 and the last curve point located at the last control point Pn are equal to their respective control points. However, this script does not make use of this approach, instead using a more explicit form.

As mentioned previously, the complexity of a Bézier curve can be determined by its number of control points which is related to the Bézier curve degree (number of control points - 1). Instead of using nested linear interpolations to describe Bézier curves, one can describe them as a polynomial of a degree equal to the degree of the wanted Bézier curve.
ملاحظات الأخبار:
Minor changes.

Get access to our exclusive tools: luxalgo.com

Join our 150k+ community: discord.gg/lux

All content provided by LuxAlgo is for informational & educational purposes only. Past performance does not guarantee future results.
نص برمجي مفتوح المصدر

قام مؤلف هذا النص البرمجي بنشره وجعله مفتوح المصدر، بحيث يمكن للمتداولين فهمه والتحقق منه، وهو الأمر الذي يدخل ضمن قيم TradingView. تحياتنا للمؤلف! يمكنك استخدامه مجانًا، ولكن إعادة استخدام هذا الكود في منشور تحكمه قواعد الموقع. يمكنك جعله مفضلاً لاستخدامه على الرسم البياني.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.

هل تريد استخدام هذا النص البرمجي على الرسم البياني؟