int myInteger = (10 > 12 ? 3 : 4);
Print(MyInteger.ToString());
// ^^^ - "MyInteger" with a capital "M" is unknown
/*
The above conditional statement says assign the value 3 to the variable myInt if 10 is greater than 12 else assign the value 4 to the variable myInt. The example will then print the value of 4 to the NinjaTrader output window since 10 is not greater than 12.
*/
/*
String Concatenation
To append one string to another string use the "+" character.
*/
// Example of string concatenation
string wordOne = "Ninja";
string wordTwo = "Trader";
Print(MyInteger.ToString());
/*
The above example would print out NinjaTrader to the NinjaTrader output window.
No it doesn't! Neither the Print() statement or the example shows string concatenation
*/
// -----
// Another possible error is:
// Second example of using a relational operator in conjunction with logical operator
double myDouble = 1000.25;
if (myDouble < 1000 || myDouble > 1001)
{
Print("Variable myDouble is between 1000 and 1001");
}
// Nowhere are we told what the expected output is, so its only a "possible" error.
// It should at least be noted that the Print() statement will not be executed.
// ---------------------------------
// I found the above errors in the first 5 minutes of reading the Help Guide.
Comment