PINE LIBRARY

srcCalc

Updated
Library "srcCalc"
Provides functions for converting input strings 'open','high','low','close','hl2','hlc3','ohlc4','hlcc4' to corresponding source values.

get_src(src)
  Converts string to source float value
  Parameters:
    src: String to use (`close` is used if no argument is supplied).
  Returns: Returns the float value of the string
Release Notes
v2

Added:
return_bool(op, left_val, right_val)
  Evaluates a conditional expression of 2 values given a string of the conditional operator.
  Parameters:
    op: Conditional operator string to use. (options: '>','>=','==','<=','<','!=')(default: '==')
    left_val: Left value of expression. (default: float 0.0)
    right_val: Right value of expression. (default: float 0.0)
  Returns: Returns the boolean value of conditional expression
convertformattinginputssourcestringstrings

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.

Disclaimer