Topics
Replies
eprofservices
14 Oct 2022, 11:57
( Updated at: 14 Oct 2022, 11:59 )
RE:
Spotware said:
Can you share some source code that will allow us to reproduce the problem?
Yes. The source code is standard "Sample cBot Reference SMA" as installed with cTrader:
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
//
// This cBot is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
//
// All changes to this file might be lost on the next application update.
// If you are going to modify this file please make a copy using the "Duplicate" command.
//
// -------------------------------------------------------------------------------------------------
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class SamplecBotReferenceSMA : Robot
{
[Parameter("Source")]
public DataSeries Source { get; set; }
[Parameter("SMA Period", DefaultValue = 14)]
public int SmaPeriod { get; set; }
private SampleSMA sma;
protected override void OnStart()
{
sma = Indicators.GetIndicator<SampleSMA>(Source, SmaPeriod);
}
protected override void OnTick()
{
Print("{0}", sma.Result.LastValue);
}
}
}
But you probably won't be able to reproduce the error that easily. I tried to preproduce it myself on clean Win10 installation with only cTrader installed + dotnet 6.0 sdk (6.0.402) + some IDEs like Rider and Visual Studio Code and it works fine. There must be some conflict with other software I have on development machines - shared library update or something I don't know.
In any case, cTrader should not crash with exception.
Is the source code of cTrader available to debug?
@eprofservices
eprofservices
04 Dec 2022, 12:54
RE: RE:
eprofservices said:
I have found the way to reproduce the error and it looks that the cTrader (or Automate part) do not support creating symbolic link of source directory (...\Documents\cAlgo) to point into some other location (Windows link not Linux) especially the network drive location as I did. I don't know why because it should work on system level.
To reproduce the error please move the cAlgo from Documents into some network location (preferably on the separate machine - file server) and then create symbolic link:
Then my question is how to change the cAlgo location because after installation it is fixed to Documents directory and this is not (in general) good location for development sources.
@eprofservices