Hi all,
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..
if Barindex < 2 then
BU = Close
else
BU = BU[1]-BU[2]/3.414+(1/3.414)*Close
endif
Signal = BU
Noise = Close
SigmaSignal = STD[PP](Signal)
SigmaNoise = STD[PP](Noise)
a = SigmaSignal/SigmaNoise
n = (2/a)-1
if n < 0 then
nn = 1
else
nn = n
endif
//roundedROCvalue = ROUND(nn)
MB = ExponentialAverage[nn](Close)
Return MB COLOURED(0,250,0)
Use more meaningful titles when creating a new topic. Thank you 🙂
What error is reported? you can attach a picture of the error message.
Use pp = 20 (default value for STD) and the Indicator appears to work, but appears to follow Price profile??
PP must be defined or assigned a value, as suggested by GraHal.
You should use the value recommended in the book where you read it.
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 error
Use pp = 20 (default value for STD) and the Indicator appears to work, but appears to follow Price profile??
SigmaSignal = STD[20](Signal)
SigmaNoise = STD[20](Noise)
Hi, I set it directly in the function, but I have the same error..
Prorealtime v.11.1 – 1.8.0_45
I have not used v11 so far. I don’t know what that error is.
Do you know if Nicolas is using the v 11? Maybe he knows this problem ..
Are you using (17) or correctly [17] … square brackets are needed??
[17]..
this is the last tested with the same error
if Barindex < 2 then
BU = Close
else
BU = BU[1]-BU[2]/3.414+(1/3.414)*Close
endif
Signal = BU
Noise = Close
SigmaSignal = STD[17](Signal)
SigmaNoise = STD[17](Noise)
a = SigmaSignal/SigmaNoise
n = (2/a)-1
if n < 0 then
nn = 1
else
nn = n
endif
MB = ExponentialAverage[nn](Close)
Return MB COLOURED(0,250,0)
Above code works fine on v10.3 … I just ran it on my Platform
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..
Thanks
I cant see micro SP500 future. as an option, but is this any good?
Attached is what I see as Options for SPTRD
US500 (50$) dec19 is fine for me if you can..
Line 14 means that you could be looking for an average with a period of zero to 0.99999999 which will give an error. Change it to:
if n < 1 then