pupu
Member
I have noticed some studies uses Power of e + Natural Log to compute bar height or volume size, and than sometimes make those computed numbers to work with standard deviation.
My question, is why use "Power of e + Natural Log"?
For example, for simply compute averaged bar height of previous 5 bars:
Why bother use the above, instead of just simple average?
I have attached an example code below to show the difference in value computed:
My question, is why use "Power of e + Natural Log"?
For example, for simply compute averaged bar height of previous 5 bars:
Code:
# define distance away from low/high to plot signal
def AvgBarHeight_LN = Power(Double.E, Average(Log(Max(high - low, TickSize())), 5));
Why bother use the above, instead of just simple average?
Code:
def AvgBarHeight = Average(Max(high - low, TickSize()), 5);
I have attached an example code below to show the difference in value computed:
Code:
# -------------------------------------------------
declare once_per_bar;
declare upper;
# define distance away from low/high to plot signal
def AvgBarHeight_LN = Power(Double.E, Average(Log(Max(high - low, TickSize())), 5));
def AvgBarHeight = Average(Max(high - low, TickSize()), 5);
plot graph_BarInfo_Up = AvgBarHeight_LN;
graph_BarInfo_Up.SetPaintingStrategy(PaintingStrategy.VALUES_ABOVE);
plot graph_BarInfo_Dn = AvgBarHeight;
graph_BarInfo_Dn.SetPaintingStrategy(PaintingStrategy.VALUES_BELOW);
# -------------------------------------------------