Contains the following methods: _type() - Returns the type of the variable in the forms "int", "array<int>", "matrix<linefill>" _type_item() - Returns the type of the variable or of the element (for array/matrix). (e.g. `arrayFloat._type_item()` returns 'float'). _type_struct() - Returns the type of the structure only (i.e. "array" or "matrix"), for simple types (like e.g. `int`) returns "simple". (e.g. `arrayFloat._type_struct()` returns 'array'). _tona() - Casts na to the type of the parent object. (e.g. for an `int x` calling `x.tona()` returns `int(na)`
The _type() / _type_item() / _type_struct() methods are available for the following types: int float bool string color line label box table linefill int[] float[] bool[] string[] color[] line[] label[] box[] table[] linefill[] matrix <int> matrix <float> matrix <bool> matrix <string> matrix <color> matrix <line> matrix <label> matrix <box> matrix <table> matrix <linefill>
The `tona()' method is available only for the simple types (except `linefill`, coundn't make it work for it)
Please see the descriptions in the script.
發行說明
v2 Added tona() method for array and matrix types, for which it returns na value of the same type as their underlying elements. E.g. `matrixFloat.tona()` returns `float(na)`
發行說明
v3 Now .tona() is also working for linefill, array<linefill> and matrix<linefill>.
發行說明
v4 Added method cast() - casts int to float if sampleVar is float. Does nothing otherwise. (May be used to cast const int literals to float in the overloaded functions based on the tyoe of other arguments, e.g. if overloaded function adds a row filled with `1` to a float or int matrix.)
發行說明
v5 Fixed missing `export` for tona(linefill)
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。