Execute trades examples using LinqToExcel and LINQ to easily read an Excel or CSV file into your Automated Trading Robot.
Please note that this is an example project for Microsoft Visual Studio and not a working robot.
I found this very useful tool for working with Microsoft Excel data and I would like to share it with you. If you need to get data out of Excel, this can be done using ADO.NET. However using LINQ to Excel makes this very easy for people who are not experienced, programmers.
DATA - ANALYSIS - TRADE
This robot is an example to demonstrate the power you can have at your fingertips using cTrader, cAlgo and C#, this robot reads trades from an Excel file and executes them in real-time with robot, you can dynamically modify the trade results with user-defined parameters from the robots user interface or from within the code.
Watch the YouTube video about LinqToExcel to find out more...
THE SIMPLEST WAY OF READING DATA FROM EXCEL
The example shows a list of trades for the day that has been entered into a spreadsheet with separate sheets for different instruments, it does not matter if this would not be useful in real life, it is just to show what can be accomplished and possibilities. The image below shows information for opening new positions when the price reaches the entry price, the expiry date and time allow you to filter these out using LINQ from within your robot.
You will notice in the source code that there is a class called DailyTrade, this class is the data container which will automatically be populated with data from the spreadsheet.
As you can see the class name is the same as the spreadsheet name dailyTrades.xls and each property has an attribute [ExcelColumn], this maps to the name of columns in the spreadsheet, so the property name does not have to be the same as the property name and you can have spaces in the column name.
The code that injects all the data into the class is a collection of DataTrade objects, so you will end up with a list of daily trades which you can iterate through to open the trades. You will be able to access the data in a clean and readable manner like; trade.EntryPrice or trade.ExpiryDate.
Prerequisites
To use this project, you will need Microsoft Visual Studio, which is free to download and the standard with C# software development.
Our Development Service
We also offer a custom development service to help you build your trading robots and indicators.