Exponential average error in indicator?
10/30/2019 at 9:38 AM #111612
I took this indicator from a purchased book, but unfortunately in compiling it gives me an error .. I tried various ways to solve the error, but I can’t understand what’s wrong with this code.
In particular I think I have identified the error in the ExponentialAverage.. I tried to pass “nn” after a Round function thinking it could be a problem with the format of the numbers, but nothing.
The code according to the author of the book must work, he also inserted several examples of graphs with this indicator .. but it doesn’t go..Indicator..123456789101112131415161718192021222324if Barindex < 2 thenBU = CloseelseBU = BU-BU/3.414+(1/3.414)*CloseendifSignal = BUNoise = CloseSigmaSignal = STD[PP](Signal)SigmaNoise = STD[PP](Noise)a = SigmaSignal/SigmaNoisen = (2/a)-1if n < 0 thennn = 1elsenn = nendif//roundedROCvalue = ROUND(nn)MB = ExponentialAverage[nn](Close)Return MB COLOURED(0,250,0)10/30/2019 at 10:22 AM #11162610/30/2019 at 10:36 AM #11163010/30/2019 at 10:43 AM #11163310/30/2019 at 10:54 AM #111636
PP is an exterval value set to 17,
however now I have done other tests by setting both internal and external PP, even at 20, but it continues to always give me the same error10/30/2019 at 11:01 AM #111638
Use pp = 20 (default value for STD) and the Indicator appears to work, but appears to follow Price profile??
SigmaSignal = STD(Signal)
SigmaNoise = STD(Noise)
Hi, I set it directly in the function, but I have the same error..
Prorealtime v.11.1 – 1.8.0_4510/30/2019 at 11:19 AM #11164110/30/2019 at 11:27 AM #11164210/30/2019 at 12:10 PM #11164510/30/2019 at 12:12 PM #111646
this is the last tested with the same error123456789101112131415161718192021if Barindex < 2 thenBU = CloseelseBU = BU-BU/3.414+(1/3.414)*CloseendifSignal = BUNoise = CloseSigmaSignal = STD(Signal)SigmaNoise = STD(Noise)a = SigmaSignal/SigmaNoisen = (2/a)-1if n < 0 thennn = 1elsenn = nendifMB = ExponentialAverage[nn](Close)Return MB COLOURED(0,250,0)10/30/2019 at 12:20 PM #11164810/30/2019 at 12:26 PM #111649
strange.. can you send me a picture with it attached to micro SP500 future.. around last 50 bars? I need of it for testing reason.. this is a step of a more complex indicator.
on M1 (minute) time frame..
Thanks10/30/2019 at 12:32 PM #11165010/30/2019 at 12:41 PM #11165310/30/2019 at 12:57 PM #111654