RedK_Relative Rate Of Change v1
"RedK_Relative (Dual) Rate Of Change v1 - RROC v1" by RedKTrader, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: RedK_Relative (Dual) Rate Of Change v1 - RROC v1 (v1.0), read 2026-10-12T16:18:34.996Z; 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_Relative (Dual) Rate Of Change v1 - RROC v1 by RedKTrader, ported from Pine v4. Pane indicator with 2 plots, 1 level 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/ // © RedKTrader // ------------------------------------------------------------------------------------------------ // Original author: RedKTrader // Original title: RedK_Relative (Dual) Rate Of Change v1 - RROC v1 // 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_Relative Rate Of Change v1", shorttitle="Redk_RRoC v1", format=format.price, precision=2, timeframe="") fastlength = input.int(title="Fast", defval=5, minval=1, inline="RoC Lengths", group="RoC Lengths") slowlength = input.int(title="Slow", defval=15, minval=1, inline="RoC Lengths", group="RoC Lengths") smooth = input.int(title="Smoothing", defval=3, minval=1, maxval=5) source = input.source(title="Source", defval=hlc3) // we start from the standard RoC calculation - then apply couple of changes // first, we divide by the length cause this will be the "% change per bar" vs total % change // this really doesn't cause a major change in the broad "plot shape", but the numbers are usable // as in saying (X stock is making an average x% move "per bar" ) // then we add another RoC of a slower length, so we can visualize a "relative" Rate of Change // The idea here is simple, when the fast RoC exceeds the slow RoC (either up or down), then there's a breakout action roc = 100 * (source - source[fastlength]) / source[fastlength] / fastlength slowroc = 100 * (source - source[slowlength]) / source[slowlength] / slowlength //apply wma-based smoothing roc_s = ta.wma(roc, smooth) slowroc_s = ta.wma(slowroc, smooth) //prep plot variables col_up = #00bcd4 //RoC up col_dn = #ff870a //RoC down col_pos = #33ff00 //SRoC Positive col_neg = #ff1111 //SRoC Negative col_zero = #b2b5be66 col_roc = roc_s > 0 ? col_up : col_dn col_slowroc = slowroc_s > 0 ? col_pos : col_neg // final plots hline(0, title="Zero Line", color=col_zero, linestyle=hline.style_solid, linewidth=1) plot(slowroc_s, title="Slow ROC", color=color.new(col_slowroc, 70), style=plot.style_area, linewidth=3) plot(roc_s, title="ROC", color=col_roc, linewidth=3)
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.