during backtesting there is no button to Cancel/Stop/Break.
I'm attaching example of strategy code that can help to reproduce on your side and screenshot of the issue.
public class NTQuestionBacktestingCancelButtonNotVisible : Strategy
{
private List<string> entryNames;
protected override void OnStateChange()
{
if (State == State.SetDefaults)
{
Name = "NTQuestionBacktestingCancelButtonNotVisible";
Calculate = Calculate.OnBarClose;
}
else if (State == State.Configure)
{
entryNames = new List<string>();
}
}
protected override void OnBarUpdate()
{
var name = "Long" + CurrentBar;
EnterLong(name);
entryNames.Add(name);
for (int i = entryNames.Count-1; i >= 0; i--)
{
if(BarsSinceEntryExecution(entryNames[i]) >= 10)
{
ExitLong(entryNames[i]);
entryNames.RemoveAt(i);
}
}
}
}
Please take look, thanks!
Comment