Topics
02 May 2016, 12:49
 0
 2439
 3
01 May 2016, 09:21
 0
 3481
 5
01 May 2016, 07:36
 0
 4636
 9
Replies

martinplatt.com
03 May 2016, 14:53

Cheers bud.

I have a bunch of ideas to get around the current problems, and will keep with cTrader, and use it where I can, for sure.

This could be a really cool thing if it were open source too - just sayin' :)

 


@martinplatt.com

martinplatt.com
03 May 2016, 12:42

RE:

Paul_Hayes said:

Hi Martin,

I was just trying to be helpful, with cTrader you have the benefit of harnessing the power of .NET with C# as the programming language, as standard you use Visual Studio for the development. Remember you can have separate class files in the project, you do not need external assemblies. I will stop trying to help now.

good luck :-)

Yeah, I know you can have separate class files in one file, but they're then not reusable - or they are, but only by copying and pasting them.

I'm trying to make suggestions that will make cAlgo better than MT4 and MQL4, and at the moment it isn't, as you can use C++ in mql4, and split code into multiple files without leaving the mql editor.

I know this is early days, but would love to see this go places.

I would like to have conversations with you about stuff you can help with, but as I said in the beginning I have been using .NET since before it was in beta (2002) - this sort of a project is a much smaller project than I would normally be doing, but the same principles apply.  

I think it's awesome that there is the ability to switch between environments, so I'm trying to figure out if I should be spending my time suggesting stuff for cAlgo and the editor in there, or working on addins for visual studio to achieve the same from the Visual Studio end.

No idea if there's anyone else around in the forums, as so far it appears to be only you and I, and I sincerely hope that that is not the case.  If it is, I will stop suggesting things, and go think of a better way to hook into environments for trading.

There's ninjatrader which uses C# as well, wasn't overly impressed with the trading environment there, hoping this will be a better experience.

 

Cheers,

 

Martin.


@martinplatt.com

martinplatt.com
03 May 2016, 10:49

RE:

Paul_Hayes said:

Hi Martin,

You do not need to use assemblies, you can have a single Visual Studio project and put as many files with classes in there as you wish. The cAlgo IDE only allows a single file as it is for very basic use, but with VS you can have a normal development environment. 

Do this, edit your cAlgo cBot with Visual Studio and just add any additional classes files you require, reference them from your main cBot class and when you compile your algo file it will compile the whole project with all related .cs files

cTDN Website Limitations

you may be referring to the cTDN website which does not support multiple file uploaded of projects, so if you want to upload your VS project with multiple files it will only show your cBot class and not any referenced classes, this could your issue. The classes are there, they are just not shown on the website.

I still mean multiple files that make up the bot, and something so that you could reference a class stored in a file.  The only way I can see to do this is through a DLL.

But I wanted something like MT4, where there is an include folder, and you can add your own folders and code files to arrange in whatever way you want to.  THAT is what I am suggesting.

Using visual studio isn't relevant, as we're making suggestion on improvement to cAlgo. 

You suggestion of putting everything into one DLL, whilst that might seem a clever idea, when you develop large projects that reference multiple libraries, that becomes inplausible very quickly.  I want to develop libraries like I have in MT4.  That really shouldn't be a difficult thing to implement in cAlgo, but would improve turn around times for new projects.


@martinplatt.com

martinplatt.com
03 May 2016, 01:12

RE:

Paul_Hayes said:

Hi Martin,

Not quite sure about the question, but take a look at partial classes.

I think your question relates to the Microsoft .NET framework with the C# programming language, you may be better off asking them on a forum like stack exchange  or Msdn as the cTrader platform offers an API for automated trading and not how you would design or use the C# programming language with .NET.

I hope you find the answers to your questions by visiting one of the above sites.

Paul. :-)

Hi Paul,

I meant simply being able to have multiple files with different classes in them be possible.  Currently has to all go into one file - they only way to separate things is to use visual studio to create DLLs to use by cAlgo.  Seems like it would be good to be able to segregate classes by file.

I'm currently questioning things that are related to design and best practices, and flow, because I believe these to be more important than getting into technical details at this point.  Once those fundamentals are dealt with then will be good to look at the technical aspects.

 

Cheers,

 

Martin.


@martinplatt.com

martinplatt.com
02 May 2016, 14:13

RE:

martinplatt.com said:

Need to be able to specify things like the minimum equity, as I'm getting results with great balances, and negative equity.

That then brings me to the next point, wouldn't it stop out at 50% in the real world?  Need to be able to simulate that, else it's a pointless exercise.

 

Cheers!

Just on that, would be good to have conditions, such as equity = balance, or equity > 0 something like that.

Also would be really good to be able to sort columns by first, then second, third and so on, so you can get sorted by say equity, then fitness, then balance...


@martinplatt.com

martinplatt.com
02 May 2016, 10:16

RE:

Paul_Hayes said:

Hi Martin,

You should be able to just extend the API with your own object hierarchy to suit any patterns you would like to implement, you will also serialize the data for persistence.

My apologies if you already know this, but all your candle patterns would benefit from using Unified Modelling (UML) or amore modern technique with Agile Modelling (AM)

The API is very basic and has limited or no interface-based architecture as far as I am aware, if you create a simple cBot you should be able to see all that is available through the Robot base class.

Hey Paul,

Nice to meet you.

Candle patterns - I didn't mean programming patterns, I meant things like so that I could easily recognise say a bearish engulfing bar, morning star and so on.  

Am very familiar with UML, and the various modelling, the problem I was having from the basic look at cAlgo, was that I couldn't find a definition for the interface as such, and therefore as I wanted to use my own interface and decouple the code I write (MarketSeries seems from first looks as if it's a bit of an all purpose class that really should be decomposed?).  I'm sure I can do that, it will just have to be via trial and error, by the looks.

I think this is a little a case of my unfamiliarity with the interface, although I have bots going, and think I have my head around things a little more now.  

I don't want to have things like MarketSeries floating around other unrelated classes, and this was what I was hoping to get a proper definition of.

To do things in a nice clean OO manner, we need to be able to do that, else what we have is basically the same deal as with MT4, but in C#.  

In MT4 for example I went to C++ to try to get a nice library going, which in the most part works, just that MT4 is a bit old, and not seems to struggle to do anything at any sort of speed when there is a class hierarchy.

With MT4, you could however create classes and put them into an "include" folder, and have subfolders, so they were easily accessible.  Doesn't seem possible in cAlgo at this point.  I hope this changes, as it has a lot of potential.

Cheers,

 

Martin.


@martinplatt.com

martinplatt.com
01 May 2016, 09:28

I'd like an answer on the Interfaces question, however, after a coffee - that was the key - I can use logic in the Indicator or robot to call constructors for a candle object, passing in the relevant values, then get it to initialize and categorize itself.  Doh.  Apologies for asking that daft question!


@martinplatt.com