PURPOSE I'd like to share my script for Round Math, it's for only education purpose.
I make the formula math_row(x, y) to round the value as we design and shorten the number appearance (value). It's more flexible than str.tostring(close,format.volume) or others.
HOW TO USE Formula math_row(x,y) - x is the value which need to be rounded or shorten - y is the number which you want to round after "." symbol.
***Shorten*** If x < 1.000, no shorten If x >= 1.000 and x < 1.000.000, shorten to thousand value with "K" letter If x >= 1.000.000 and x < 1.000.000.000, shorten to million value with "M" letter If x >= 1.000.000.000, shorten to billion value with "B" letter
***Round*** If y = 0 => no round If y = 1 => round to format ###.# If y = 2 => round to format ###.## If y = 3 => round to format ###.### If y is other => round to default format of Tradingview
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.