Future Grand Trend
"Future Grand Trend" by HPotter, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Future Grand Trend (v1.0), read 2026-11-15T18:28:06.676Z; 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.
Future Grand Trend by HPotter, ported from Pine v5. Overlay indicator with no drawn output on the fixture and 2 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-05-04; 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 04/04/2022
// This my version of try to think about next movement of chart.
//
// WARNING:
// - For purpose educate only
////////////////////////////////////////////////////////////
// ------------------------------------------------------------------------------------------------
// Original author: HPotter
// Original title: Future Grand Trend
// 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
DrawLine(x1, y1, x2, y2) =>
clr = y1 < y2 ? color.green : color.red
line.new(x1, y1, x2, y2, xloc.bar_index, color=clr, width=2)
indicator("Future Grand Trend", "FGT", true, max_lines_count=100)
src = input(close)
LengthMA = input.int(10)
length = 70
forecast = 100
var mult = 0.1
var source = "Noisy"
sh = false
varip points = array.new_float()
varip cls = array.new_float()
varip shift = 0.0
//----
t = 0.
c = 0.
t := 0.9 * nz(t[length], src) + 0.1 * src + ta.change(0.9 * nz(t[length], src), length)
trend = ta.sma(t, length)
srcf = t
fcast = srcf + ta.change(srcf, forecast)
array.push(points, fcast)
ma = ta.sma(ohlc4, LengthMA)
if barstate.ishistory == false
it = 0
if shift == 0
shift := ma - array.get(points, bar_index - forecast)
for i = bar_index - forecast to bar_index
y1 = array.get(points, i - 1)
y2 = array.get(points, i)
y1 := y1 + shift
y2 := y2 + shift
x1 = bar_index + it
x2 = bar_index + it + 1
DrawLine(x1, y1, x2, y2)
it := it + 1
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.