Tutorials needed

Created at 17 Feb 2013, 12:17
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
IR

iRobot

Joined 17.02.2013

Tutorials needed
17 Feb 2013, 12:17


Hi,

 

are any tutorials on how to write commands on C# for cAlgo?

I am quite new at algo trading and C#, so I don't even understand if command "lastIndex = slowMa.Result.Count - 1" gives number of the index or actual value on that index.

 

These basics would be very helpful.

 

Thanks.


@iRobot
Replies

cAlgo_Fanatic
20 Feb 2013, 11:47

RE:
iRobot said:

Hi,

 

are any tutorials on how to write commands on C# for cAlgo?

I am quite new at algo trading and C#, so I don't even understand if command "lastIndex = slowMa.Result.Count - 1" gives number of the index or actual value on that index.

 

These basics would be very helpful.

 

Thanks.

Hello,

The cAlgo API is written in C# programming language and thus coding robots in cAlgo means coding in C# as well. Therefore, I suggest this website to get started with basics of the C# language:

http://www.csharp-station.com/Tutorial.aspx

The above statement will give you the value of the last index in the slowMA DataSeries. The value on that index would be coded like: 

slowMA.Result[slowMA.Result.Count-1]

or better

var lastIndex = slowMA.Result.Count - 1;  // last index
var value = slowMA.Result[lastIndex];      // value at last index

A DataSeries is indexed at 0. Which means the first item has index 0, therefore the last item will be count - 1.

 

 

@cAlgo_Fanatic