TradingView
alexgrover
2018年12月12日下午5點08分

Efficient Price 

EUR/USDOANDA

描述

Trading The Movements That Matters

Inspired by the Price Volume Trend indicator the Efficient Price aim to create a better version of the price containing only the information a trend trader must need.


Calculation

This indicator use the Efficiency Ratio as a smoothing constant, it is calculated as follow :

ER = abs(change(close,length))/sum(abs(change(close)),length)

The goal of the Efficiency Ratio is to show if the market is trending or ranging.If ER is high then the market is considered to be trending, if ER is low then the market is considered to be ranging.

Then the Efficient Price is calculated :

EP = cum(change(close)*ER)

When the price is trending, the indicator will show movements of the price with unchanged volatility, but if the price is not trending then the indicator will flatten those movements.Think of this indicator as both a filter and a compressor and the Efficient Price as some kind of threshold.


The Efficient Price As Input For Indicators/Strategies

If the indicator show the movement of the trending price, it can be interesting to use it as input in order to reduce the number of false signals in a strategy.

We will test 2 MACD strategy provided by tradingview, one using the closing price (In Red) and one with the efficient price (In White) as input
with both the following parameters :

fastLength = 50
slowlength = 200
MACDLength = 20
length = 50

Where length is the parameter of the Efficient Price.A spread of 2 pips is used.



Without Efficient Price : 26.88% of profitability, 69 pips of profit.
With Efficient Price : 38.46% of profitability, 336 pips of profit.


The difference of profitability is of 11.58%, the strategy with the Efficient Price made few trades and its equity have a lower variance than the equity of the MACD strategy using closing price.


Smoothed Version

It is possible to smooth the indicator output by using the following code :

EP = cum(change(close,length)*ER)


Hope you enjoy

For any questions/demands feel free to pm me, i would be happy to help you
評論
aaahopper
Hi alexgrover,
Really appreciate your work and thank you, it is truly appreciated.
I like using this line, but prefer to use it on the chart directly.
Could you please assist in the change needed to apply it on the chart, so that I could use "overlay=true".
Thank you again.
alexgrover
@aaahopper, @thanks for your support :) It may be complicated to add an option to change overlay=false to overlay=true since you cant do overlay=input() but you could just drag it on top of the price, but this rescaling would move in order to fit the price, this can be a bit frustrating, a way to rescale the indicator without using this drag option could be to rescale it using z-score rescaling, here how it work,

Here the code:

//@version=2
study("Efficient Price",overlay=true)
length = input(50),len = input(100,title="Rescale")
//
src = input(close)
er = abs(change(src,length))/sum(abs(change(src)),length)
ep = cum(change(close)*er)
z = (ep - sma(ep,len))/stdev(ep,len)
r = sma(close,len) + z*stdev(close,len)
//
plot(r,color=#FE2E9A)

The len parameter will adjust the rescaling, large values are a bit better but its best to find the right one.
aaahopper
@alexgrover,
Thank you so much.
Works like a charm.
I really admire your work.

ICEKI
Nice creations, appreciated your efforts and generous =D
更多