# Finite Volume Elements (FVE) for ThinkOrSwim

#### korygill

##### Well-known member
VIP
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

Code:
``````#
# FiniteVolumeElements_FVE
#
# Author: Kory Gill, @korygill
#
# Created from idea on https://usethinkscript.com/threads/finite-volume-elements.593/
# Original idea is from http://mkatsanos.com/FVE.html
#
# 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);
pFVE_MA.SetDefaultColor(Color.Gray);
PFVE_MA.SetPaintingStrategy(PaintingStrategy.DASHES);

plot zeroLine = 0;
zeroLine.SetDefaultColor(Color.White);``````

Link to a flex grid as shown above

https://tos.mx/PUmEFD

Kory Gill, @korygill

#### Art

##### Member
This looks like the same as WeeklyAndDailyPPO

2019 Donor

#### skynetgen

##### Well-known member
Man this is amazing work, Thank you for porting it and bringing it up
I took some liberty and added some visual signals to this
https://tos.mx/qg6j5F

Last edited:

#### SolidChiken

##### New member
2019 Donor
Shocked. Genius work there @skynetgen. Unbelievable

#### Shinthus

##### Active member
2019 Donor
How to interpret this indicator..?

#### skynetgen

##### Well-known member
https://tos.mx/ZlHR6d
Version with reworked short/long signal and variableMA

Also for daily the default settings are fine. For weekly , 30m and 5m 13,21 are better

#### korygill

##### Well-known member
VIP
Version with reworked short/long signal and variableMA
Finally loaded up your edits on this @skynetgen. I like the technique with the 50 histogram. Nice coloring as well.

VIP

#### skynetgen

##### Well-known member
I think I did a few fixes since I last posted it. This is latest version

https://tos.mx/4ESHZd9
I am using it on hourly, daily and weekly timeframes. Using 13/21 settings

#### ball

##### New member

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

#### markos

##### Well-known member
VIP
@ball welcome to useThinkScript. The following is from the author's website... "You can find a money flow divergence system using both FVE and VFI here and a comparison between 7 Money Flow Indicators in my article in the July 2011 of S&C. " You may find the answer there.

#### zeek

##### Active member
2019 Donor
Can anyone post a screenshot of how the reworked version looks like?

Staff member
Staff
VIP

#### SolidChiken

##### New member
2019 Donor
Hi @korygill @skynetgen... Do you guys facing the missing plot after a period of time? Gotta refresh the chart in order to get it back. Wondering is there a way to fix it?

#### SolidChiken

##### New member
2019 Donor
Solved by take out declare once_per_bar;

#### MerryDay

Staff member
Staff
VIP
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:
https://tos.mx/6si5qBI

Last edited:

#### Pelonsax

##### Active member
VIP
Hi all! I'm enjoying this indicator a lot, but I would like to ask for a fix. It seems to not work at all on the one minute [email protected]

#### Pelonsax

##### Active member
VIP
Found a fix. Make it MTF capable and set it to the higher time frame on the lower time frame chart

#### JGilde

##### New member
VIP
Found a fix. Make it MTF capable and set it to the higher time frame on the lower time frame chart
Would you mind sharing the study code or chart with the fix, please?

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• Exclusive members-only content
• 1 full year of unlimited support

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?