acrigney

Info
Username: | acrigney |
Name: | acrigney |
Member since: | 25 May 2017 |
About
Signature
Last Forum Posts
@Debugging still not working: 03 May 2023, 06:26
Awesome thanks heaps mate, you have really saved my bacon!! What kind of bots do you build? I build ML ones.
firemyst said:
> So sorry gus yes it worked with FullAccess using the launch debugger but it does not work with trying to attach, that is the normal way I try and do it with my bots.
> It says symbols have not been loaded. Looks like you have to specify the location of the symbols but I have never had to do that before.
Because everything now runs under its own process, you could have literally hundreds of calgo processes running, and wouldn't know which one to attach to.
The new way of debugging automatically handles that for you. When prompted, select the VS instance you're currently working in (as per the instructions on the web page) making sure you're running it in "debug" mode, and you'll be able to step through the code as per usual.
@Debugging still not working: 03 May 2023, 05:52
So sorry gus yes it worked with FullAccess using the launch debugger but it does not work with trying to attach, that is the normal way I try and do it with my bots.
It says symbols have not been loaded. Looks like you have to specify the location of the symbols but I have never had to do that before.
firemyst said:
acrigney said:
Thanks mate, the debugger is not launched but the code says it was.
Also when I try and attach it says that no symbols have been loaded for the current document.
As I said I have been doing this for years but ever since the upgrade to support .net 6 it has never worked.
Here is some sample code.
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;namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.None)]
public class DummyBot6 : Robot
{
[Parameter(DefaultValue = "Hello world!")]
public string Message { get; set; }[Parameter(DefaultValue = "Hello world!")]
public string Message2 { get; set; }protected override void OnStart()
{
var result = System.Diagnostics.Debugger.Launch();if (result is false)
{
Print("Debugger launch failed");
}
else if (result is true)
{
Print("Debugger launched");
}// To learn more about cTrader Automate visit our Help Center:
// https://help.ctrader.com/ctrader-automatePrint(Message);
Print("onstart");
}protected override void OnTick()
{
// Handle price updates here
}
protected override void OnBar()
{
double x = 0, y = 0, z = 0,p =0;
Print("AddClose");
for (int j = 0; j < 3; j++)
{
x = (float)Bars.ClosePrices.Last(j + 1);
y = (float)Bars.OpenPrices.Last(j + 1);
z = (float)Bars.HighPrices.Last(j + 1);
p = (float)Bars.LowPrices.Last(j + 1);
}
Print(String.Format("lengths {0} {1} {2} {3}", x, y, z, p));
}
protected override void OnStop()
{
// Handle cBot stop here
}
}
}PanagiotisChar said:
Hi there,
There are clear instructions here
Which step does not work for you?
You need to follow the instructions. Your code clearly shows you haven't:
@Debugging still not working: 02 May 2023, 08:40
Thanks mate, the debugger is not launched but the code says it was.
Also when I try and attach it says that no symbols have been loaded for the current document.
As I said I have been doing this for years but ever since the upgrade to support .net 6 it has never worked.
Here is some sample code.
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;
namespace cAlgo.Robots
{
[Robot(AccessRights = AccessRights.None)]
public class DummyBot6 : Robot
{
[Parameter(DefaultValue = "Hello world!")]
public string Message { get; set; }
[Parameter(DefaultValue = "Hello world!")]
public string Message2 { get; set; }
protected override void OnStart()
{
var result = System.Diagnostics.Debugger.Launch();
if (result is false)
{
Print("Debugger launch failed");
}
else if (result is true)
{
Print("Debugger launched");
}
// To learn more about cTrader Automate visit our Help Center:
// https://help.ctrader.com/ctrader-automate
Print(Message);
Print("onstart");
}
protected override void OnTick()
{
// Handle price updates here
}
protected override void OnBar()
{
double x = 0, y = 0, z = 0,p =0;
Print("AddClose");
for (int j = 0; j < 3; j++)
{
x = (float)Bars.ClosePrices.Last(j + 1);
y = (float)Bars.OpenPrices.Last(j + 1);
z = (float)Bars.HighPrices.Last(j + 1);
p = (float)Bars.LowPrices.Last(j + 1);
}
Print(String.Format("lengths {0} {1} {2} {3}", x, y, z, p));
}
protected override void OnStop()
{
// Handle cBot stop here
}
}
}
PanagiotisChar said:
Hi there,
There are clear instructions here
Which step does not work for you?
@Debugging still not working: 01 May 2023, 15:35
Guys please for the last year now, I have been unable to attach the VS2022 debugger to any cbot. Either an old .net 4 cbot or a new .net 6 one.
Can someone please help! I am sick of putting print statements in!
@VS 2022 debug doesn't connect to cTrader 4.2: 28 Apr 2023, 14:59
Yes mate my boss have FullAccess but still no luck with any of the recent versions including the latest my broker TopDx has which is 4.6.6
Can you post a video showing creating and debugging a bot please?
PanagiotisCharalampous said:
Hi acrigney,
Did you set your cBot's access rights to FullAccess?
Best Regards,
Panagiotis
@"ChatGpT like" machine learning AI: 28 Apr 2023, 00:59
Dear Alex,
I have developed a generic ML framework using Microsoft's ML.NET that uses templated types called generics. Not sure of your programming experience but that means that if you give me a data stream I can very quickly build models. With Python ML there is no generic interface for the ML libraries so they have to copy and paste their code for every problem. This makes it very hard to build generic solutions! I have used my ML framework for trading for about 2 years now but you also need the catching/recovery/filtering options which are just as important. However I found that the minute data was not accurate enough with ctrader and I have tried using the tick data but this gave models that converged nicely but gave inconsistent results. So now I am back to using minute data but I have added renko data and also derivatives. I have many types of models too, but I have not used models on multi timeframes and maybe I should do that. There was another problem that it was a huge change to move to .net 6. I have had to rebuild a very large amount of code, it should have been easy but many issues had to be fixed and also I am still unable to attach the debugger to my bots and I have complained to ctrader many times but they just say it works and a lot of other people have this problem too. I don't think chatgpt is going to work unless you are thinking of long term trades as in over days or hrs. I think the longest timeframe you can trade is a minute as the market can move so fast. But I want to incorporate chatgpt too as well maybe for stock/options trading. I trade on the index markets.
I would love you to join me in my efforts and testing, its been very hard to find traders who are interested in using ML!! My ML uses AutoML, that means that it will find the best mode and auto feature engineering while the model is being built. Also it can tell you why it has made the prediction for every prediction.
Best Regards,
Alistair
alexsanramon said:
Good Day,
I hope this message finds you well. I am writing to respectfully request your assistance on building a simple indicator that has machine learning capability. Suppose a momentum indicator that has been fed with 2 years of machine learning data and can forecast only 1 bar of future data.
I understand that your time is valuable, but I would greatly appreciate any guidance or insight you can provide on this matter.
Thank you for your consideration.
Sincerely,
Alex
@What’s New in cTrader Desktop 4.7: 19 Apr 2023, 14:04
Not to mention that I still cannot get debugging to work in VS2022, no version works I am using VS2022 17.6.0 Preview 3
acrigney said:
Guys I have had a lot of issues with upgrading my bots to .net 6 and my latest problem is that my nuget references are not found when the bots run.
With .net 6 we are now using PackageReference as explained here
- Performance improvements: When using PackageReference, packages are maintained in the global-packages folder (as described on Managing the global packages and cache folders rather than in a
packages
folder within the solution. As a result, PackageReference performs faster and consumes less disk space.But I have found that I have had to manually add the references to get this to work. And this was the old way as well from reading a previous post. Moving forward manually having to add package references is really a pain when the references should just be found from the global reference. I am surprised that others don't seem to have had this problem recently?
Best Regards,
Alistair
@What’s New in cTrader Desktop 4.7: 19 Apr 2023, 13:57
I see other people are getting their questions answered. I fixed the issue as I found that the normal package references are not supported and you have to include all of the references that a package has internally, I was hoping that they could be picked up by the global references but they are not.
Also it seems that the robustness of ctrader has suffered since the upgrade to .net 6, e.g now I have to build twice, once in visual studio but ctrader still says that the bot has changed and needs to be rebuilt so I have to click the build button in ctrader. Actually the compile speed was has greatly improved thought!
acrigney said:
I have added the nuget references directly by finding their locations and using add reference for the dlls but still at runtime the correct versions of the dlls are not found.
So the hint path is being ignored. Apparently the hint path is only for the compiler so its not used at run time.
<Reference Include="Microsoft.ML.Data">
<HintPath>..\..\..\..\..\..\.nuget\packages\microsoft.ml\2.0.1-preview.22573.9\lib\netstandard2.0\Microsoft.ML.Data.dll</HintPath>
<SpecificVersion>True</SpecificVersion>
</Reference>I have tried with and without the specific version but I still get the error that the version of the dll is not found,
So I get errors like this
Could not load file or assembly 'Microsoft.ML.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
acrigney said:
Guys I have had a lot of issues with upgrading my bots to .net 6 and my latest problem is that my nuget references are not found when the bots run.
With .net 6 we are now using PackageReference as explained here
- Performance improvements: When using PackageReference, packages are maintained in the global-packages folder (as described on Managing the global packages and cache folders rather than in a
packages
folder within the solution. As a result, PackageReference performs faster and consumes less disk space.But I have found that I have had to manually add the references to get this to work. And this was the old way as well from reading a previous post. Moving forward manually having to add package references is really a pain when the references should just be found from the global reference. I am surprised that others don't seem to have had this problem recently?
Best Regards,
Alistair
@What’s New in cTrader Desktop 4.7: 17 Apr 2023, 15:49
Guys can someone pick this up, I can pay someone to fix this?
acrigney said:
I have added the nuget references directly by finding their locations and using add reference for the dlls but still at runtime the correct versions of the dlls are not found.
So the hint path is being ignored. Apparently the hint path is only for the compiler so its not used at run time.
<Reference Include="Microsoft.ML.Data">
<HintPath>..\..\..\..\..\..\.nuget\packages\microsoft.ml\2.0.1-preview.22573.9\lib\netstandard2.0\Microsoft.ML.Data.dll</HintPath>
<SpecificVersion>True</SpecificVersion>
</Reference>I have tried with and without the specific version but I still get the error that the version of the dll is not found,
So I get errors like this
Could not load file or assembly 'Microsoft.ML.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
acrigney said:
Guys I have had a lot of issues with upgrading my bots to .net 6 and my latest problem is that my nuget references are not found when the bots run.
With .net 6 we are now using PackageReference as explained here
- Performance improvements: When using PackageReference, packages are maintained in the global-packages folder (as described on Managing the global packages and cache folders rather than in a
packages
folder within the solution. As a result, PackageReference performs faster and consumes less disk space.But I have found that I have had to manually add the references to get this to work. And this was the old way as well from reading a previous post. Moving forward manually having to add package references is really a pain when the references should just be found from the global reference. I am surprised that others don't seem to have had this problem recently?
Best Regards,
Alistair
@What’s New in cTrader Desktop 4.7: 15 Apr 2023, 04:35
I have added the nuget references directly by finding their locations and using add reference for the dlls but still at runtime the correct versions of the dlls are not found.
So the hint path is being ignored. Apparently the hint path is only for the compiler so its not used at run time.
<Reference Include="Microsoft.ML.Data">
<HintPath>..\..\..\..\..\..\.nuget\packages\microsoft.ml\2.0.1-preview.22573.9\lib\netstandard2.0\Microsoft.ML.Data.dll</HintPath>
<SpecificVersion>True</SpecificVersion>
</Reference>
I have tried with and without the specific version but I still get the error that the version of the dll is not found,
So I get errors like this
Could not load file or assembly 'Microsoft.ML.Data, Version=1.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
acrigney said:
Guys I have had a lot of issues with upgrading my bots to .net 6 and my latest problem is that my nuget references are not found when the bots run.
With .net 6 we are now using PackageReference as explained here
- Performance improvements: When using PackageReference, packages are maintained in the global-packages folder (as described on Managing the global packages and cache folders rather than in a
packages
folder within the solution. As a result, PackageReference performs faster and consumes less disk space.But I have found that I have had to manually add the references to get this to work. And this was the old way as well from reading a previous post. Moving forward manually having to add package references is really a pain when the references should just be found from the global reference. I am surprised that others don't seem to have had this problem recently?
Best Regards,
Alistair