Price Displacement - Candlestick (OHLC) Calculations
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © kurtsmock
//@version=5
// @description Price Displacement
library("PD", overlay = false)

// -- Expression Helper List {
// All                                                                       Components
// (open-high ="oh") (high-open ="ho") (low-open ="lo") (close-open="co") (Upper Wick="uw")
// (open-low  ="ol") (high-low  ="hl") (low-high ="lh") (close-high="ch") (Body      ="bd")      
// (open-close="oc") (high-close="hc") (low-close="lc") (close-low ="cl") (Lower Wick="lw")
// Pct Only                                                               (Range     ="rg")
// (Scalar Close Position="scp") (Vector Close Position="vcp")
// (Scalar Open Position ="sop") (Vector Open Position ="vop")
//}

// -- pt() {
// @function Absolute Point Displacement. Point quantity of given size parameters according to _exp. 
// @param _exp (string) Price Parameter
// @returns Point size of given expression as an absolute value. Expressions - (open-high="oh") (open-low="ol") (open-close="oc") (high-open="ho") (high-low="hl") (high-close="hc") (low-open="lo") (low-high="lh") (low-close="lc") (close-open="co") (close-high="ch") (close-low="cl") (Upper Wick="uw") (Body="bd") (Lower Wick="lw") (Range="rg")
export pt(simple string _exp) =>
    output = switch _exp
        "oh" => math.abs(open  - high )
        "ol" => math.abs(open  - low  )
        "oc" => math.abs(open  - close)
        "ho" => math.abs(high  - open )
        "hl" => math.abs(high  - low  )
        "hc" => math.abs(high  - close)
        "lo" => math.abs(low   - open )
        "lh" => math.abs(low   - high )
        "lc" => math.abs(low   - close)
        "co" => math.abs(close - open )
        "ch" => math.abs(close - high )
        "cl" => math.abs(close - low  )
        "uw" => math.abs(high  - math.max(close,open))
        "bd" => math.abs(close - open)
        "lw" => math.abs(math.min(close,open) - low)
        "rg" => math.abs(high  - low)
    output
//}
// -- vpt() {
// @function Vector Point Displacement. Point quantity of given size parameters according to _exp. 
// @param _exp (string) Price Parameter
// @returns Point size of given expression as a vector. Expressions - (open-high="oh") (open-low="ol") (open-close="oc") (high-open="ho") (high-low="hl") (high-close="hc") (low-open="lo") (low-high="lh") (low-close="lc") (close-open="co") (close-high="ch") (close-low="cl") (Upper Wick="uw") (Body="bd") (Lower Wick="lw") (Range="rg")
export vpt(simple string _exp) =>
    output = switch _exp
        "oh" => open  - high 
        "ol" => open  - low  
        "oc" => open  - close
        "ho" => high  - open 
        "hl" => high  - low  
        "hc" => high  - close
        "lo" => low   - open 
        "lh" => low   - high 
        "lc" => low   - close
        "co" => close - open 
        "ch" => close - high 
        "cl" => close - low
        "uw" => high  - math.max(close,open)
        "bd" => close - open
        "lw" => math.min(close,open) - low
        "rg" => high  - low
    output
//}

// -- tick() {
// @function Absolute Tick Displacement. Tick quantity of given size parameters according to _exp. 
// @param _exp (string) Price Parameter
// @returns Tick size of given expression as an absolute value. Expressions - (open-high="oh") (open-low="ol") (open-close="oc") (high-open="ho") (high-low="hl") (high-close="hc") (low-open="lo") (low-high="lh") (low-close="lc") (close-open="co") (close-high="ch") (close-low="cl") (Upper Wick="uw") (Body="bd") (Lower Wick="lw") (Range="rg")
export tick(simple string _exp) =>
    output = switch _exp
        "oh" => math.abs((open  - high ))     / syminfo.mintick
        "ol" => math.abs((open  - low  ))     / syminfo.mintick
        "oc" => math.abs((open  - close))     / syminfo.mintick
        "ho" => math.abs((high  - open ))     / syminfo.mintick
        "hl" => math.abs((high  - low  ))     / syminfo.mintick
        "hc" => math.abs((high  - close))     / syminfo.mintick
        "lo" => math.abs((low   - open ))     / syminfo.mintick
        "lh" => math.abs((low   - high ))     / syminfo.mintick
        "lc" => math.abs((low   - close))     / syminfo.mintick
        "co" => math.abs((close - open ))     / syminfo.mintick
        "ch" => math.abs((close - high ))     / syminfo.mintick
        "cl" => math.abs((close - low  ))     / syminfo.mintick
        "uw" => (high - math.max(close,open)) / syminfo.mintick
        "bd" => math.abs(close - open)        / syminfo.mintick
        "lw" => (math.min(close,open) - low)  / syminfo.mintick
        "rg" => (high - low)                  / syminfo.mintick
    output
