PINE LIBRARY
已更新 MarkovAlgorithm

Library "MarkovAlgorithm"
Markov algorithm is a string rewriting system that uses grammar-like rules to operate on strings of
symbols. Markov algorithms have been shown to be Turing-complete, which means that they are suitable as a
general model of computation and can represent any mathematical expression from its simple notation.
~ wikipedia
.
reference:
en.wikipedia.org/wiki/Markov_algorithm
rosettacode.org/wiki/Execute_a_Markov_algorithm
parse(rules, separator)
Parameters:
rules (string)
separator (string)
Returns: - `array<rule> _rules`: List of rules.
---
Usage:
- `parse("|0 -> 0||\n1 -> 0|\n0 -> ")`
apply(expression, rules)
Aplies rules to a expression.
Parameters:
expression (string): `string`: Text expression to be formated by the rules.
rules (rule[]): `string`: Rules to apply to expression on a string format to be parsed.
Returns: - `string _result`: Formated expression.
---
Usage:
- `apply("101", parse("|0 -> 0||\n1 -> 0|\n0 -> "))`
apply(expression, rules)
Parameters:
expression (string)
rules (string)
Returns: - `string _result`: Formated expression.
---
Usage:
- `apply("101", parse("|0 -> 0||\n1 -> 0|\n0 -> "))`
rule
String pair that represents `pattern -> replace`, each rule may be ordinary or terminating.
Fields:
pattern (series string): Pattern to replace.
replacement (series string): Replacement patterns.
termination (series bool): Termination rule.
Markov algorithm is a string rewriting system that uses grammar-like rules to operate on strings of
symbols. Markov algorithms have been shown to be Turing-complete, which means that they are suitable as a
general model of computation and can represent any mathematical expression from its simple notation.
~ wikipedia
.
reference:
en.wikipedia.org/wiki/Markov_algorithm
rosettacode.org/wiki/Execute_a_Markov_algorithm
parse(rules, separator)
Parameters:
rules (string)
separator (string)
Returns: - `array<rule> _rules`: List of rules.
---
Usage:
- `parse("|0 -> 0||\n1 -> 0|\n0 -> ")`
apply(expression, rules)
Aplies rules to a expression.
Parameters:
expression (string): `string`: Text expression to be formated by the rules.
rules (rule[]): `string`: Rules to apply to expression on a string format to be parsed.
Returns: - `string _result`: Formated expression.
---
Usage:
- `apply("101", parse("|0 -> 0||\n1 -> 0|\n0 -> "))`
apply(expression, rules)
Parameters:
expression (string)
rules (string)
Returns: - `string _result`: Formated expression.
---
Usage:
- `apply("101", parse("|0 -> 0||\n1 -> 0|\n0 -> "))`
rule
String pair that represents `pattern -> replace`, each rule may be ordinary or terminating.
Fields:
pattern (series string): Pattern to replace.
replacement (series string): Replacement patterns.
termination (series bool): Termination rule.
發行說明
v2 minor update.發行說明
Fix logger version.Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。