With each complication of NinjaScript code, I receive the following error message in the NinjaTrader log:
class MoneyManagement2 : Strategy
{
protected double accountSize;
public MoneyManagement2(double accountSize)
{
this.accountSize = accountSize;
}
}
class FixedPercent2 : MoneyManagement2
{
private float fixedPercentage;
public FixedPercent2(double accountSize, float fixedPercentage)
: base(accountSize)
{
this.fixedPercentage = fixedPercentage;
}
}
- There are no errors in the NinjaScript editor after compiling,
- There are no errors or warnings in Visual Studio,
- As far as I know the above code example is correct,
- Creating an instance of these classes works and they can be used without errors.
- I'm running the latest stable version (7.0.1000.2)
Am I such an C# dummy or is NinjaTrader displaying some bug?
Regards,
Edit: Well, it turns out I'm such a dummy. The following code doesn't generate any errors in the NinjaTrader log, though I'm wondering why the default constructor isn't provided by the compiler:
class MoneyManagement2 : Strategy
{
protected double accountSize;
public MoneyManagement2(double accountSize)
{
this.accountSize = accountSize;
}
public MoneyManagement2() : base()
{
}
}
class FixedPercent2 : MoneyManagement2
{
private float fixedPercentage;
public FixedPercent2(double accountSize, float fixedPercentage)
: base(accountSize)
{
this.fixedPercentage = fixedPercentage;
}
public FixedPercent2() : base()
{
}
}
Comment