//}
// -- vtick() {
// @function Vector Tick Displacement. Tick quantity of given size parameters according to _exp. 
// @param _exp (string) Price Parameter
// @returns Tick size of given expression as a vector. Expressions -(open-high="oh") (open-low="ol") (open-close="oc") (high-open="ho") (high-low="hl") (high-close="hc") (low-open="lo") (low-high="lh") (low-close="lc") (close-open="co") (close-high="ch") (close-low="cl") (Upper Wick="uw") (Body="bd") (Lower Wick="lw") (Range="rg")
export vtick(simple string _exp) =>
    output = switch _exp
        "oh" => (open  - high )               / syminfo.mintick
        "ol" => (open  - low  )               / syminfo.mintick
        "oc" => (open  - close)               / syminfo.mintick
        "ho" => (high  - open )               / syminfo.mintick
        "hl" => (high  - low  )               / syminfo.mintick
        "hc" => (high  - close)               / syminfo.mintick
        "lo" => (low   - open )               / syminfo.mintick
        "lh" => (low   - high )               / syminfo.mintick
        "lc" => (low   - close)               / syminfo.mintick
        "co" => (close - open )               / syminfo.mintick
        "ch" => (close - high )               / syminfo.mintick
        "cl" => (close - low  )               / syminfo.mintick
        "uw" => (high - math.max(close,open)) / syminfo.mintick
        "bd" => (close - open )               / syminfo.mintick
        "lw" => (math.min(close,open) - low)  / syminfo.mintick
        "rg" => (high - low   )               / syminfo.mintick
    output
//}

// -- pct() {
// @function Absolute Percent Displacement (w/rounding overload).  Percent quantity of bar range of given size parameters according to _exp. (See Library Notes for additional definitions). 
// @param _exp (string) 
// @param _prec (int) Overload - Place value precision definition
// @returns Percent size of given expression as decimal. Expressions - (open-high="oh") (open-low="ol") (open-close="oc") (high-open="ho") (high-low="hl") (high-close="hc") (low-open="lo") (low-high="lh") (low-close="lc") (close-open="co") (close-high="ch") (close-low="cl") (Upper Wick="uw") (Body="bd") (Lower Wick="lw") (Scalar Close Loc="scp") (Vector Close Loc="vcp") (Scalar Open Loc ="sop") (Vector Open Loc="vop")
export pct(simple string _exp, int _prec) =>
    output = switch _exp
        "oh" =>  math.abs (math.round(tick("oh")  / tick("rg"),               _prec))
        "ol" =>  math.abs (math.round(tick("ol")  / tick("rg"),               _prec))
        "oc" =>  math.abs (math.round(tick("oc")  / tick("rg"),               _prec))
        "ho" =>  math.abs (math.round(tick("ho")  / tick("rg"),               _prec))
        "hl" =>  math.abs (math.round(tick("hl")  / tick("rg"),               _prec))
        "hc" =>  math.abs (math.round(tick("hc")  / tick("rg"),               _prec))
        "lo" =>  math.abs (math.round(tick("lo")  / tick("rg"),               _prec))
        "lh" =>  math.abs (math.round(tick("lh")  / tick("rg"),               _prec))
        "lc" =>  math.abs (math.round(tick("lc")  / tick("rg"),               _prec))
        "co" =>  math.abs (math.round(tick("co")  / tick("rg"),               _prec))
        "ch" =>  math.abs (math.round(tick("ch")  / tick("rg"),               _prec))
        "cl" =>  math.abs (math.round(tick("cl")  / tick("rg"),               _prec))
        "uw" =>  math.abs (math.round(tick("uw")  / tick("rg"),               _prec))
        "bd" =>  math.abs (math.round(tick("bd")  / tick("rg"),               _prec))
        "lw" =>  math.abs (math.round(tick("lw")  / tick("rg"),               _prec))
        "scp" => math.abs (math.round(tick("cl")  / tick("rg"),               _prec))
        "sop" => math.abs (math.round(tick("ol")  / tick("rg"),               _prec))
        "vcp" => math.abs (math.round((tick("cl") - tick("hc")) / tick("rg"), _prec))
        "vop" => math.abs (math.round((tick("ol") - tick("ho")) / tick("rg"), _prec))
    output
