attempt to index global problem

Moderator: admin

attempt to index global problem

Postby tllewell » Thu Mar 01, 2012 6:48 pm

I modified the existing OSC indicator and am trying to run it as an indicator called MvaDiff. The change was to reverse the order of the moving averages in the calculation of the indicator. So, I made that change, changed the OSC strings to MvaDiff strings in the file, did the same for the rc file, and it doesn't work. I'm getting

[string "C:\Gehtsoft\IndicoreSDK\indicators\MvaDiff...."]:51: attempt to index global 'Mvadiff' (a nil value)

in the debugger.

I tried commenting out the line and I get the same message. I deleted the line and I get the same message. So it's not the line. I looked at the rc file and the common.lua.rc file. This is absolutely identical to the OSC file except for changing "OSC" to "MvaDiff" whereever it appears.

What is going on here?
tllewell
 
Posts: 76
Joined: Thu Mar 01, 2012 4:06 pm

Re: attempt to index global problem

Postby sunshine » Fri Mar 02, 2012 4:26 am

Could you please post the modified code of the indicator and the resource file (rc)?
sunshine
 

Re: attempt to index global problem

Postby tllewell » Fri Mar 02, 2012 10:47 am

I tried to reply with the requested code pasted into the text box here, but I got

This message was flagged as spam and has been denied.
tllewell
 
Posts: 76
Joined: Thu Mar 01, 2012 4:06 pm

Re: attempt to index global problem

Postby tllewell » Fri Mar 02, 2012 10:59 am

I tried wrapping the pasted files in the
Code: Select all
 
tags, and I still get

This message was flagged as spam and has been denied.
tllewell
 
Posts: 76
Joined: Thu Mar 01, 2012 4:06 pm

Re: attempt to index global problem

Postby tllewell » Fri Mar 02, 2012 3:01 pm

Well, I can't do that, since this system thinks code is spam. You'll have to take my word for it, I guess, and look at the OSC files.

I've tried it with the JIT vm set in the debugger instead of the default. Same message. Where is this message coming from? Is there more info available on the error messages?
tllewell
 
Posts: 76
Joined: Thu Mar 01, 2012 4:06 pm

Re: attempt to index global problem

Postby tllewell » Fri Mar 02, 2012 3:55 pm

I fixed it. It was something silly. Since I can't post a block of code, I can't show anyone what it was. I'd still like to get my questions about error messages answered, since I stil have lot of mistakes to make. ;)
tllewell
 
Posts: 76
Joined: Thu Mar 01, 2012 4:06 pm



Return to Indicator Development

Who is online

Users browsing this forum: No registered users and 34 guests