Turtle Trade Channels Indicator
"Turtle Trade Channels Indicator TUTCI" by KivancOzbilgic, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Turtle Trade Channels Indicator TUTCI (v3.0), read 2026-11-15T18:43:10.438Z; source language v4.
Licence: Mozilla Public License 2.0 (MPL-2.0) — full text. The source is published with it, modifications included, under the same licence.
Turtle Trade Channels Indicator TUTCI by KivancOzbilgic, ported from Pine v4. Overlay indicator with 4 plots, 8 marker series, 2 fills 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 2021-01-29; since 2019-07-26 the platform it was published on has released such a script under MPL-2.0 automatically.) //author: @kivancozbilgic // ------------------------------------------------------------------------------------------------ // Original author: KivancOzbilgic // Original title: Turtle Trade Channels Indicator TUTCI // Licence: MPL-2.0 (the notice above was added by FloSignals; the original carries none) // Pine version: 4 // 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 // Converted by the FloScript converter from a Pine-compatible v4 source. indicator(title="Turtle Trade Channels Indicator", shorttitle="TuTCI", overlay=true, timeframe="") length = input.int(20, "Entry Length", minval=1) len2 = input.int(10, "Exit Length", minval=1) showsignals = input.bool(title="Show Entry/Exit Signals ?", defval=true) highlighting = input.bool(title="Highlighter On/Off ?", defval=true) lower = ta.lowest(length) upper = ta.highest(length) u = plot(upper, "Upper", color=#0094FF) l = plot(lower, "Lower", color=#0094FF) up = ta.highest(high, length) down = ta.lowest(low, length) sup = ta.highest(high, len2) sdown = ta.lowest(low, len2) K1 = ta.barssince(high >= up[1]) <= ta.barssince(low <= down[1]) ? down : up K2 = ta.barssince(high >= up[1]) <= ta.barssince(low <= down[1]) ? sdown : sup K3 = close > K1 ? down : na K4 = close < K1 ? up : na plot(K1, title="Trend Line", color=color.red, linewidth=2) e = plot(K2, title="Exit Line", color=color.blue, linewidth=1, style=plot.style_circles) buySignal = high == upper[1] or ta.crossover(high, upper[1]) sellSignal = low == lower[1] or ta.crossover(lower[1], low) buyExit = low == sdown[1] or ta.crossover(sdown[1], low) sellExit = high == sup[1] or ta.crossover(high, sup[1]) O1 = ta.barssince(buySignal) O2 = ta.barssince(sellSignal) O3 = ta.barssince(buyExit) O4 = ta.barssince(sellExit) E1 = ta.barssince(buySignal[1]) E2 = ta.barssince(sellSignal[1]) E3 = ta.barssince(buyExit[1]) E4 = ta.barssince(sellExit[1]) plotshape(buySignal and O3 < O1[1] ? down : na, title="Long Entry", location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.green, 0)) plotshape(buySignal and showsignals and O3 < O1[1] ? down : na, title="Long", text="Long Entry", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(color.green, 0), textcolor=color.white) plotshape(sellSignal and O4 < O2[1] ? up : na, title="Short Entry", location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.red, 0)) plotshape(sellSignal and showsignals and O4 < O2[1] ? up : na, title="Short", text="Short Entry", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.red, 0), textcolor=color.white) plotshape(buyExit and O1 < O3[1] ? up : na, title="Long Exit", location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.blue, 0)) plotshape(buyExit and showsignals and O1 < O3[1] ? up : na, title="Long Exit", text="Exit Long", location=location.absolute, style=shape.labeldown, size=size.tiny, color=color.new(color.blue, 0), textcolor=color.white) plotshape(sellExit and O2 < O4[1] ? down : na, title="Short Exit", location=location.absolute, style=shape.circle, size=size.tiny, color=color.new(color.blue, 0)) plotshape(sellExit and showsignals and O2 < O4[1] ? down : na, title="Short", text="Exit Short", location=location.absolute, style=shape.labelup, size=size.tiny, color=color.new(color.blue, 0), textcolor=color.white) color1 = highlighting and math.min(O1, O2, O3) == O1 ? color.green : na color2 = highlighting and math.min(O1, O2, O4) == O2 ? color.red : na fill(u, e, color=color.new(color1, 88), title="Background") fill(l, e, color=color.new(color2, 88), title="Background")
This file is under the Mozilla Public License 2.0; it is a port of the original by KivancOzbilgic, 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.