//}
// -- vpct() {
// @function Vector Percent Displacement (w/rounding overload). Percent quantity of bar range of given size parameters according to _exp.(See Library Notes for additional definitions).
// @param _exp (string) Price Parameter
// @returns Percent size of given expression as decimal. Expressions - (open-high="oh") (open-low="ol") (open-close="oc") (high-open="ho") (high-low="hl") (high-close="hc") (low-open="lo") (low-high="lh") (low-close="lc") (close-open="co") (close-high="ch") (close-low="cl") (Upper Wick="uw") (Body="bd") (Lower Wick="lw") (Scalar Close Loc="scp") (Vector Close Loc="vcp") (Scalar Open Loc ="sop") (Vector Open Loc="vop")
export vpct(simple string _exp, int _prec) =>
    output = switch _exp
        "oh" =>  math.round(vtick("oh")  / vtick("rg"),                _prec)
        "ol" =>  math.round(vtick("ol")  / vtick("rg"),                _prec)
        "oc" =>  math.round(vtick("oc")  / vtick("rg"),                _prec)
        "ho" =>  math.round(vtick("ho")  / vtick("rg"),                _prec)
        "hl" =>  math.round(vtick("hl")  / vtick("rg"),                _prec)
        "hc" =>  math.round(vtick("hc")  / vtick("rg"),                _prec)
        "lo" =>  math.round(vtick("lo")  / vtick("rg"),                _prec)
        "lh" =>  math.round(vtick("lh")  / vtick("rg"),                _prec)
        "lc" =>  math.round(vtick("lc")  / vtick("rg"),                _prec)
        "co" =>  math.round(vtick("co")  / vtick("rg"),                _prec)
        "ch" =>  math.round(vtick("ch")  / vtick("rg"),                _prec)
        "cl" =>  math.round(vtick("cl")  / vtick("rg"),                _prec)
        "uw" =>  math.round(vtick("uw")  / vtick("rg"),                _prec)
        "bd" =>  math.round(vtick("bd")  / vtick("rg"),                _prec)
        "lw" =>  math.round(vtick("lw")  / vtick("rg"),                _prec)
        "scp" => math.round(vtick("cl")  / vtick("rg"),                _prec)
        "sop" => math.round(vtick("ol")  / vtick("rg"),                _prec)
        "vcp" => math.round((vtick("cl") - vtick("hc")) / vtick("rg"), _prec)
        "vop" => math.round((vtick("ol") - vtick("ho")) / vtick("rg"), _prec)
    output
//}

// --pct()/vpct() Overload {
export pct(simple string _exp) =>
    output = switch _exp
        "oh" =>  math.abs(tick("oh")  / tick("rg"))
        "ol" =>  math.abs(tick("ol")  / tick("rg"))
        "oc" =>  math.abs(tick("oc")  / tick("rg"))
        "ho" =>  math.abs(tick("ho")  / tick("rg"))
        "hl" =>  math.abs(tick("hl")  / tick("rg"))
        "hc" =>  math.abs(tick("hc")  / tick("rg"))
        "lo" =>  math.abs(tick("lo")  / tick("rg"))
        "lh" =>  math.abs(tick("lh")  / tick("rg"))
        "lc" =>  math.abs(tick("lc")  / tick("rg"))
        "co" =>  math.abs(tick("co")  / tick("rg"))
        "ch" =>  math.abs(tick("ch")  / tick("rg"))
        "cl" =>  math.abs(tick("cl")  / tick("rg"))
        "uw" =>  math.abs(tick("uw")  / tick("rg"))
        "bd" =>  math.abs(tick("bd")  / tick("rg"))
        "lw" =>  math.abs(tick("lw")  / tick("rg"))
        "scp" => math.abs(tick("cl")  / tick("rg"))
        "sop" => math.abs(tick("ol")  / tick("rg"))
        "vcp" => math.abs((tick("cl") - tick("hc")) / tick("rg"))
        "vop" => math.abs((tick("ol") - tick("ho")) / tick("rg"))
    output

