Average Sentiment Oscillator
"Average Sentiment Oscillator" by KivancOzbilgic, MPL-2.0. Ported to FloScript by FloSignals; modifications under MPL-2.0. Original: Average Sentiment Oscillator (v2.0), read 2026-10-12T16:05:49.232Z; 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.
Average Sentiment Oscillator by KivancOzbilgic, ported from Pine v4. Pane indicator with 2 plots 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/
// © KivancOzbilgic
// ------------------------------------------------------------------------------------------------
// Original author: KivancOzbilgic
// Original title: Average Sentiment Oscillator
// 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("Average Sentiment Oscillator", shorttitle="ASO")
length = input.int(10, "Period?", minval=1, maxval=100)
mode = input.int(0, "Calculation Method:", minval=0, maxval=2)
intrarange = high - low
grouplow = ta.lowest(low, length)
grouphigh = ta.highest(high, length)
groupopen = open[length - 1]
grouprange = grouphigh - grouplow
K1 = intrarange == 0 ? 1 : intrarange
K2 = grouprange == 0 ? 1 : grouprange
intrabarbulls = (close - low + (high - open)) / 2 * 100 / K1
groupbulls = (close - grouplow + (grouphigh - groupopen)) / 2 * 100 / K2
intrabarbears = (high - close + (open - low)) / 2 * 100 / K1
groupbears = (grouphigh - close + (groupopen - grouplow)) / 2 * 100 / K2
TempBufferBulls = mode == 0 ? (intrabarbulls + groupbulls) / 2 : mode == 1 ? intrabarbulls : groupbulls
TempBufferBears = mode == 0 ? (intrabarbears + groupbears) / 2 : mode == 1 ? intrabarbears : groupbears
ASOBulls = ta.sma(TempBufferBulls, length)
ASOBears = ta.sma(TempBufferBears, length)
plot(ASOBulls, color=color.blue, linewidth=2)
plot(ASOBears, color=color.red, linewidth=2)
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.
- 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.