TradingView
kaigouthro
Jul 31, 2022 1:30 AM

catchChecks 

C98 / TetherUS PERPETUAL CONTRACTBinance

描述

Library "catchChecks"
Type Check for Function Builders to allow Single item to be
passed in, and determine what to do with the item, ie: need an x value?
function that allows label, line, box, float, or even a string..
check item type? string ? 'str.tonumber(_item)' can be in the same
switch as a 'line.get_price(_item, bar_index)' both outputting float
or for pulling a value from simple, array, or matrix, one function
that can switch between them. reduce overhead of many functions.
there are many ways to use this tool, the simplest may be
string/floats on one switch or grabbing colors from line/fill/label
please Share any great recipes you come up with!

typeIs(_temp, _doMeth)
  Input anything..
  Determine what it is.

  Parameters:
    _temp:   (any) Matrix, Array, or Simple Item
    _doMeth: (bool) True for M/A/S , false for int/float/string.. etc..

  Returns: (string) Type of item checked. ('bool' .. or 'array'.. etc..)
评论
FFriZz
groovy
slowcoconut
maybe this sort of logic can help with strategy relying on the confluence of many different variable types at any given moment, i may play with this at some point.. thanks
kaigouthro
@slowcoconut, this is for another tool i am building in the future for object storage, and or others to use in debugging and utility scripts. tools to check if an item being passed is of a wrong type, or to route a single local function's input to trigger action unctions with void returns , ie: a unction where a float input detected would trigger an update to a held value of an alert assembly while the string might update the alert's stub, or message. or ticker, allowing for less code to be used and less repetition, moving towards a functional model of development.
更多