The only viable way to pause a cBot runtime during backtesting (mainly visual mode) is using windows forms.
public void Pause()
{
if (!IsDebugEnabled) return;
Print("[DEBUG] pausing the cBot runtime.");
var result = System.Windows.Forms.MessageBox.Show("Do you want to continue?", "Confirmation", MessageBoxButtons.OKCancel, MessageBoxIcon.Information);
if (result == DialogResult.OK)
{
Print("[DEBUG] resuming the cBot runtime.");
}
else
{
Stop();
}
}
You also need to enable windows forms in the dotnet solution
agalbenus
26 Jul 2023, 16:28 ( Updated at: 26 Jul 2023, 16:38 )
The only viable way to pause a cBot runtime during backtesting (mainly visual mode) is using windows forms.
You also need to enable windows forms in the dotnet solution
and use dotnet sdk for compiling the cBot instead of embedded compiler. You can do that in cTrader settings→Automate→Select Compiler
@agalbenus