kaigouthro

MiteTricks

kaigouthro 업데이트됨   
Library "MiteTricks"

Matrix Global Registry.

Get, Set, automatic growing, universal get/set,
multi-matrix dictionaries, multi-dictionary matrixes..
add slice matrixes of any type, share one common global key registry
pull up an item from a category, and item name ie a table of info.
same cell needs a color, a size, a string, a value, etc..
all of which can be pulled up with the same group id, and key id.
just swap which matrix you pull the value from.
this has a side benefit of non-repainting and recalculating
when pulling values, changing inputs..
makes for very fast/clean usage..

benefit :

floats = value
strings = names
lines = drawn items
table =table of data items for this key
colors = color for line/table/fill,label..

all of those can be pulled with "get(_VALUES,_groupIDX,_keyIDX)" where only the values matrix needs be swapped, and the same item/coordinates remains for all the possible matrixes that item appears in.

also useful as a dictionary/registry for any given type of item,,
and goes very handy with floats/strings/colors/bools with my matrixautotable
very helpful when prototyping or doing development work as a shortcut.

initRegistry()
  Registry inititalizer
  Returns: registry of string matrix type

newbool(optional, optional, optional)
  create bool type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is bool (na)
  Returns: bool matrix of specified size and fill, or blank 2x2 for registry use

newbox(optional, optional, optional)
  create box type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is box (na)
  Returns: box matrix of specified size and fill, or blank 2x2 for registry use

newcolor(optional, optional, optional)
  create color type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is color (na)
  Returns: color matrix of specified size and fill, or blank 2x2 for registry use

newfloat(optional, optional, optional)
  create float type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is float (na)
  Returns: float matrix of specified size and fill, or blank 2x2 for registry use

newint(optional, optional, optional)
  create int type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is int (na)
  Returns: int matrix of specified size and fill, or blank 2x2 for registry use

newlabel(optional, optional, optional)
  create label type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is label (na)
  Returns: label matrix of specified size and fill, or blank 2x2 for registry use

newline(optional, optional, optional)
  create line type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is line (na)
  Returns: line matrix of specified size and fill, or blank 2x2 for registry use

newlinefill(optional, optional, optional)
  create linefill type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is linefill(na)
  Returns: linefill matrix of specified size and fill, or blank 2x2 for registry use

newstring(optional, optional, optional)
  create string type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is string (na)
  Returns: string matrix of specified size and fill, or blank 2x2 for registry use

newtable(optional, optional, optional)
  create table type new matrix presized 2x2 for reg
  Parameters:
    optional: row size
    optional: column size
    optional: fill value(default is table (na)
  Returns: table matrix of specified size and fill, or blank 2x2 for registry use

newfrom(INIT_FILL)
  newfrom Matrix full of item input
  Parameters:
    INIT_FILL: item to fill (2x2) the matri and set type. a type(na) works

addrow(m, v)
  addrow Add new row to matrix
  Parameters:
    m: matrix of type being added to
    v: value of type being added to ( best leave NA on string for registry purposes)

addcolumn(matrix, value)
  addcolumn
  Parameters:
    matrix: of type being added to
    value: of type being added to ( best leave NA on string for registry purposes)

get(_VALS, _KEYREG, _GROUP, _KEY)
  get Grabs value and returns single item
  Parameters:
    _VALS: Matrix Values slice
    _KEYREG: Registry values matrix (strings)
    _GROUP: name of group/category or int group key
    _KEY: name of item to fetch from value registry or int key id
  Returns: item

get(_VALS, _GROUP, _KEY)
  get Grabs value and returns single item
  Parameters:
    _VALS: Matrix Values slice
    _GROUP: name of group/category
    _KEY: name of item to fetch from value registry


getgid(_KEYREG, _GROUP)
  getgid
  Parameters:
    _KEYREG: Reg to pull group id from
    _GROUP: group index int, or string name to get the other missing type


getkid(_KEYREG, _GROUP, _KEY)
  getkid
  Parameters:
    _KEYREG: Reg to pull Key id from
    _GROUP: group index int, or string name
    _KEY: index of string key id to get it's ID int

getkey(_KEYREG, _GROUP, _KEY)
  getkey
  Parameters:
    _KEYREG: Reg to pull Key id from
    _GROUP: group index int, or string name for getting key string
    _KEY: index of string key id to get it's match of other type

set(_VALS, _KEYREG, _GROUP, _KEY, _value)
  set items to reg and matrix container
  Parameters:
    _VALS: Values matrix container
    _KEYREG: Key registry
    _GROUP: (string) Group/Category name
    _KEY: (string) Key for item
    _value: item
  Returns: void

del(_VALS, _KEYREG, _GROUP, _KEY)
  del grroup id
  Parameters:
    _VALS: Matrix Values slice
    _KEYREG: Registry values matrix (strings)
    _GROUP: name of group/category
    _KEY: name of item to Delete from values and key

detached(_GROUP, _KEY, _VALUE)
  detached make detached registry/val matrix
  Parameters:
    _GROUP: Name of first group
    _KEY: Name of first item
    _VALUE: Item of any type, sets the output type too.

릴리즈 노트:
v2
Some Speedups, dropped the add functions See "columns" and "rows" library for replacements (better!)

Removed:
addrow()

addcolumn()
파인 라이브러리

트레이딩뷰 정신에 따라 오써는 이 파인 코드를 오픈 소스 라이브러리로 퍼블리쉬하여 당사 커뮤니티의 다른 파인 프로그래머들이 쓸 수 있도록 하였습니다. 오써에게 찬사를! 여러분은 이 라이브러리를 프라이빗 또는 오픈 소스 퍼블리케이션에 쓸 수 있지만 퍼블리케이션에 재사용은 하우스룰을 따릅니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

이 라이브러리를 쓰시겠습니까?

텍스트를 클립보드에 카피한 뒤 님의 스크립트에 붙여 넣기.