To override DisplayName of a strategy in NinjaScript is easy. To override DisplayName based on specific condition is also easy.
However, I struggle to display the default DisplayName if the specific condition is not true.
I can still display a the default Name see (1), but not the default DisplayName, see (2-3).
(1) This here works:
public override string DisplayName
{
get
{
if (myCondition)
{return "myName";}
else {return (Name);}
}
}
(2) This here can't work:
public override string DisplayName
{
get
{
if (myCondition)
{return "myName";}
else {return (DisplayName);} // default DisplayName was overridden before !!!
}
}
(3) This here doesn't work either:
stringDisplayName = (DisplayName); // This in itself works. Can print it.
public override string DisplayName
{
get
{
if (myCondition)
{return "myName";} // fine
else {return (stringDisplayName);} // Here is the issue, the string Variable is filled, but doesn't get displayed on the chart.
}
}
Any idea how to display the stringDisplayName with default DisplayName properties when the condition is not true?
Or how to otherwise access and display the default DisplayName, consisting of the Name of the Strategy and settings of all input parameters?
Thanks for letting me know.
NT-Roland
Comment