HPotter:LastPrice
"HPotter Last Price" by HPotter, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: HPotter Last Price (v1.0), read 2026-10-12T15:47:16.580Z; 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.
HPotter Last Price by HPotter, ported from Pine v5. Overlay indicator with drawings and 2 inputs.
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © HPotter
//A script that helps you navigate the current price and the latest highs and lows
//IMPORTANT: For the script to work correctly, you must enable "On every tick" in Preoperties
//
// Throw it on any chart.
// On the right appears:
// white - last transaction price
// green - current high that has not been reached (looks at bars in history)
// red - current low that has not been reached (looks at bars in history)
// yellow - new high or low installed
/////////////////////////////////////////////////////////////
// ------------------------------------------------------------------------------------------------
// Original author: HPotter
// Original title: HPotter Last Price
// Licence: MPL-2.0 (the header above is the original notice, kept verbatim)
// Pine version: 5
// 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
indicator("HPotter:LastPrice", shorttitle="HPLP", overlay=true)
widjetShift = input.int(3, "Widjet Shift")
lookBack = input.int(50, "Look back for HH|LL")
var label labelLL = na
var label labelHH = na
var label labelLast = na
var label labelHigh = na
var label labelLow = na
var label labelRange = na
varip currentH = 1
varip currentL = 1
varip timer = 0
if barstate.isnew and bar_index > 1
currentH := 1
currentL := 1
h = high[currentH]
l = low[currentL]
if l >= low and bar_index > lookBack
l := low
timer := 10
for i = 1 to lookBack
if low[i] < low
currentL := i
break
if h <= high and bar_index > lookBack
h := high
timer := 10
for i = 1 to lookBack
if high[i] > high
currentH := i
break
hs = str.tostring(h, format.mintick)
ls = str.tostring(l, format.mintick)
hh = ""
ll = ""
if timer > 0
timer := timer - 1
hh := str.tostring(high, format.mintick)
ll := str.tostring(low, format.mintick)
//Draw
label.delete(labelLast)
labelLast := label.new(x=bar_index + widjetShift, y=close, text="\n\n" + str.tostring(close, format.mintick) + "\n" + " " + "\n", color=color.new(#000000, 100), textcolor=color.white, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index, yloc=yloc.price)
label.delete(labelHigh)
labelHigh := label.new(x=bar_index + widjetShift, y=close, text="\n" + hs + "\n\n\n", color=color.new(#000000, 100), textcolor=color.green, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index, yloc=yloc.price)
label.delete(labelHH)
labelHH := label.new(x=bar_index + widjetShift, y=close, text=hh + "\n\n\n\n", color=color.new(#000000, 100), textcolor=color.yellow, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index, yloc=yloc.price)
label.delete(labelLow)
labelLow := label.new(x=bar_index + widjetShift, y=close, text="\n\n\n" + ls + "\n", color=color.new(#000000, 100), textcolor=color.red, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index, yloc=yloc.price)
label.delete(labelLL)
labelLL := label.new(x=bar_index + widjetShift, y=close, text="\n\n\n\n" + ll + "", color=color.new(#000000, 100), textcolor=color.yellow, size=size.normal, style=label.style_label_left, xloc=xloc.bar_index, yloc=yloc.price)
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.
- 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.