Custom Indicator error in Beta Version

Section for discussions related to indicators, use of indicators, and building of trading stategies using indicators.

Moderator: admin

Custom Indicator error in Beta Version

Postby LordTwig » Tue Mar 30, 2010 8:19 am

Hiya,
I have noticed that an indicator that works in current Marketscope but doesn't in Beta version, might be bug, might be bad programming.........?

In pivot point indicator by Gidien here;
http://forexforums.dailyfx.com/indicato ... post280948

I get error messages that "attempt to do arithmetic on upvalue 'N' a nil value,
How do I fix it.

Thing is program works in current version as is.

Does this mean that all these existing 'Custom indicators' are going to possibly have problems & need converting/fixed/updated before they will work.

I don't know I just started learning programming a couple of weeks ago.

LordTwig
Cheers
LordTwig
LordTwig
FXCodeBase: Confirmed User
 
Posts: 157
Joined: Fri Mar 12, 2010 3:15 am

Re: Custom Indicator error in Beta Version

Postby Nikolay.Gekht » Tue Mar 30, 2010 10:20 am

Looking at the indicator I can suggest that the problem is in the
this part of the code.

if TF == "m5" then
N = 304;
end
if TF == "m15" then
N = 104;
end
if TF == "m30" then
N = 52;
end
if TF == "h1" then
N = 26;
end

The bar size of the source is either not 5, 15, 30 minutes or it is 1 hour, which identifier has been changed in the new version to H1. So, there is no assert in case the bar size is unknown, and N remains unchanged, i.e. has nil value.
Nikolay.Gekht
FXCodeBase: Site Admin
 
Posts: 1235
Joined: Wed Dec 16, 2009 6:39 pm
Location: Cary, NC

Re: Custom Indicator error in Beta Version

Postby LordTwig » Tue Mar 30, 2010 10:25 pm

Nikolay.Gekht wrote:Looking at the indicator I can suggest that the problem is in the
this part of the code.

if TF == "m5" then
N = 304;
end
if TF == "m15" then
N = 104;
end
if TF == "m30" then
N = 52;
end
if TF == "h1" then
N = 26;
end

The bar size of the source is either not 5, 15, 30 minutes or it is 1 hour, which identifier has been changed in the new version to H1. So, there is no assert in case the bar size is unknown, and N remains unchanged, i.e. has nil value.


Yes the 'm' stay the same ie; 'm1' - 'm15' but the 'h1' has to be changed as you suggest to 'H1' the same is said for the day,week,month these will have to be changed in all other indicators that use them to 'D1' - 'W1' - 'M1' and 'H1' of course.

You may want to place this 'alert' in a better spot in this forum for others to be informed of this, maybe have a 'critical alerts page'

Thanks
LordTwig
Cheers
LordTwig
LordTwig
FXCodeBase: Confirmed User
 
Posts: 157
Joined: Fri Mar 12, 2010 3:15 am


Return to Discussions

Who is online

Users browsing this forum: No registered users and 8 guests