Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
Compiling errors when changing code from NT7 to NT8
Kindly pardon my noob question as while i try to convert some NT7 to NT8 codes with my very limited knowledge.
I've the following code from NT7 which i try to convert to NT8 code but i get the following error "Cannot apply indexing with [] to an expression of type double". any kind soul can advise how i should really approach the problem? Thanks in advance.
NT7
if (base.Instrument.MasterInstrument.Compare(base.High[5], base.High[4]) == -1 && base.Instrument.MasterInstrument.Compare(base.High[4], base.High[3]) != -1)
{
LH = High[4];
LHCntr = 4;
if (!LDirToggle)
{
LH_Point.Set(4, LH);
for (int i = 0; i <= 4; i++)
{
LH_Line.Set(i, LH);
}
}
}
NT8
if (base.Instrument.MasterInstrument.Compare(base.High[5], base.High[4]) == -1 && base.Instrument.MasterInstrument.Compare(base.High[4], base.High[3]) != -1)
{
LH = base.High[4];
LHCntr = 4;
if (!LDirToggle)
{
LH_Point[0][4] = LH;
for (int i = 0; i <= 4; i++)
{
LH_Line[0][i] = LH;
}
}
}
Can you help answer these questions from other members on NexusFi?
At first glance (i.e. without reading the whole code and what it is trying to do), the error message seems to say that you somewhere have declared a variable of type double, i.e. a variable that can store non-integer values.
Then the code is seeing that you are trying to index that variable, i.e assign it a value that cannot be non-integer.