# is it possible to calculate FE over ATH based on the formula?

#### Docbrown83

##### Member
Hi Guys,

I'm interested in the Fractal Efficiency Ratio as described by Perry Kaufaman. The fractal efficiency is a measure of market speed volatility.

I am trying to learn how to script and feel like I am getting better....however, this may seem simple for others, but I have been having one hell of a time trying to convert this TOS, but keeping getting a error message. Here is the following formula for tc2000 that I am trying to convert:

(C - C20) / (ABS(C - C1) + ABS(C1 - C2) + ABS(C2 - C3) + ABS(C3 - C4) + ABS(C4 - C5) + ABS(C5 - C6) + ABS(C6 - C7) + ABS(C7 - C8) + ABS(C8 - C9) + ABS(C9 - C10) + ABS(C10 - C11) + ABS(C11 - C12) + ABS(C12 - C13) + ABS(C13 - C14) + ABS(C14 - C15) + ABS(C15 - C16) + ABS(C16 - C17) + ABS(C17 - C18) + ABS(C18 - C19) + ABS(C19 - C20))

.....

so when I do convert this formula, substituting C = "close" and ABS = "AbsValue"....I get a error message at the end.

What am I doing wrong?

Thanks.

@Docbrown83 Did you put the numbers in []? c1 to close[1], c2 to close[2], etc. You can compress that code into this as well.
Code:
``````input efficiency_length = 10;

def change = close - close[efficiency_length];
def volatility = Sum(AbsValue(close - close[1]), efficiency_length);
plot ER = change / volatility;``````

Last edited:
@Docbrown83 Did you put the numbers in []? c1 to close[1], c2 to close[2], etc. You can compress that code into this as well.
Code:
``````input efficiency_length = 10;

def change = close - close[efficiency_length];
def volatility = Sum(AbsValue(close - close[1]), efficiency_length);
plot ER = change / volatility;``````
No I didn't.....well now I know! Thank you!!!

### Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
387 Online

## The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
• Exclusive indicators
• Proven strategies & setups
• Private Discord community
• ‘Buy The Dip’ signal alerts
• Exclusive members-only content
• Add-ons and resources
• 1 full year of unlimited support

### Frequently Asked Questions

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?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.