Topics
Replies

dinhero
19 Feb 2013, 07:05

Support I need your help, here is the error I get :

system.argumentoutofrangeexception startindex cannot be less than zero


this the concerned bloc of code

   try
        {
        
          	  MWNumericArray x= null; 
	          MWNumericArray y= null;
	          MWNumericArray z= null;
          
         	  simpleAC fonction = new simpleAC();
    
          
              x = 9; 
              y = 8;
        
        }catch(Exception e){
        
        Print(e);
        
        }




@dinhero

dinhero
19 Feb 2013, 06:58

Support, find us a way in cAlgo so we can export or copy the log !!!!


@dinhero

dinhero
19 Feb 2013, 06:52

Hi support , can it exist any kind of problem if importing a 64 bit dll ?


@dinhero

dinhero
19 Feb 2013, 06:51

RE:
admin said:

You don't need a reference for that example. It is using a system namespace:  InteropServices

 

using System.Runtime.InteropServices;

 

we do need more example with dll import, this is a crucial aspect for all strategiste builder, thank you


@dinhero

dinhero
19 Feb 2013, 06:49

RE:

please support produce us a matlab example, that we could use. 

best regards 


@dinhero

dinhero
19 Feb 2013, 06:47

RE: RE:
dinhero said:
admin said:

Please refer to the MathWorks website for help on using Matlab with C#.

OK, I really like cAlgo, so I will try to give it one more try, ok ?

This is my question in my Matlab path : when I am getting the code to run, cAlgo produce an error, I need to know what this error is, so I can correct it. 

I put a try{}catch bloc in my code, but where can I print this error ? there no console. SO  the question would be how can I write in the cALgo log, so I can read in detail the error ?

{this is a very simple/basic things, MT4 have the "print" function}

ok, I get the print to log function, is Print (lol)


@dinhero

dinhero
18 Feb 2013, 21:47

RE:
admin said:

Please refer to the MathWorks website for help on using Matlab with C#.

OK, I really like cAlgo, so I will try to give it one more try, ok ?

This is my question in my Matlab path : when I am getting the code to run, cAlgo produce an error, I need to know what this error is, so I can correct it. 

I put a try{}catch bloc in my code, but where can I print this error ? there no console. SO  the question would be how can I write in the cALgo log, so I can read in detail the error ?

{this is a very simple/basic things, MT4 have the "print" function}


@dinhero

dinhero
18 Feb 2013, 21:36

RE:
admin said:

Please refer to the MathWorks website for help on using Matlab with C#.

I already tried, this does not work.

and YOU ? owner/coder/admin of cAlgo, did you test if cAlgo C# was truly compatible with other things? or should be wait. In this case, it would be better just to wait up to your program be mature. 

Please produce us some real matlab example done by you, 

 

Best regards

 


@dinhero

dinhero
18 Feb 2013, 21:35

RE:
admin said:

Please refer to the MathWorks website for help on using Matlab with C#.

I already tried, this does not work.

and YOU ? owner/coder/admin of cAlgo, did you test if cAlgo C# was truly compatible with other things? or should be wait. In this case, it would be better just to wait up to your program be mature. 

 


@dinhero

dinhero
18 Feb 2013, 05:44

I am trying to interact with dll made under matlab, it does not work. so now I know why..... I will be waiting for the next update of your platform. 

but since you work under .net, you should give a full access to .net dll to cAlgo, really. 

Thank you

 

>> this is a return to MT4/JForex for now


@dinhero

dinhero
18 Feb 2013, 05:33

RE:
admin said:

Yes, you need to add reference and locate your dll and include it.

 

 

This is not working with Matlab dll; did you try some test ?


@dinhero

dinhero
18 Feb 2013, 05:29

RE:

Hi

does it the where one should import dll in the code ??? 

what about the "Add Reference" button ?

 

Dominique


@dinhero

dinhero
17 Feb 2013, 14:19

RE: RE:
admin said:
lesliel said:

The documentation does not tell anything about calling the methods of an external C/C++ library (dll).

  • Does it work at all? (e.g. using P/Invoke)
  • Where should the external dll be copied to?
  • When would this information (along with some short tutorial) be added to the documentation?

What kind of protection do you provide for the robots/indicators? Is there any tutorial about it?

 

 

See this example for P/Invoke and external dll calls:

P/Invoke Example

sorry admin, but in this example, look like you are not following what you are seing befor here : 

 

To add a reference please use the "Add Reference" button on the top menu next to build. You may then locate the dll in your file system and add to your robot/indicator.

 did you add the reference of user32.dll in the cBot in order to make the external dll to work ?


@dinhero

dinhero
17 Feb 2013, 14:04

compiling to C#

2. Compiling the C# code; 

we compile the code  in order to have the .net component, as result we will have the 2 following dll

- simpleA.dll

- simpleANative.dll

now the idea will be to find a way to import it in cAlgo, and to use it in an cBot. 

Of course several prerequies have to be meet : matlab or the MCR have to be install... other prerequises we will find when implementning, you know as this kind of thing is.

 


@dinhero

dinhero
17 Feb 2013, 13:36

begining

so before going too far, you have to know that I have basic Matlab knowlege as well C#, so this is a path we will going to have together;

1. The function

we will start by creating a simple attion function in matlab, which addition the 2 number passed as parameter

function y = simpleAdd(x,z)
%MAKESQUARE Magic square of size x.
%   Y = MAKESQUARE(X) returns a magic square of size x.
%   This file is used as an example for the MATLAB 
%   Builder NE product.

%   Copyright 2001-2007 The MathWorks, Inc.
%   $Revision: 1.1.6.1 $  $Date: 2008/06/24 17:09:41 $

  y = x+z;

we can test the function in matlab 


 


@dinhero