export vpct(simple string _exp) =>
    output = switch _exp
        "oh" =>  vtick("oh")  / vtick("rg")
        "ol" =>  vtick("ol")  / vtick("rg")
        "oc" =>  vtick("oc")  / vtick("rg")
        "ho" =>  vtick("ho")  / vtick("rg")
        "hl" =>  vtick("hl")  / vtick("rg")
        "hc" =>  vtick("hc")  / vtick("rg")
        "lo" =>  vtick("lo")  / vtick("rg")
        "lh" =>  vtick("lh")  / vtick("rg")
        "lc" =>  vtick("lc")  / vtick("rg")
        "co" =>  vtick("co")  / vtick("rg")
        "ch" =>  vtick("ch")  / vtick("rg")
        "cl" =>  vtick("cl")  / vtick("rg")
        "uw" =>  vtick("uw")  / vtick("rg")
        "bd" =>  vtick("bd")  / vtick("rg")
        "lw" =>  vtick("lw")  / vtick("rg")
        "scp" => vtick("cl")  / vtick("rg")
        "sop" => vtick("ol")  / vtick("rg")
        "vcp" => (vtick("cl") - vtick("hc")) / vtick("rg")
        "vop" => (vtick("ol") - vtick("ho")) / vtick("rg")
    output
//}


// Point Displacement
plot(pt("uw"),      color = color.aqua)
plot(pt("bd"),      color = color.aqua)
plot(pt("lw"),      color = color.aqua)
plot(pt("rg"),      color = color.aqua)
// Tick Displacement
plot(tick("uw"),    color = color.navy)
plot(tick("bd"),    color = color.navy)
plot(tick("lw"),    color = color.navy)
plot(tick("rg"),    color = color.navy)
// Percent Displacement Rounded
plot(pct("uw", 2),  color = color.orange)
plot(pct("bd", 2),  color = color.orange)
plot(pct("lw", 2),  color = color.orange)
plot(pct("scp", 2), color = color.fuchsia)
plot(pct("sop", 2), color = color.fuchsia)
// Percent Displacement Not Rounded
plot(pct("vcp"),    color = color.purple)
plot(pct("vop"),    color = color.purple)

// Notes:
// Scalar - Non-directional. Absolute Value
// Scalar Position: The position of the price attribute relative to the scale of the bar range (high - low)
//                  Example: high = 100. low = 0. close = 25.
//                  (A) Measure price distance C-L. How high above the low did the candle close (e.g. close - low  = 25)
//                  (B)  Divide by bar range (high - low).  25 / (100 - 0) = .25
//                  Explaination: The candle closed at the 25th percentile of the bar range given the bar range low = 0 and bar range high = 100.
//                  (close - low) / (high - low)

// Vector = Directional. [-100% : 100%]
// Vector Position: The position of the price attribute relative to the scale of the bar midpoint (Vector Position at hl2 = 0)
//                  Example: high = 100. low = 0. close = 25.
//                  (A) Measure Price distance C-L: How high above the low did the candle close (e.g. close - low  = 25)
//                  (B) Measure Price distance H-C: How far below the high did the candle close (e.g. high - close = 75)
//                  (C) Take Difference: A - B = C = -50
//                  (D) Divide by bar range (high - low).  -50 / (100 - 0) = -0.50
//                  Explaination: Candle close at the midpoint between hl2 and the low. 
//                                For vop, substitute open for close.
//                  Formula: { [(close - low) - (high - close)] / (high - low) }

// -- Bar Patterns ///////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////// {
// @function Overlap
// @param _off (int) Offset
// @returns Overlap of current bar with prior bar (0.xx)
export overlap(int _off=0) =>
    nakedHigh  = math.abs(high[_off] - high[_off+1])
    nakedLow   = math.abs(low[_off]  - low[_off+1])
    nonOverlap = nakedHigh + nakedLow
    twoBarRg   = math.max(high[_off], high[_off+1]) - math.min(low[_off], low[_off+1])
    overlap    = twoBarRg - nonOverlap
    pctOverlap = overlap / twoBarRg
    pctOverlap
