NexusFi: Find Your Edge


Home Menu

 





Compiling errors when changing code from NT7 to NT8


Discussion in NinjaTrader

Updated
    1. trending_up 1,131 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 2 posts
    2. attach_file 0 attachments




 
Search this Thread
  #1 (permalink)
gecko78
SINGAPORE
 
Posts: 1 since Aug 2018
Thanks Given: 0
Thanks Received: 0

Hi All,

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;
}
}
}


Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Prediction Markets Expiry Day: Trump Eyes War Exit, $230 …
Prediction Markets & Event Contracts
CFTC Opens First COT Report Review in 20 Years -- Asks W …
Traders Hideout
Irans Dual Probability: Guns Quiet at 99.95% While Forma …
Prediction Markets & Event Contracts
Double Deadlock: Rubio Calls Hormuz Tolls "Unfeasib …
Traders Hideout
US Navy Blockade of Hormuz Starts Today -- Oil Surges 8p …
Prediction Markets & Event Contracts
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Sober Journey With S&P
24 thanks
2026 Jlab journal
10 thanks
Algo automated / semi-automated trading anyone?
6 thanks
Lady Vols Primer: Trading Volatility Journal
6 thanks
Trying to learn Volume and price action correlation
5 thanks
  #3 (permalink)
 
xplorer's Avatar
 xplorer 
London UK
Site Moderator
 
Experience: Beginner
Platform: CQG
Broker: S5
Trading: Futures
Posts: 6,233 since Sep 2015
Thanks Given: 15,885
Thanks Received: 16,118



gecko78 View Post
Hi All,

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;
}
}
}

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.


Does it make sense?


Reply With Quote




Last Updated on February 25, 2019


© 2026 NexusFi®, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Downloads - Top
no new posts