mentfx Triple M
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © mentfx050

//@version=4
study("mentfx Triple M","mentfx Triple M", overlay = true, max_lines_count = 500)

showhigh     = input(true, title = "--------Show High wick--------", inline = "0")
showlow      = input(true, title = "--------Show Low wick--------",  inline = "0")

linewidth1   = input(3, "High wick linewidth", inline = "witdth")
linewidth2   = input(3, "Low wick linewidth",  inline = "witdth")

linecolor1   = input(color.red, "High wick Color", inline = "line color")
linecolor2   = input(color.green,  "Low  wick Color", inline = "line color")

Highwick     = high > high[1] and close < high[1]
Lowwick      = low < low[1] and close > low[1]

Highwickbar  = 0,    Lowwickbar = 0
Highwickhigh = 0.0,  Lowwicklow = 0.0 
Highbody     = 0.0,  Lowbody    = 0.0 

Highwickbar  := valuewhen(Highwick, bar_index, 0)
Highwickhigh := valuewhen(Highwick, high, 0)
Highbody     := valuewhen(Highwick, max(close, open), 0)

Lowwickbar   := valuewhen(Lowwick, bar_index, 0)
Lowwicklow   := valuewhen(Lowwick, low, 0)
Lowbody      := valuewhen(Lowwick, min(close, open), 0)

highline     = not showhigh ? na : line.new(Highwickbar, Highwickhigh, Highwickbar, Highbody, xloc = xloc.bar_index, color = linecolor1, width = linewidth1, style=line.style_solid)
lowline      = not showlow  ? na : line.new(Lowwickbar,  Lowwicklow,   Lowwickbar,  Lowbody,  xloc = xloc.bar_index, color = linecolor2, width = linewidth2, style=line.style_solid)

// line.delete(highline[1])
// line.delete(lowline[1]) 
