PINE LIBRARY
تم تحديثه math_utils

Library "math_utils"
Collection of math functions that are not part of the standard math library
num_of_non_decimal_digits(number) num_of_non_decimal_digits - The number of the most significant digits on the left of the dot
Parameters:
number: - The floating point number
Returns: number of non digits
num_of_decimal_digits(number) num_of_decimal_digits - The number of the most significant digits on the right of the dot
Parameters:
number: - The floating point number
Returns: number of decimal digits
floor(number, precision) floor - floor with precision to the given most significant decimal point
Parameters:
number: - The floating point number
precision: - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: number floored to the decimal digits defined by the precision
ceil(number, precision) floor - ceil with precision to the given most significant decimal point
Parameters:
number: - The floating point number
precision: - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: number ceiled to the decimal digits defined by the precision
clamp(number, lower, higher, precision) clamp - clamp with precision to the given most significant decimal point
Parameters:
number: - The floating point number
lower: - The lowerst number limit to return
higher: - The highest number limit to return
precision: - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: number clamped to the decimal digits defined by the precision
Collection of math functions that are not part of the standard math library
num_of_non_decimal_digits(number) num_of_non_decimal_digits - The number of the most significant digits on the left of the dot
Parameters:
number: - The floating point number
Returns: number of non digits
num_of_decimal_digits(number) num_of_decimal_digits - The number of the most significant digits on the right of the dot
Parameters:
number: - The floating point number
Returns: number of decimal digits
floor(number, precision) floor - floor with precision to the given most significant decimal point
Parameters:
number: - The floating point number
precision: - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: number floored to the decimal digits defined by the precision
ceil(number, precision) floor - ceil with precision to the given most significant decimal point
Parameters:
number: - The floating point number
precision: - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: number ceiled to the decimal digits defined by the precision
clamp(number, lower, higher, precision) clamp - clamp with precision to the given most significant decimal point
Parameters:
number: - The floating point number
lower: - The lowerst number limit to return
higher: - The highest number limit to return
precision: - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: number clamped to the decimal digits defined by the precision
ملاحظات الأخبار
v2Remove simple from time serries
ملاحظات الأخبار
v3Added:
clamp_up(number, lower, higher, precision)
clamp - clamp with precision to the given most significant decimal point. Ceil is favored for the precision rounding.
Parameters:
number: - The floating point number
lower: - The lowerst number limit to return
higher: - The highest number limit to return
precision: - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: number clamped to the decimal digits defined by the precision
clamp_down(number, lower, higher, precision)
clamp - clamp with precision to the given most significant decimal point. Floor is favored for the precision rounding.
Parameters:
number: - The floating point number
lower: - The lowerst number limit to return
higher: - The highest number limit to return
precision: - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: number clamped to the decimal digits defined by the precision
ملاحظات الأخبار
v4Add overloads that support series precision with none simple parameter
ملاحظات الأخبار
v5Add example for quantity calculation
ملاحظات الأخبار
v6Use Method syntax for a more intuitive interface!
ملاحظات الأخبار
v7Add "simple" overloads for the number itself.
ملاحظات الأخبار
v8(minor) use this as an indication for the "self type" instance
ملاحظات الأخبار
v9Added:
method floor_to_mintick(this)
floor_to_mintick - floor with precision to the mintick most significant decimal point
Namespace types: series float, simple float, input float, const float
Parameters:
this (float): - The floating point number
Returns: - number floored to the decimal digits defined by the mintick precision
method ceil_to_mintick(this)
ceil_to_mintick - ceil with precision to the mintick most significant decimal point
Namespace types: series float, simple float, input float, const float
Parameters:
this (float): - The floating point number
Returns: - number ceiled to the decimal digits defined by the mintick precision
Updated:
method num_of_non_decimal_digits(this)
num_of_non_decimal_digits - The number of the most significant digits on the left of the dot
Namespace types: series float, simple float, input float, const float
Parameters:
this (float): - The floating point number
Returns: - number of non digits
method num_of_decimal_digits(this)
num_of_decimal_digits - The number of the most significant digits on the right of the dot
Namespace types: series float, simple float, input float, const float
Parameters:
this (float): - The floating point number
Returns: - number of decimal digits
method floor(this, precision)
floor - floor with precision to the given most significant decimal point
Namespace types: simple float, input float, const float
Parameters:
this (simple float): - The floating point number
precision (int): - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: - number floored to the decimal digits defined by the precision
method ceil(this, precision)
ceil - ceil with precision to the given most significant decimal point
Namespace types: simple float, input float, const float
Parameters:
this (simple float): - The floating point number
precision (int): - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: - number ceiled to the decimal digits defined by the precision
method clamp_up(this, lower, higher, precision)
clamp - clamp with precision to the given most significant decimal point. Ceil is favored for the precision rounding.
Namespace types: simple float, input float, const float
Parameters:
this (simple float): - The floating point number
lower (float): - The lowerst number limit to return
higher (float): - The highest number limit to return
precision (int): - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: - number clamped to the decimal digits defined by the precision
method clamp_down(this, lower, higher, precision)
clamp_down - clamp with precision to the given most significant decimal point. Floor is favored for the precision rounding.
Namespace types: simple float, input float, const float
Parameters:
this (simple float): - The floating point number
lower (float): - The lowerst number limit to return
higher (float): - The highest number limit to return
precision (int): - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: - number clamped to the decimal digits defined by the precision
method clamp(this, lower, higher, precision)
clamp - clamp with precision to the given most significant decimal point. No specific direction is favored for the precision rounding.
Namespace types: simple float, input float, const float
Parameters:
this (simple float): - The floating point number
lower (float): - The lowerst number limit to return
higher (float): - The highest number limit to return
precision (int): - The number of decimal places a.k.a the most significant decimal digit - e.g precision 2 will produce 0.01 minimum change
Returns: - number clamped to the decimal digits defined by the precision
ملاحظات الأخبار
v10Updated documentation and used force_overlay for the label in the example
ملاحظات الأخبار
v11Update to pinescript version 6
مكتبة باين
كمثال للقيم التي تتبناها TradingView، نشر المؤلف شيفرة باين كمكتبة مفتوحة المصدر بحيث يمكن لمبرمجي باين الآخرين من مجتمعنا استخدامه بحرية. تحياتنا للمؤلف! يمكنك استخدام هذه المكتبة بشكل خاص أو في منشورات أخرى مفتوحة المصدر، ولكن إعادة استخدام هذا الرمز في المنشورات تخضع لقواعد الموقع.
📧 Contact info
Telegram: @jason5480
🔗 Addresses
₿ - bc1qxh3jeld7ke70fx3r5q243d96jsx0etth6x8fa7
* Please contact me before any donation ☕
Telegram: @jason5480
🔗 Addresses
₿ - bc1qxh3jeld7ke70fx3r5q243d96jsx0etth6x8fa7
* Please contact me before any donation ☕
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.
مكتبة باين
كمثال للقيم التي تتبناها TradingView، نشر المؤلف شيفرة باين كمكتبة مفتوحة المصدر بحيث يمكن لمبرمجي باين الآخرين من مجتمعنا استخدامه بحرية. تحياتنا للمؤلف! يمكنك استخدام هذه المكتبة بشكل خاص أو في منشورات أخرى مفتوحة المصدر، ولكن إعادة استخدام هذا الرمز في المنشورات تخضع لقواعد الموقع.
📧 Contact info
Telegram: @jason5480
🔗 Addresses
₿ - bc1qxh3jeld7ke70fx3r5q243d96jsx0etth6x8fa7
* Please contact me before any donation ☕
Telegram: @jason5480
🔗 Addresses
₿ - bc1qxh3jeld7ke70fx3r5q243d96jsx0etth6x8fa7
* Please contact me before any donation ☕
إخلاء المسؤولية
لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.