Topics
Replies
Spotware
27 Mar 2023, 11:42
Dear trader,
Thank you for reporting your issue. Do you still experience this issue? If yes, please send us some troubleshooting information.
Best regards,
cTrader Team
@Spotware
Spotware
27 Mar 2023, 09:19
RE: RE: RE:
ctid4797769 said:
ctid4797769 said:
Spotware said:
Dear trader,
Do you still experience this problem using 4.6.2?
Best regards,
cTrader Team
It doesn't work for me to run all my bots with full access rights anymore. It was nice that we could quickly fix with this full access solution, but honestly, it's not serious that this error has been here since version 4.1 and we are now in 4.6.4 and the error is still here.
Whats the plan, is there anythin I can do on my PC to fix this.Thanks Dennis
I tryed with 4.6.4 it's the newest one?
Dear trader,
This issue happens on specific processors and environments. We do not have immediate plans to support those cases at the moment so you will need to use the FullAccess workaround at the moment.
Best regards,
cTrader Team
@Spotware
Spotware
20 Mar 2023, 11:09
Hi prasanthtp,
Our team has investigated your issue and here are our suggestions
- Don't use Thread.Sleep(). Use Timer instead of it.
- Don't use Environment.Exit(0) - it kills the cBot process. Use the Stop() function.
Find a code example below
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using System.Threading;
namespace cAlgo.Robots
{
/*
1) Don't use Thread.Sleep(). Use Timer instead of it
2) Don't use Environment.Exit(0) - it kills cBot process. Use the `Stop()` function.
*/
[Robot(AccessRights = AccessRights.None)]
public class issue_40281 : Robot
{
[Parameter("Event Hours (24HR format)", Group = "WebSite")]
public int EventHours { get; set; }
[Parameter("Event Mins", Group = "WebSite")]
public int EventMins { get; set; }
public bool showMessage = true;
protected override void OnStart()
{
var economicEventTime = DateTime.Now.Date.AddHours(EventHours).AddMinutes(EventMins);
ShowMessage("Current Local Time : " + DateTime.Now.ToString());
ShowMessage("Economic news Local Time : " + economicEventTime.ToString());
/*
you can also use event `TimerTick` to handle it in custom event handler instead of embedded OnTimer callback.
Timer.TimerTick += OnTimerTick;
private void OnTimerTick()
{
}
*/
if (DateTime.Now < economicEventTime)
Timer.Start((int)economicEventTime.Subtract(DateTime.Now).TotalSeconds);
}
protected override void OnTimer()
{
Print("OnTimer");
Timer.Stop();
var ExecutResult = ExecuteMarketOrder(TradeType.Sell, "AUDUSD", 5000, Guid.NewGuid().ToString(), null, 20);
}
protected override void OnException(Exception exception)
{
ShowMessage("OnException: " + exception.Message);
if ((exception.InnerException != null))
ShowMessage("OnException Inner: " + exception.InnerException.Message);
Stop();
}
protected override void OnError(Error error)
{
ShowMessage("Error :" + error.ToString());
ShowMessage("Error Code:" + error.Code.ToString());
Stop();
}
private void ShowMessage(string message)
{
if (showMessage)
Print(message);
}
}
}
Best Regards,
cTrader Team
@Spotware
Spotware
15 Mar 2023, 08:19
Dear notzen,
If the issue is constantly reproducible, please contact us at community@ctrader.com to arrange a TeamViewer session.
Best regards,
cTrader Team
@Spotware
Spotware
14 Mar 2023, 12:58
Hi prasanthtp,
Unfortunately we were not able to identify the problem based on the troubleshooting information we received. If you are still able to reproduce the problem in 4.6.4, we would like to arrange a TeamViewer session so that our team can inspect the issue locally on your computer. If you can help us with this, please contact us at community@ctrader.com.
Best Regards,
cTrader Team
@Spotware
Spotware
29 Mar 2023, 09:09
Dear trader,
Thanks for reporting this problem. Which version of cTrader do you use?
Best regards,
cTrader Team
@Spotware