// @function Inside Bar Overlap
// @param _off (int) Offset
// @returns Percent of Bar that is outside prior bar (0.xx)
export ibOverlap(int _off=0) =>
    nakedHigh  = high[_off] > high[_off+1] ? math.abs(high[_off] - high[_off+1]) : 0
    nakedLow   = low[_off]  < low[_off+1]  ? math.abs(low[_off]  - low[_off+1])  : 0
    nonOverlap = nakedHigh + nakedLow
    twoBarRg   = math.max(high[_off], high[_off+1]) - math.min(low[_off], low[_off+1])
    overlap    = twoBarRg - nonOverlap
    pctOverlap = overlap / twoBarRg
    pctOverlap
// @function a >= b[off]
// @param _a (float) Queried Attribute
// @param _b (float) Reference Attribute
// @param _off (int) Offset
// @param _e (bool) (True = >=) | (False = >) 
// @returns (bool) true if a > b[off]. Defaults: _off = 1. _e = false
export gt(float _a, float _b, int _off=1, bool _e=false) => _e ? _a>=_b[_off] : _a>_b[_off]
// @function a <= b[off]
// @param _a (float) Queried Attribute
// @param _b (float) Reference Attribute
// @param _off (int) Offset
// @param _e (bool) (True = <=) | (False = <) 
// @returns (bool) true if a < b[off]. Defaults: _off = 1. _e = false 
export lt(float _a, float _b, int _off=1, bool _e=false) => _e ? _a<=_b[_off] : _a<_b[_off]
// @function Price At Scalar Position of Bar
// @param _sp (float) Format: 0.XX Scalar Position of Price 
// @returns the price of the corresponding Scalar Price Posiiton on current candle from argument rounded to mintick 
export priceFromSp(float _sp) => math.round_to_mintick((_sp*(high-low))+low)
//}

// -- Inside Bar/Outside Bars  ////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////// {
// @function Inside Bar
// @param _off (int) Offset
// @returns (bool) true if bar is Inside Bar
export ib(int _off=0) => high[_off]<=high[_off+1] and low[_off]>=low[_off+1]
// @function Inside Bar High
// @param _off (int) Offset
// @returns (bool) true if bar is Inside Bar w/outside high
export ibH(int _off=0) => (high[_off]> high[_off+1] and low[_off]>=low[_off+1]) and (close[_off]<=math.max(high[_off+1],low[_off+1]) and close[_off]>=math.min(high[_off+1],low[_off+1]))
// @function Inside Bar Low
// @param _off (int) Offset
// @returns (bool) true if bar is Inside Bar w/outside low
export ibL(int _off=0) => high[_off]<=high[_off+1] and low[_off]<low[_off+1] and close[_off]<=math.max(high[_off+1],low[_off+1]) and close[_off]>=math.min(high[_off+1],low[_off+1]) 
// @function Outside Bar
// @param _off (int) Offset
// @returns (bool) true if bar is Outside Bar
export ob(int _off=0) => high[_off]>high[_off+1] and low[_off]<low[_off+1]
// @function Outside Bar - Close in Range
// @param _off (int) Offset
// @returns (bool) true if bar is Outside Bar but closes in prior bar range
export obR(int _off=0) => high[_off]>high[_off+1] and low[_off]<low[_off+1] and close[_off]<=math.max(high[_off+1],low[_off+1]) and close[_off]>=math.min(high[_off+1],low[_off+1]) 
//}

// -- Bull/Bear Bars  /////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////// {
// @function Bull Bar
// @returns (bool) true if close > open
export bullbar(int _off=0) => close[_off]>open[_off]
// @function Bear Bar
// @returns (bool) true if close < open
export bearbar(int _off=0) => close[_off]<open[_off]
//}

// -- Candle Attribute Comparisons ////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////// {
// @function open > open[off]
// @param _off (int) Offset
// @returns (bool) true if open > open[off]
export oGTo(int _off=1) => open>open[_off]
// @function open > high[off]
// @param _off (int) Offset
// @returns (bool) true if open > high[off]
export oGTh(int _off=1) => open>high[_off]
// @function open > low[off]
// @param _off (int) Offset
// @returns (bool) true if open > low[off]
export oGTl(int _off=1) => open>low[_off]
// @function open > close[off]
// @param _off (int) Offset
// @returns (bool) true if open > close[off]
export oGTc(int _off=1) => open>close[_off]

