Tweezer Patterns
"Tweezer Patterns" by HPotter, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Tweezer Patterns (v1.0), read 2026-11-15T18:27:50.200Z; source language v5.
Licence: Mozilla Public License 2.0 (MPL-2.0) — full text. The source is published with it, modifications included, under the same licence.
Tweezer Patterns by HPotter, ported from Pine v5. Overlay indicator with 2 marker series, bar/background colouring and 4 inputs.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// (Notice added by FloSignals: the author's source carries none. It was published open-source on 2022-11-11; since 2019-07-26 the platform it was published on has released such a script under MPL-2.0 automatically.)
////////////////////////////////////////////////////////////
// Copyright by HPotter v1.0 11/11/2022
//Tweezer top and bottom, also known as tweezers, are reversal candlestick patterns
//that signal a potential change in the price direction. Both formations consist of
//two candles that occur at the end of a trend, which is in its dying stages.
//
//The tweezer bottom candlestick pattern is a bullish reversal pattern that can be
//spotted at the bottom of a downtrend. It consists of two candles, where the first
//candle is in line with the bearish trend, while the second candle reflects more
//bullish market sentiment as the price bursts higher, in the opposite trend.
//
//The tweezer top candlestick pattern is of the same structure as the tweezer bottom,
//except for the fact that it happens at the end of an uptrend, and therefore, it is a
//bearish reversal pattern. The first candle is bullish, and it continues in the same
//direction, while the second bearish candle indicates that the trend may be changing soon.
//
//Both the bottom and top tweezers are only valid when they occur during uptrends and downtrends.
//Their appearance during choppy trading conditions is practically meaningless, and it signals
//the market indecision to move in either direction.
//
// WARNING:
// - For purpose educate only
// - This script to change bars colors.
////////////////////////////////////////////////////////////
// ------------------------------------------------------------------------------------------------
// Original author: HPotter
// Original title: Tweezer Patterns
// Licence: MPL-2.0 (the notice above was added by FloSignals; the original carries none)
// Pine version: 5
// Fetched: 2026-11-15
// Ported to FloScript by FloSignals; modifications under MPL-2.0.
// Converter: @flosignals/floscript 0.1.0, strict mode, score 100/100
// ------------------------------------------------------------------------------------------------
//@floscript=1
//@version=5
indicator(title='Tweezer Patterns', shorttitle='TP', overlay=true)
var I2 = '●═════ Indicator ═════●'
Accuracy = input.float(0.05, title='Price Accuracy %', step=0.01, group=I2)
MoveAccuracy = input.float(1, title='Move Accuracy %', step=0.01, group=I2)
var misc = '●═════ MISC ═════●'
showTop = input.bool(true, title='Show Tweezers Top', group=misc)
showBottom = input.bool(true, title='Show Tweezers Bottmom', group=misc)
showT = false
showB = false
if showTop
diff = math.abs(close[2] - open[1])
diffPercent = diff / high[1] * 100
if diffPercent <= Accuracy
diff := close[2] - open[2]
diff1 = diff / close[2] * 100
diff := open[1] - close[1]
diff2 = diff / close[1] * 100
if diff1 > MoveAccuracy and diff2 > MoveAccuracy
showT := true
if showBottom
diff = math.abs(close[2] - open[1])
diffPercent = diff / low[1] * 100
if diffPercent <= Accuracy
diff := open[2] - close[2]
diff1 = diff / close[2] * 100
diff := close[1] - open[1]
diff2 = diff / close[1] * 100
if diff1 > MoveAccuracy and diff2 > MoveAccuracy
showB := true
show = showTop and showT or showBottom and showB ? true : false
barcolor(show ? #c1ee1e : na, -2)
barcolor(show ? #c1ee1e : na, -1)
plotshape(show and showB, title='tweezer bottom', text='Buy', textcolor=color.white, style=shape.labelup, size=size.normal, location=location.belowbar, color=color.new(color.green, 0))
plotshape(show and showT, title='tweezer top', text='Sell', textcolor=color.white, style=shape.labeldown, size=size.normal, location=location.abovebar, color=color.new(color.red, 0))
This file is under the Mozilla Public License 2.0; it is a port of the original by HPotter, with the original licence header kept and the changes made for FloScript noted in the file.
- v1
Library refresh 2026-11-15
Disclaimer. Scripts are written and published by members, or ported by FloSignals from open-source originals, and are their authors' own work and opinion. FloSignals does not review them for correctness and nothing in a script is financial advice or a recommendation to buy or sell anything — read the Risk Disclaimer. Posting here is under the Community Rules; a script that is not the poster's to post can be reported as the Copyright & Takedowns page says.

Comments (0)
No comments yet. Members can leave one.