RedK_LW'sTrend
"RedK_Larry William's Trend" by RedKTrader, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: RedK_Larry William's Trend (v1.0), read 2026-10-12T16:18:22.397Z; 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.
RedK_Larry William's Trend by RedKTrader, ported from Pine v4. Overlay indicator with 4 plots, 1 fill and 3 inputs.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © RedKTrader
// ------------------------------------------------------------------------------------------------
// Original author: RedKTrader
// Original title: RedK_Larry William's Trend
// Licence: MPL-2.0 (the header above is the original notice, kept verbatim)
// Pine version: 4
// Fetched: 2026-10-12
// 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="RedK_LW'sTrend", shorttitle="RedK_WilliamsTrend", overlay=true, timeframe="")
// I'm not the author of this indicator / concept -- this code was ported from a differentd platform
// i found this code while researching Larry William's Trend indicator
// i left the original defaults and made minimum changes to how this was supposed to be plotted - even kept some of the orginal variable names
// if i would have coded this, i would have possibly coded it differently - tweak the math slightly for the channel boundaries
// it seems this is somehow related to the famous "SuperTrend" indicator - but honestly i don't have an idea how they are connected.
// Note that there are another set of indicators relating to a different "Bill Williams" - not the same source.
length = input.int(title="Length", defval=7, minval=1)
ATR_Period = input.int(title="ATR Period", defval=66, minval=1)
ATRMulti = input.float(title="ATR Multiplier", defval=2.236, minval=1)
ATR = ta.atr(ATR_Period) * ATRMulti
midPrice1 = ta.highest(length)
midPrice2 = ta.lowest(length)
midPrice = (midPrice1 + midPrice2) / 2
Trail = 0.0
Lower = midPrice + ATR
Upper = midPrice - ATR
c1 = close > Trail[1] and close[1] > Trail[1]
c2 = close < Trail[1] and close[1] < Trail[1]
c3 = close > Trail[1]
Trail := if c1
math.max(Trail[1], Upper)
else if c2
math.min(Trail[1], Lower)
else if c3
Upper
else
Lower
myred = #ff0000
mygreen = #00ff00
uptrend = midPrice > Trail
p1 = plot(Trail, color=uptrend ? mygreen : myred, linewidth=2)
p2 = plot(midPrice, color=color.new(color.yellow, 100))
plot(Lower, color=color.new(color.lime, 80))
plot(Upper, color=color.new(color.orange, 80))
fill(p1, p2, color=color.new(uptrend ? mygreen : myred, 75))
This file is under the Mozilla Public License 2.0; it is a port of the original by RedKTrader, with the original licence header kept and the changes made for FloScript noted in the file.
- v2
Library refresh 2026-10-14
- v1
Library refresh 2026-10-12
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.