// @function open < open[off]
// @param _off (int) Offset
// @returns (bool) true if open < open[off]
export oLTo(int _off=1) => open<open[_off]
// @function open < high[off]
// @param _off (int) Offset
// @returns (bool) true if open < high[off]
export oLTh(int _off=1) => open<high[_off]
// @function open < low[off]
// @param _off (int) Offset
// @returns (bool) true if open < low[off]
export oLTl(int _off=1) => open<low[_off]
// @function open < close[off]
// @param _off (int) Offset
// @returns (bool) true if open < close[off]
export oLTc(int _off=1) => open<close[_off]

// @function high > open[off]
// @param _off (int) Offset
// @returns (bool) true if high > open[off]
export hGTo(int _off=1) => high>open[_off]
// @function high > high[off]
// @param _off (int) Offset
// @returns (bool) true if high > high[off]
export hGTh(int _off=1) => high>high[_off]
// @function high > low[off]
// @param _off (int) Offset
// @returns (bool) true if high > low[off]
export hGTl(int _off=1) => high>low[_off]
// @function high > close[off]
// @param _off (int) Offset
// @returns (bool) true if high > close[off]
export hGTc(int _off=1) => high>close[_off]

// @function high < open[off]
// @param _off (int) Offset
// @returns (bool) true if high < open[off]
export hLTo(int _off=1) => high<open[_off]
// @function high < high[off]
// @param _off (int) Offset
// @returns (bool) true if high < high[off]
export hLTh(int _off=1) => high<high[_off]
// @function high < low[off]
// @param _off (int) Offset
// @returns (bool) true if high < low[off]
export hLTl(int _off=1) => high<low[_off]
// @function high < close[off]
// @param _off (int) Offset
// @returns (bool) true if high < close[off]
export hLTc(int _off=1) => high<close[_off]

// @function low > open[off]
// @param _off (int) Offset
// @returns (bool) true if low > open[off]
export lGTo(int _off=1) => low>open[_off]
// @function low > high[off]
// @param _off (int) Offset
// @returns (bool) true if low > high[off]
export lGTh(int _off=1) => low>high[_off]
// @function low > low[off]
// @param _off (int) Offset
// @returns (bool) true if low > low[off]
export lGTl(int _off=1) => low>low[_off]
// @function low > close[off]
// @param _off (int) Offset
// @returns (bool) true if low > close[off]
export lGTc(int _off=1) => low>close[_off]

// @function low < open[off]
// @param _off (int) Offset
// @returns (bool) true if low < open[off]
export lLTo(int _off=1) => low<open[_off]
// @function low < high[off]
// @param _off (int) Offset
// @returns (bool) true if low < high[off]
export lLTh(int _off=1) => low<high[_off]
// @function low < low[off]
// @param _off (int) Offset
// @returns (bool) true if low < low[off]
export lLTl(int _off=1) => low<low[_off]
// @function low < close[off]
// @param _off (int) Offset
// @returns (bool) true if low < close[off]
export lLTc(int _off=1) => low<close[_off]

// @function close > open[off]
// @param _off (int) Offset
// @returns (bool) true if close > open[off]
export cGTo(int _off=1) => close>open[_off]
// @function close > high[off]
// @param _off (int) Offset
// @returns (bool) true if close > high[off]
export cGTh(int _off=1) => close>high[_off]
// @function close > low[off]
// @param _off (int) Offset
// @returns (bool) true if close > low[off]
export cGTl(int _off=1) => close>low[_off]
// @function close > close[off]
// @param _off (int) Offset
// @returns (bool) true if close > close[off]
export cGTc(int _off=1) => close>close[_off]

// @function close < open[off]
// @param _off (int) Offset
// @returns (bool) true if close < open[off]
export cLTo(int _off=1) => close<open[_off]
// @function close < high[off]
// @param _off (int) Offset
// @returns (bool) true if close < high[off]
export cLTh(int _off=1) => close<high[_off]
// @function close < low[off]
// @param _off (int) Offset
// @returns (bool) true if close < low[off]
export cLTl(int _off=1) => close<low[_off]
// @function close < close[off]
// @param _off (int) Offset
// @returns (bool) true if close < close[off]
export cLTc(int _off=1) => close<close[_off]
//}
