TradingView
dgtrd
17 de Jun. de 2020 0:41

Rate of Return (RoR) by DGT 

NEO / TetherUSBinance

Descripción

A rate of return (RoR) is the net gain or loss of an investment over a specified time period, expressed as a percentage of the investment’s initial cost

Notas de prensa

Display format updated as percentages since we measure changes in percentage with this study

Notas de prensa

Rate of Return (RoR) also called Return on Investment (ROI) is a performance measure used to evaluate the efficiency of an investment, net gain or loss of an investment over a specified time period, he rate of change in price movement over a period of time to help investors determine the strength of a trend

This study measures monthly, annual and custom length of rate of return

In the previous version, annual and monthly calculations was suitable for crypto market and daily time frame only. Thanks to @spetry who find out the issue and warned me

now updated to cover other markets and will be shown for daily timeframe only

Custom length RoR will be calculated in all time frames for all markets.

Reminder: RoR provides identical figures with momentum indicator, only values expressed in percentage

Notas de prensa

This update introduces an experimental application of feedback concept common in Electronic Engineering, attempting to present additional value/insight to the Indicator Rate of Return. RoR, as explained above is a measure of net gain/loss of an financial instrument over a specified period of time, also sometimes called the basic growth rate, or alternatively, return on investment (ROI). Mathematically you may consider RoR same as a Momentum (MOM) or Rate of Change (ROC) Indicator and benefit from their trading concepts.

Feedback concept in Electronic Engineering
Negative feedback (or balancing feedback) is applied to reduce the fluctuations, whether caused by changes in the source or by other disturbances. The applied negative feedback can improve performance, gain stability, linearity and reduce sensitivity to parameter variations due to environment.
Whereas positive feedback tends to lead to instability via exponential growth, oscillation or chaotic behaviour

observations of applying feedback effect :
-emphasis the sudden large price movements
-emphasis the probable reversal or corrections points of momentum
-emphasis stability periods - no affects observed during average prices movements (both direction), rate of return with feedback effect remain almost same as rate of return

Sensitivity can be adjusted with feedback factor provided as user argument, monthly and annual plotting does not benefit from feedback factor

mathematical expression and formulation of feedback effect
our formula of the rate of return is expressed as
rate-of-return = (current value - initial value) / initial value
alternatively, rate-of-return can be expressed by current value / initial value
In Pine,
rate-of-return = source / source(length)

Let’s apply a negative feedback as in electronic engineering concept, just it would be easy to consider the negative feedback in trading as brokerage commission or the effect of inflation over time which are not taken into consideration of simple rate of return calculation

rewriting the formula as:
rate-of-return * source(length) = source
adding negative feedback by subtracts a fraction of current source value from initial source value, we can express
rate-of-return * (source(length) - feedback-factor * source) = source
where feedback-factor is the feedback fraction (with this study value from 0 to 1)
rate-of-return * source(length) - feedback-factor * source * rate-of-return = source
rate-of-return * source(length) = source * ( 1 + feedback-factor * rate-of-return )

the rate-of-return with negative feedback effect becomes
rate-of-return-negative-feedback = source / source(length) = rate-of-return / ( 1 + feedback-factor * rate-of-return )

similarly, positive feedback is adding fraction of current source value to initial source value, which results as
rate-of-return-positive-feedback = rate-of-return / ( 1 - feedback * rate-of-return )


Trading success is all about following your trading strategy and the indicators should fit within your trading strategy, and not to be traded upon solely

Disclaimer: The script is for informational and educational purposes only. Use of the script does not constitute professional and/or financial advice. You alone have the sole responsibility of evaluating the script output and risks associated with the use of the script. In exchange for using the script, you agree not to hold dgtrd TradingView user liable for any possible claim for damages arising from any decision you make based on use of the script

Notas de prensa

update :
* presentation improvements, input option tooltips
* smoothing line addition
* Pine v5 update

ps : positive feedback effect removed, plottings are adjusted to rate of return and the negative balancing feedback effect

Notas de prensa

update : added
* to date RoR plotting options
* performance table option
Comentarios
smartiesss
it is such a good indicator that can predict abnormal price movement and take advantage to it, very useful and have great insight! Superb!!
dgtrd
thank You @smartiesss, i am so glad to hear this
TMK2
@dgtrd, thank you!

This is actually such a powerful indicator.

One suggestion: I like that you’ve added an option to add yearly and monthly rate of returns. Would you be able to add an option for Year-To-Date Rate of Return, as well?
TMK2
@dgtrd, and if it’s not too much to ask, would you be able to also add the option to compare the Rate of Return with, perhaps, another symbol of our choosing, thereby having us see the performance plotted together on the same set of axes.

Thoughts?
dgtrd
thank you @TMK2, and thanks a lot for the suggestions. which one you would preffer plotting or stat table :
TMK2
@dgtrd, would it be possible to get both options, then the user can choose which form of visualisation they want the data to come in.

For example, when viewing on a mobile screen, just the various lone plots will do because of the limited screen real estate, then the user can disable the table option.

When viewing on a larger screen, then the table is great to have, and the line plot becomes a great option. I really like how you have chosen to visualise the data on the table. An accompanying line plot for each set of data will let the line plot and table compliment each other well, with various options to choose which data you want represented/plotted.

Let me know what you think. :)
dgtrd
@TMK2, agree :-) thanks for the feedback, applied as you suggested
TMK2
@dgtrd, looks good!
dgtrd
@TMK2, :-) thx and thx for the suggestions
TMK2
@dgtrd, hi! Happy New Happy!

I’m back with another suggestion, and I wanted your thoughts on it.

What’s your take on adding 52 week high and low data to the statistical table, and possibly percentage distance from the 52 week high and low?

Looking forward to hearing your thoughts.
Más