PINE LIBRARY
更新済 text_utils

Library "text_utils"
a set of functions to handle placeholder in texts
add_placeholder(list, key, value)
add a placehodler key and value to a local list
Parameters:
list: - reference to a local string array containing all placeholders, add string[] list = array.new_string(0) to your code
key: - a string representing the placeholder in a text, e.g. '{ticker}'
value: - a string representing the value of the placeholder e.g. 'EURUSD'
Returns: void
add_placeholder(list, key, value, format)
add a placehodler key and value to a local list
Parameters:
list: - reference to a local string array containing all placeholders, add string[] list = array.new_string(0) to your code
key: - a string representing the placeholder in a text, e.g. '{ticker}'
value: - an integer value representing the value of the placeholder e.g. 10
format: - optional format string to be used when converting integer value to string, see str.format() for details, must contain '{0}'
Returns: void
add_placeholder(list, key, value, format)
add a placehodler key and value to a local list
Parameters:
list: - reference to a local string array containing all placeholders, add string[] list = array.new_string(0) to your code
key: - a string representing the placeholder in a text, e.g. '{ticker}'
value: - a float value representing the value of the placeholder e.g. 1.5
format: - optional format string to be used when converting float value to string, see str.format() for details, must contain '{0}'
Returns: void
replace_all_placeholder(list, text_to_covert)
replace all placeholder keys with their value in a given text
Parameters:
list: - reference to a local string array containing all placeholders
text_to_covert: - a text with placeholder keys before their are replaced by their values
Returns: text with all replaced placeholder keys
a set of functions to handle placeholder in texts
add_placeholder(list, key, value)
add a placehodler key and value to a local list
Parameters:
list: - reference to a local string array containing all placeholders, add string[] list = array.new_string(0) to your code
key: - a string representing the placeholder in a text, e.g. '{ticker}'
value: - a string representing the value of the placeholder e.g. 'EURUSD'
Returns: void
add_placeholder(list, key, value, format)
add a placehodler key and value to a local list
Parameters:
list: - reference to a local string array containing all placeholders, add string[] list = array.new_string(0) to your code
key: - a string representing the placeholder in a text, e.g. '{ticker}'
value: - an integer value representing the value of the placeholder e.g. 10
format: - optional format string to be used when converting integer value to string, see str.format() for details, must contain '{0}'
Returns: void
add_placeholder(list, key, value, format)
add a placehodler key and value to a local list
Parameters:
list: - reference to a local string array containing all placeholders, add string[] list = array.new_string(0) to your code
key: - a string representing the placeholder in a text, e.g. '{ticker}'
value: - a float value representing the value of the placeholder e.g. 1.5
format: - optional format string to be used when converting float value to string, see str.format() for details, must contain '{0}'
Returns: void
replace_all_placeholder(list, text_to_covert)
replace all placeholder keys with their value in a given text
Parameters:
list: - reference to a local string array containing all placeholders
text_to_covert: - a text with placeholder keys before their are replaced by their values
Returns: text with all replaced placeholder keys
リリースノート
v2Added support for User Defined Types (UDT) in Pine Script v5. Support for string array based list still there but deprecated. Will be removed in next version.
New functions supporting UDT placeholder:
placeholder
Fields:
key (series__string)
value (series__string)
Aktualisiert:
add_placeholder(list, key, value, format)
add a placehodler key and value to a local list
Parameters:
list (placeholder[]): - reference to a local array of user defined type placeholder containing all placeholders, add "array<placeholder> list = array.new<placeholder>()" to your code
key (string): - a string representing the placeholder in a text, e.g. '{quantity}'
value (float): - a float value representing the value of the placeholder e.g. 1.5
format (string): - optional format string to be used when converting integer value to string, see str.format() for details, must contain '{0}'
Returns: void
replace_all_placeholder(list, text_to_convert)
replace all placeholder keys with their value in a given text
Parameters:
list (placeholder[]): - reference to a local array of user defined type placeholder containing all placeholders
text_to_convert (string)
Returns: text with all replaced placeholder keys
Pineライブラリ
TradingViewの精神に則り、作者はPineコードをオープンソースライブラリとして公開し、コミュニティ内の他のPineプログラマーが再利用できるようにしました。作者に敬意を表します!このライブラリを個人的に、または他のオープンソースの投稿で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
Pineライブラリ
TradingViewの精神に則り、作者はPineコードをオープンソースライブラリとして公開し、コミュニティ内の他のPineプログラマーが再利用できるようにしました。作者に敬意を表します!このライブラリを個人的に、または他のオープンソースの投稿で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。