Finite Volume Elements (FVE) for ThinkOrSwim


Active member
This study is a thinkorswim version of an indicator posted in a question on this forum. This indicator is the work of Markos Katsanos. I have ported the indicator to thinkorswim.

Here is a chart of the indicator from Markos


Here is a chart from thinkorswim


ThinkScript code for this indicator

# FiniteVolumeElements_FVE
# Author: Kory Gill, @korygill
# Created from idea on
# Original idea is from
# VERSION HISTORY (sortable date and time (your local time is fine), and your initials
# 20190907-1200-KG    - Created.
# ...
# ...

declare once_per_bar;
declare lower;

# inputs
input CutOff = 0.003;
input Samples = 22;

# logic
def bn = BarNumber();
def nan = double.NaN;

def tp = hlc3;
def mf = (close - (high+low)/2) + tp - tp[1];
def fveFactor = if mf > (CutOff*Close)
                then 1
                else if mf < (-1*CutOff*Close) then -1
                else 0;

def VolumePlusMinus = volume * fveFactor;
def fveSum = Sum(VolumePlusMinus, Samples);
def fve = if bn > Samples
          then (fveSum / (Average(volume,Samples) * Samples)) * 100
          else nan;

# plots
plot pFVE = fve;

plot pFVE_MA = MovingAverage(AverageType.SIMPLE, fve, 30);

plot zeroLine = 0;

Link to a flex grid as shown above

Happy trading,
Kory Gill, @korygill


New member
Hello, I have serious doubts about this code.

Why are you not using any measurement of price range in the cutoff?


Staff member
I have been using this indicator for about 6 months. I keep noticing more and more correlations with the movement of stock.

This indicator can be used to signal entry as indicated by the 1st rectangle in the photo below. But my favorite use is to identify chop as shown in the 2nd rectangle.

If both the FVE and OBV (On Balance Volume) are below their moving averages (as signified by the red lines), the stock is either descending or in chop.

I use it to filter every scan I run and every arrow that I draw. It removes a lot of false signals.


Here is my chart:
Last edited by a moderator:

Similar threads