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;
namespaceEKVWCD
{
[Robot(AccessRights = AccessRights.None)]
publicclassEKVWCD : Robot
{
protectedoverridevoidOnStart()
{
#if DEBUG
System.Diagnostics.Debugger.Launch();
#endif
}
protectedoverridevoidOnBarClosed()
{
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.
This website uses cookies to enhance site navigation, analyze site usage, and assist in our marketing efforts. By clicking “Accept All” you are providing your consent to our use of all cookies. Alternatively, please provide your choice by pressing “Customize Cookies”. For more information, please read our Privacy policy
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