The error occurs on a Pepperstone Live account but when I switch to the Demo one everything works fine.
The minimal code producing the error is:
using cAlgo.API;
using cAlgo.API.Indicators;
using System.Diagnostics;
using System.Security.Cryptography;
namespace EKVWCD
{
[Robot(AccessRights = AccessRights.None)]
public class EKVWCD : Robot
{
protected override void OnStart()
{
#if DEBUG
System.Diagnostics.Debugger.Launch();
#endif
}
protected override void OnBarClosed()
{
ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 0.1, "TEST", 100, 100);
}
}
}
EDIT:
After doing plenty of tests I found out that running an ExecuteMarketOrder inside the OnBarClosed() event raises such error. When running it on the OnTick() or OnBar() events that error doesn't get produced. As such it seems that it is a cTrader Automate bug,
To make sure @Spotware sees this, please also report this issue and link to thread via the cTrader desktop app:
Thanks!
I just reported the error even though there was a character limit on the Report Technical Issue page and I had some difficulty as the limit doesn't allow you to copy-paste any source code larger than a few lines.
Could you pleasesend us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.
firemyst
08 Aug 2023, 00:02 ( Updated at: 21 Dec 2023, 09:23 )
To make sure @Spotware sees this, please also report this issue and link to thread via the cTrader desktop app:
@firemyst