PINE LIBRARY
Обновлено Encoder Decoder

Library "EncoderDecoder"
Simple example how to encode some values into float number and then decode it back to original values
f_calctype()
Encode parameter
Returns: encoded value
f_calctype()
Decode parameter
Returns: decoded value
f_srctype()
Encode parameter
Returns: encoded value
f_srctype()
Decode parameter
Returns: decoded value
f_encode(calc_type, src_type, tf, length)
Encodes 4 paramters into float number
Parameters:
calc_type: 1st paramter to encode (its values defined in f_calctype functions) max number of values that can be encoded = 100
src_type: 2nd paramter to encode (its values defined in f_src_type functions) max number of values that can be encoded = 100
tf: 3rd paramter to encode (may be int number with format.price precision length!)
length: 4th paramter to encode (may be any int number)
Returns: float number
f_decode()
Decodes 4 paramters into tuple
Returns: tuple [calc_type, src_type, length, tf]
Simple example how to encode some values into float number and then decode it back to original values
f_calctype()
Encode parameter
Returns: encoded value
f_calctype()
Decode parameter
Returns: decoded value
f_srctype()
Encode parameter
Returns: encoded value
f_srctype()
Decode parameter
Returns: decoded value
f_encode(calc_type, src_type, tf, length)
Encodes 4 paramters into float number
Parameters:
calc_type: 1st paramter to encode (its values defined in f_calctype functions) max number of values that can be encoded = 100
src_type: 2nd paramter to encode (its values defined in f_src_type functions) max number of values that can be encoded = 100
tf: 3rd paramter to encode (may be int number with format.price precision length!)
length: 4th paramter to encode (may be any int number)
Returns: float number
f_decode()
Decodes 4 paramters into tuple
Returns: tuple [calc_type, src_type, length, tf]
Информация о релизе
v2Added:
float value can contain longer value, that cannot end by '0 or 9'
f_count_intdigits()
Count int digits in number
Returns: number of int digits in number
f_count_floatdigits()
Count float digits in number
Returns: number of float digits in number
Информация о релизе
v3 fix bugsИнформация о релизе
v4code cleaning
Библиотека Pine
В истинном духе TradingView автор опубликовал этот код Pine как библиотеку с открытым исходным кодом, чтобы другие программисты Pine из нашего сообщества могли им воспользоваться. Вы можете использовать эту библиотеку в приватных или других публикациях с открытым исходным кодом, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.
Библиотека Pine
В истинном духе TradingView автор опубликовал этот код Pine как библиотеку с открытым исходным кодом, чтобы другие программисты Pine из нашего сообщества могли им воспользоваться. Вы можете использовать эту библиотеку в приватных или других публикациях с открытым исходным кодом, но повторное использование этого кода в публикации регулируется Правилами поведения.
Отказ от ответственности
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.